Check return value of ECDSA_Verify() correctly
authorMartin Willi <martin@revosec.ch>
Tue, 9 Apr 2013 08:56:09 +0000 (10:56 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 10 Apr 2013 16:10:30 +0000 (18:10 +0200)
src/libstrongswan/plugins/openssl/openssl_ec_public_key.c

index c8a45f7..38cc8be 100644 (file)
@@ -124,7 +124,7 @@ static bool verify_der_signature(private_openssl_ec_public_key_t *this,
        if (openssl_hash_chunk(nid_hash, data, &hash))
        {
                valid = ECDSA_verify(0, hash.ptr, hash.len,
-                                                        signature.ptr, signature.len, this->ec);
+                                                        signature.ptr, signature.len, this->ec) == 1;
                free(hash.ptr);
        }
        return valid;