diff options
| author | Matt Caswell <[email protected]> | 2015-04-30 15:04:30 +0200 |
|---|---|---|
| committer | Matt Caswell <[email protected]> | 2015-06-10 11:24:30 +0200 |
| commit | 23cd01ef61ff9110850ee75c42ccb365ddc8a6ab (patch) | |
| tree | 225bf3eb7604a9b0ef6fd6920567e44e63a1cca1 | |
| parent | Fix Kerberos issue in ssl_session_dup (diff) | |
| download | openssl-23cd01ef61ff9110850ee75c42ccb365ddc8a6ab.tar.gz openssl-23cd01ef61ff9110850ee75c42ccb365ddc8a6ab.zip | |
Replace memset with OPENSSL_cleanse()
BUF_MEM_free() attempts to cleanse memory using memset immediately prior
to a free. This is at risk of being optimised away by the compiler, so
replace with a call to OPENSSL_cleanse() instead.
With thanks to the Open Crypto Audit Project for reporting this issue.
Reviewed-by: Stephen Henson <[email protected]>
| -rw-r--r-- | crypto/buffer/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/buffer/buffer.c b/crypto/buffer/buffer.c index d287e340a2b..eff3e081576 100644 --- a/crypto/buffer/buffer.c +++ b/crypto/buffer/buffer.c @@ -88,7 +88,7 @@ void BUF_MEM_free(BUF_MEM *a) return; if (a->data != NULL) { - memset(a->data, 0, (unsigned int)a->max); + OPENSSL_cleanse(a->data, a->max); OPENSSL_free(a->data); } OPENSSL_free(a); |
