summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_mont.c
diff options
context:
space:
mode:
authorguenther <>2014-04-19 13:31:24 +0000
committerguenther <>2014-04-19 13:31:24 +0000
commitb9ebb64eeaa6ad5070ce2ace703c94382abf955f (patch)
tree3f95cbcaa6760ca5e2fb9f5c9be816b839525eae /src/lib/libcrypto/bn/bn_mont.c
parent7e0c192deac57ad25c3b253ccb32dfe88cfef27f (diff)
downloadopenbsd-b9ebb64eeaa6ad5070ce2ace703c94382abf955f.tar.gz
openbsd-b9ebb64eeaa6ad5070ce2ace703c94382abf955f.tar.bz2
openbsd-b9ebb64eeaa6ad5070ce2ace703c94382abf955f.zip
Lacking a proof that--for this implementation--exposure of Montgomery
multiplication or RSA blinding parameters doesn't permit retroactive timing analysis of the secrets, we'll do the stupidly cheap thing and cleanse them before freeing them. ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/bn/bn_mont.c')
-rw-r--r--src/lib/libcrypto/bn/bn_mont.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c
index 133c597c33..456a80bde6 100644
--- a/src/lib/libcrypto/bn/bn_mont.c
+++ b/src/lib/libcrypto/bn/bn_mont.c
@@ -345,9 +345,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
345 if(mont == NULL) 345 if(mont == NULL)
346 return; 346 return;
347 347
348 BN_free(&(mont->RR)); 348 BN_clear_free(&(mont->RR));
349 BN_free(&(mont->N)); 349 BN_clear_free(&(mont->N));
350 BN_free(&(mont->Ni)); 350 BN_clear_free(&(mont->Ni));
351 if (mont->flags & BN_FLG_MALLOCED) 351 if (mont->flags & BN_FLG_MALLOCED)
352 free(mont); 352 free(mont);
353 } 353 }