aboutsummaryrefslogtreecommitdiff
path: root/crypto/rsa/rsa_eay.c
diff options
context:
space:
mode:
authorPascal Cuoq <cuoq@trust-in-soft.com>2015-05-05 11:20:39 +0200
committerKurt Roeckx <kurt@roeckx.be>2015-10-07 18:54:13 +0200
commitc804d23d73bb2f3f6ffe29fbda4dd2fa151fa243 (patch)
treec8a2aa3fd7007d0b7f1fdad99ae1d55ee091e3d7 /crypto/rsa/rsa_eay.c
parent99c203337574d967c86ffbfa13f40ace51048485 (diff)
downloadopenssl-c804d23d73bb2f3f6ffe29fbda4dd2fa151fa243.zip
openssl-c804d23d73bb2f3f6ffe29fbda4dd2fa151fa243.tar.gz
openssl-c804d23d73bb2f3f6ffe29fbda4dd2fa151fa243.tar.bz2
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
Diffstat (limited to 'crypto/rsa/rsa_eay.c')
-rw-r--r--crypto/rsa/rsa_eay.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c
index 511ecb8..837e915 100644
--- a/crypto/rsa/rsa_eay.c
+++ b/crypto/rsa/rsa_eay.c
@@ -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;
int ret = 0;
+ BN_CTX_start(ctx);
+
local_dmp1 = BN_new();
local_dmq1 = 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)
goto err;
- BN_CTX_start(ctx);
r1 = BN_CTX_get(ctx);
m1 = BN_CTX_get(ctx);
vrfy = BN_CTX_get(ctx);