From de61c03cc7ac52e45d50504e8cf1dda2f5230b28 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 21 Jun 2017 15:54:45 +0100 Subject: [PATCH] Remove OPENSSL_assert() from crypto/ec Reviewed-by: Andy Polyakov (Merged from https://github.com/openssl/openssl/pull/3740) --- crypto/ec/ec_key.c | 3 ++- crypto/ec/ec_lib.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 4098be6f49..fb8c3ed756 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -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); } diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 47318d672a..baf94f6a57 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -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); } -- 2.25.1