1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-21 19:31:17 +03:00

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>
This commit is contained in:
Justus Winter
2016-03-14 16:32:00 +01:00
committed by Andreas Schneider
parent 38d8befcd0
commit ba3ee9f007

View File

@@ -509,13 +509,19 @@ static int b64decode_rsa_privatekey(const char *pkey, gcry_sexp_t *r,
} }
error: error:
ssh_string_burn(n);
ssh_string_free(n); ssh_string_free(n);
ssh_string_burn(e);
ssh_string_free(e); ssh_string_free(e);
ssh_string_burn(d);
ssh_string_free(d); ssh_string_free(d);
ssh_string_burn(p);
ssh_string_free(p); ssh_string_free(p);
ssh_string_burn(q);
ssh_string_free(q); ssh_string_free(q);
ssh_string_free(unused1); ssh_string_free(unused1);
ssh_string_free(unused2); ssh_string_free(unused2);
ssh_string_burn(u);
ssh_string_free(u); ssh_string_free(u);
ssh_string_free(v); ssh_string_free(v);
@@ -580,10 +586,15 @@ static int b64decode_dsa_privatekey(const char *pkey, gcry_sexp_t *r, ssh_auth_c
} }
error: error:
ssh_string_burn(p);
ssh_string_free(p); ssh_string_free(p);
ssh_string_burn(q);
ssh_string_free(q); ssh_string_free(q);
ssh_string_burn(g);
ssh_string_free(g); ssh_string_free(g);
ssh_string_burn(y);
ssh_string_free(y); ssh_string_free(y);
ssh_string_burn(x);
ssh_string_free(x); ssh_string_free(x);
ssh_string_free(v); ssh_string_free(v);