Clear BN-mont values when free'ing it.

From a CloudFlare patch.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
This commit is contained in:
Loganaden Velvindron 2015-07-31 13:20:16 -04:00 committed by Rich Salz
parent b68fa4d19e
commit a5e26349f7

View File

@ -361,9 +361,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
if (mont == NULL) if (mont == NULL)
return; return;
BN_free(&(mont->RR)); BN_clear_free(&(mont->RR));
BN_free(&(mont->N)); BN_clear_free(&(mont->N));
BN_free(&(mont->Ni)); BN_clear_free(&(mont->Ni));
if (mont->flags & BN_FLG_MALLOCED) if (mont->flags & BN_FLG_MALLOCED)
OPENSSL_free(mont); OPENSSL_free(mont);
} }