Move BN_CTX_start() call so the error case can always call BN_CTX_end().
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> MR #1231
This commit is contained in:
parent
99c2033375
commit
c804d23d73
@ -717,6 +717,8 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
|
|||||||
BIGNUM *dmp1, *dmq1, *c, *pr1;
|
BIGNUM *dmp1, *dmq1, *c, *pr1;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
BN_CTX_start(ctx);
|
||||||
|
|
||||||
local_dmp1 = BN_new();
|
local_dmp1 = BN_new();
|
||||||
local_dmq1 = BN_new();
|
local_dmq1 = BN_new();
|
||||||
local_c = BN_new();
|
local_c = BN_new();
|
||||||
@ -724,7 +726,6 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
|
|||||||
if (!local_dmp1 || !local_dmq1 || !local_c || !local_r1)
|
if (!local_dmp1 || !local_dmq1 || !local_c || !local_r1)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
BN_CTX_start(ctx);
|
|
||||||
r1 = BN_CTX_get(ctx);
|
r1 = BN_CTX_get(ctx);
|
||||||
m1 = BN_CTX_get(ctx);
|
m1 = BN_CTX_get(ctx);
|
||||||
vrfy = BN_CTX_get(ctx);
|
vrfy = BN_CTX_get(ctx);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user