diff options
author | guenther <> | 2014-04-19 13:31:24 +0000 |
---|---|---|
committer | guenther <> | 2014-04-19 13:31:24 +0000 |
commit | b9ebb64eeaa6ad5070ce2ace703c94382abf955f (patch) | |
tree | 3f95cbcaa6760ca5e2fb9f5c9be816b839525eae /src | |
parent | 7e0c192deac57ad25c3b253ccb32dfe88cfef27f (diff) | |
download | openbsd-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')
-rw-r--r-- | src/lib/libcrypto/bn/bn_blind.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/bn/bn_mont.c | 6 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/bn_blind.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/bn_mont.c | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c index 264531013e..f424e479d3 100644 --- a/src/lib/libcrypto/bn/bn_blind.c +++ b/src/lib/libcrypto/bn/bn_blind.c | |||
@@ -176,10 +176,10 @@ void BN_BLINDING_free(BN_BLINDING *r) | |||
176 | if(r == NULL) | 176 | if(r == NULL) |
177 | return; | 177 | return; |
178 | 178 | ||
179 | if (r->A != NULL) BN_free(r->A ); | 179 | if (r->A != NULL) BN_clear_free(r->A ); |
180 | if (r->Ai != NULL) BN_free(r->Ai); | 180 | if (r->Ai != NULL) BN_clear_free(r->Ai); |
181 | if (r->e != NULL) BN_free(r->e ); | 181 | if (r->e != NULL) BN_clear_free(r->e ); |
182 | if (r->mod != NULL) BN_free(r->mod); | 182 | if (r->mod != NULL) BN_clear_free(r->mod); |
183 | free(r); | 183 | free(r); |
184 | } | 184 | } |
185 | 185 | ||
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 | } |
diff --git a/src/lib/libssl/src/crypto/bn/bn_blind.c b/src/lib/libssl/src/crypto/bn/bn_blind.c index 264531013e..f424e479d3 100644 --- a/src/lib/libssl/src/crypto/bn/bn_blind.c +++ b/src/lib/libssl/src/crypto/bn/bn_blind.c | |||
@@ -176,10 +176,10 @@ void BN_BLINDING_free(BN_BLINDING *r) | |||
176 | if(r == NULL) | 176 | if(r == NULL) |
177 | return; | 177 | return; |
178 | 178 | ||
179 | if (r->A != NULL) BN_free(r->A ); | 179 | if (r->A != NULL) BN_clear_free(r->A ); |
180 | if (r->Ai != NULL) BN_free(r->Ai); | 180 | if (r->Ai != NULL) BN_clear_free(r->Ai); |
181 | if (r->e != NULL) BN_free(r->e ); | 181 | if (r->e != NULL) BN_clear_free(r->e ); |
182 | if (r->mod != NULL) BN_free(r->mod); | 182 | if (r->mod != NULL) BN_clear_free(r->mod); |
183 | free(r); | 183 | free(r); |
184 | } | 184 | } |
185 | 185 | ||
diff --git a/src/lib/libssl/src/crypto/bn/bn_mont.c b/src/lib/libssl/src/crypto/bn/bn_mont.c index 133c597c33..456a80bde6 100644 --- a/src/lib/libssl/src/crypto/bn/bn_mont.c +++ b/src/lib/libssl/src/crypto/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 | } |