diff options
author | Justus Winter <justus@g10code.com> | 2016-03-14 16:32:00 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-03-21 18:39:31 +0100 |
commit | ba3ee9f0078187262edd2f68380f5e8b5454e247 (patch) | |
tree | 6fb293d1f1d878cc0d4120550cc35feb016a6718 /src | |
parent | 38d8befcd0781864f8f923ae0b1f7cb2731e900d (diff) | |
download | libssh-ba3ee9f0078187262edd2f68380f5e8b5454e247.tar.gz libssh-ba3ee9f0078187262edd2f68380f5e8b5454e247.tar.xz libssh-ba3ee9f0078187262edd2f68380f5e8b5454e247.zip |
pki_gcrypt: Burn key material
* src/pki_gcrypt.c (b64decode_rsa_privatekey): Burn key material.
(b64decode_dsa_privatekey): Likewise.
Signed-off-by: Justus Winter <justus@g10code.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pki_gcrypt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c index 22806af3..663cb1ff 100644 --- a/src/pki_gcrypt.c +++ b/src/pki_gcrypt.c @@ -509,13 +509,19 @@ static int b64decode_rsa_privatekey(const char *pkey, gcry_sexp_t *r, } error: + ssh_string_burn(n); ssh_string_free(n); + ssh_string_burn(e); ssh_string_free(e); + ssh_string_burn(d); ssh_string_free(d); + ssh_string_burn(p); ssh_string_free(p); + ssh_string_burn(q); ssh_string_free(q); ssh_string_free(unused1); ssh_string_free(unused2); + ssh_string_burn(u); ssh_string_free(u); ssh_string_free(v); @@ -580,10 +586,15 @@ static int b64decode_dsa_privatekey(const char *pkey, gcry_sexp_t *r, ssh_auth_c } error: + ssh_string_burn(p); ssh_string_free(p); + ssh_string_burn(q); ssh_string_free(q); + ssh_string_burn(g); ssh_string_free(g); + ssh_string_burn(y); ssh_string_free(y); + ssh_string_burn(x); ssh_string_free(x); ssh_string_free(v); |