mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
pki: Use explicit_bzero() to wipe privkey in memory
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -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_privkey, ssh_string_data(privkey), ED25519_SK_LEN);
|
||||||
memcpy(key->ed25519_pubkey, ssh_string_data(pubkey), ED25519_PK_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(privkey);
|
||||||
SAFE_FREE(pubkey);
|
SAFE_FREE(pubkey);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user