提交 7d859d1c 编写于 作者: A Andy Polyakov

ec/ec_mult.c: get BN_CTX_start,end sequence right.

Triggered by Coverity analysis.
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6190)
上级 61e96557
...@@ -140,7 +140,9 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, ...@@ -140,7 +140,9 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r,
int ret = 0; int ret = 0;
if (ctx == NULL && (ctx = new_ctx = BN_CTX_secure_new()) == NULL) 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); order_bits = BN_num_bits(group->order);
...@@ -158,7 +160,6 @@ static int ec_mul_consttime(const EC_GROUP *group, EC_POINT *r, ...@@ -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); EC_POINT_BN_set_flags(s, BN_FLG_CONSTTIME);
BN_CTX_start(ctx);
lambda = BN_CTX_get(ctx); lambda = BN_CTX_get(ctx);
k = BN_CTX_get(ctx); k = BN_CTX_get(ctx);
if (k == NULL) if (k == NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册