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 4098be6..fb8c3ed 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 47318d6..baf94f6 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);
 }