X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fengine%2Fengine_openssl.c;h=b8d90757843de01bf307ec0702037a2a436b8376;hp=a6292a0af212841f51207735d943b0fb2d8b5ed7;hb=c62b26fdc6bb176541ec56498090ff6f2ad4a885;hpb=e0a9ba9c3c4ea7bf27ceff33633cd48b542de860 diff --git a/crypto/engine/engine_openssl.c b/crypto/engine/engine_openssl.c index a6292a0af2..b8d9075784 100644 --- a/crypto/engine/engine_openssl.c +++ b/crypto/engine/engine_openssl.c @@ -129,6 +129,7 @@ static int openssl_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_init(&r1); /* BN_mul() cannot accept const BIGNUMs so I use the BN_CTX * to duplicate what I need. */ + BN_CTX_start(bn_ctx); if ((temp_bn = BN_CTX_get(bn_ctx)) == NULL) goto err; if (!BN_copy(temp_bn, iqmp)) goto err; @@ -166,8 +167,7 @@ static int openssl_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, err: BN_clear_free(&m1); BN_clear_free(&r1); - if (temp_bn) - bn_ctx->tos--; + BN_CTX_end(ctx); if (!ctx) BN_CTX_free(bn_ctx); return(ret);