aboutsummaryrefslogtreecommitdiff
path: root/crypto/ec/ecdsa_ossl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/ec/ecdsa_ossl.c')
-rw-r--r--crypto/ec/ecdsa_ossl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/crypto/ec/ecdsa_ossl.c b/crypto/ec/ecdsa_ossl.c
index 4b54a30cf9bc..775b7ec911be 100644
--- a/crypto/ec/ecdsa_ossl.c
+++ b/crypto/ec/ecdsa_ossl.c
@@ -130,7 +130,11 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
goto err;
}
- order = EC_GROUP_get0_order(group);
+
+ if ((order = EC_GROUP_get0_order(group)) == NULL) {
+ ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
+ goto err;
+ }
/* Preallocate space */
order_bits = BN_num_bits(order);
@@ -255,7 +259,11 @@ ECDSA_SIG *ossl_ecdsa_simple_sign_sig(const unsigned char *dgst, int dgst_len,
goto err;
}
- order = EC_GROUP_get0_order(group);
+ if ((order = EC_GROUP_get0_order(group)) == NULL) {
+ ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB);
+ goto err;
+ }
+
i = BN_num_bits(order);
/*
* Need to truncate digest if it is too long: first truncate whole bytes.