summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2017-07-28 21:59:07 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2017-07-29 19:26:06 +0200
commit5d8f1b13890df51bce97b1a4c2a31f5228bb4744 (patch)
tree8eaeb93701443224f26cd20412221d54a183a19b /crypto
parentImplement the CRYPTO_secure_clear_free function (diff)
downloadopenssl-5d8f1b13890df51bce97b1a4c2a31f5228bb4744.tar.xz
openssl-5d8f1b13890df51bce97b1a4c2a31f5228bb4744.zip
Use OPENSSL_secure_clear_free for secure mem BIOs and X25519 private keys
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4044)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/buffer/buffer.c4
-rw-r--r--crypto/ec/ecx_meth.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/buffer/buffer.c b/crypto/buffer/buffer.c
index ad7128a732..f3f8a1b55c 100644
--- a/crypto/buffer/buffer.c
+++ b/crypto/buffer/buffer.c
@@ -47,7 +47,7 @@ void BUF_MEM_free(BUF_MEM *a)
if (a->data != NULL) {
if (a->flags & BUF_MEM_FLAG_SECURE)
- OPENSSL_secure_free(a->data);
+ OPENSSL_secure_clear_free(a->data, a->max);
else
OPENSSL_clear_free(a->data, a->max);
}
@@ -64,7 +64,7 @@ static char *sec_alloc_realloc(BUF_MEM *str, size_t len)
if (str->data != NULL) {
if (ret != NULL) {
memcpy(ret, str->data, str->length);
- OPENSSL_secure_free(str->data);
+ OPENSSL_secure_clear_free(str->data, str->length);
str->data = NULL;
}
}
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index b001196309..4f7cfec728 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -220,7 +220,7 @@ static void ecx_free(EVP_PKEY *pkey)
X25519_KEY *xkey = pkey->pkey.ptr;
if (xkey)
- OPENSSL_secure_free(xkey->privkey);
+ OPENSSL_secure_clear_free(xkey->privkey, X25519_KEYLEN);
OPENSSL_free(xkey);
}