From cc1f4967415e35f4f68dcf90dc689f3b404f7eee Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 16 Feb 2018 16:51:37 +0100 Subject: [PATCH] pki: Use explicit_bzero() to wipe privkey in memory Signed-off-by: Andreas Schneider --- src/pki_container_openssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pki_container_openssh.c b/src/pki_container_openssh.c index 47447421..5723d823 100644 --- a/src/pki_container_openssh.c +++ b/src/pki_container_openssh.c @@ -109,7 +109,7 @@ static int pki_openssh_import_privkey_blob(ssh_buffer key_blob_buffer, } memcpy(key->ed25519_privkey, ssh_string_data(privkey), ED25519_SK_LEN); memcpy(key->ed25519_pubkey, ssh_string_data(pubkey), ED25519_PK_LEN); - memset(ssh_string_data(privkey), 0, ED25519_SK_LEN); + explicit_bzero(ssh_string_data(privkey), ED25519_SK_LEN); SAFE_FREE(privkey); SAFE_FREE(pubkey); break;