summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2018-05-07 10:27:45 +0200
committerAndy Polyakov <appro@openssl.org>2018-05-08 12:44:05 +0200
commit7d859d1c8868b81c5d810021af0b40f355af4e1f (patch)
treef7cb3c5640e74aca0b2f1e636518c4b8746575a5
parent61e96557f9eae0258074c9cec7ad6aa1b9dde1df (diff)
ec/ec_mult.c: get BN_CTX_start,end sequence right.
Triggered by Coverity analysis. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6190)
-rw-r--r--crypto/ec/ec_mult.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c
index 4f6689a946..6b5553c9b2 100644
--- a/crypto/ec/ec_mult.c
+++ b/crypto/ec/ec_mult.c
@@ -140,7 +140,9 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r,
int ret = 0;
if (ctx == NULL && (ctx = new_ctx = BN_CTX_secure_new()) == NULL)
- goto err;
+ return 0;
+
+ BN_CTX_start(ctx);
order_bits = BN_num_bits(group->order);
@@ -158,7 +160,6 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r,
EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME);
- BN_CTX_start(ctx);
lambda = BN_CTX_get(ctx);
k = BN_CTX_get(ctx);
if (k == NULL)