summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_mult.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2018-05-07 10:27:45 +0200
committerRichard Levitte <levitte@openssl.org>2018-06-21 11:58:24 +0200
commitcc39f9250957dfe6e9f1b62a4eca1863e8451483 (patch)
tree365f3ce14891038946c055fea9105ed935f4f954 /crypto/ec/ec_mult.c
parent77b6b171a3b0a0f19ffcc8d4e682090fb88f0d10 (diff)
ec/ec_mult.c: get BN_CTX_start,end sequence right.
Triggered by Coverity analysis. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 7d859d1c8868b81c5d810021af0b40f355af4e1f) Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6549)
Diffstat (limited to 'crypto/ec/ec_mult.c')
-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 cac9591fac..52d88880b3 100644
--- a/crypto/ec/ec_mult.c
+++ b/crypto/ec/ec_mult.c
@@ -144,7 +144,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);
@@ -162,7 +164,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)