From c3b1424cc0c61fe0d7c0cdeccc50b001f8f66167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bodo=20M=C3=B6ller?= Date: Tue, 13 Jun 2000 13:50:42 +0000 Subject: [PATCH] Use BN_CTX_end when exiting early from BN_mod_exp_mont_word because BN_mod_exp_atalla could be used. --- crypto/bn/bn_exp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c index 470946e536..863df241f8 100644 --- a/crypto/bn/bn_exp.c +++ b/crypto/bn/bn_exp.c @@ -692,7 +692,10 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, { BN_set_word(t, a); if (BN_mod_exp_atalla(rr, t, p, m)) + { + BN_CTX_end(ctx); return 1; + } } /* If it fails, try the other methods */ #endif -- GitLab