Remove OPENSSL_assert() from crypto/ec
authorMatt Caswell <matt@openssl.org>
Wed, 21 Jun 2017 14:54:45 +0000 (15:54 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 21 Aug 2017 07:44:44 +0000 (08:44 +0100)
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3740)

crypto/ec/ec_key.c
crypto/ec/ec_lib.c

index 4098be6f49e3d82553fe9a1abf1ebfcd4ef369f3..fb8c3ed756cf4b964591cbea91b26c4c42e58fa4 100644 (file)
@@ -191,7 +191,8 @@ int EC_KEY_generate_key(EC_KEY *eckey)
 
 int ossl_ec_key_gen(EC_KEY *eckey)
 {
-    OPENSSL_assert(eckey->group->meth->keygen != NULL);
+    if (!ossl_assert(eckey->group->meth->keygen != NULL))
+        return 0;
     return eckey->group->meth->keygen(eckey);
 }
 
index 47318d672a2b4a82bea519f7e9844e0afa1f655c..baf94f6a574ff796b42f11b6ffdeeb161f5c9ac3 100644 (file)
@@ -330,7 +330,8 @@ const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group)
 
 int EC_GROUP_order_bits(const EC_GROUP *group)
 {
-    OPENSSL_assert(group->meth->group_order_bits != NULL);
+    if (!ossl_assert(group->meth->group_order_bits != NULL))
+        return 0;
     return group->meth->group_order_bits(group);
 }