From: Loganaden Velvindron Date: Fri, 31 Jul 2015 17:20:16 +0000 (-0400) Subject: Clear BN-mont values when free'ing it. X-Git-Tag: OpenSSL_1_0_0t~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=895c1b79dd7a76caea46d3185c8c2d3a27506b9d;p=oweals%2Fopenssl.git Clear BN-mont values when free'ing it. From a CloudFlare patch. Reviewed-by: Dr. Stephen Henson (cherry picked from commit 1a586b3942de1c0bd64203d09385d5e74f499d8d) --- diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index bab8dfe6ea..61c70f061f 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -427,9 +427,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont) if (mont == NULL) return; - BN_free(&(mont->RR)); - BN_free(&(mont->N)); - BN_free(&(mont->Ni)); + BN_clear_free(&(mont->RR)); + BN_clear_free(&(mont->N)); + BN_clear_free(&(mont->Ni)); if (mont->flags & BN_FLG_MALLOCED) OPENSSL_free(mont); }