Clear BN-mont values when free'ing it.
authorLoganaden Velvindron <loganaden@gmail.com>
Fri, 31 Jul 2015 17:20:16 +0000 (13:20 -0400)
committerRich Salz <rsalz@openssl.org>
Fri, 31 Jul 2015 17:38:15 +0000 (13:38 -0400)
From a CloudFlare patch.

Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
crypto/bn/bn_mont.c

index e3955fe..1580e97 100644 (file)
@@ -339,9 +339,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);
 }