diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-09-03 17:44:17 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-09-04 19:57:16 +0200 |
commit | 62bff4aff1e1c7bb363914ea41170b01d62bc14f (patch) | |
tree | 0ba2070d6d2ecf714c050c4bcb1345759087c928 /src/wrapper.c | |
parent | f8e68b92b83c67043ee81c81ffbe817488420d1f (diff) | |
download | libssh-62bff4aff1e1c7bb363914ea41170b01d62bc14f.tar.gz libssh-62bff4aff1e1c7bb363914ea41170b01d62bc14f.tar.xz libssh-62bff4aff1e1c7bb363914ea41170b01d62bc14f.zip |
wrapper: Use explicit_bzero() in crypto_free()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/wrapper.c')
-rw-r--r-- | src/wrapper.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wrapper.c b/src/wrapper.c index 7fc10293..354bc0de 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -177,11 +177,11 @@ void crypto_free(struct ssh_crypto_struct *crypto) } #endif if (crypto->session_id != NULL) { - memset(crypto->session_id, '\0', crypto->digest_len); + explicit_bzero(crypto->session_id, crypto->digest_len); SAFE_FREE(crypto->session_id); } if (crypto->secret_hash != NULL) { - memset(crypto->secret_hash, '\0', crypto->digest_len); + explicit_bzero(crypto->secret_hash, crypto->digest_len); SAFE_FREE(crypto->secret_hash); } #ifdef WITH_ZLIB @@ -202,11 +202,11 @@ void crypto_free(struct ssh_crypto_struct *crypto) SAFE_FREE(crypto->encryptMAC); SAFE_FREE(crypto->decryptMAC); if (crypto->encryptkey != NULL) { - memset(crypto->encryptkey, 0, crypto->digest_len); + explicit_bzero(crypto->encryptkey, crypto->digest_len); SAFE_FREE(crypto->encryptkey); } if (crypto->decryptkey != NULL) { - memset(crypto->decryptkey, 0, crypto->digest_len); + explicit_bzero(crypto->decryptkey, crypto->digest_len); SAFE_FREE(crypto->decryptkey); } |