diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2013-11-13 14:16:34 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2013-11-27 11:41:43 +0100 |
commit | d4add8fb8207beb6c5d328ab706417b9b9611781 (patch) | |
tree | 066d9fce1d1b766ba0b9438a07dbfbac0d1b651a /lib/x509/key_encode.c | |
parent | 6f091f48c5209a14a3115d17ec590178b3aef78d (diff) | |
download | gnutls-d4add8fb8207beb6c5d328ab706417b9b9611781.tar.gz |
zeroize also ASN.1 structures that hold keys.
Diffstat (limited to 'lib/x509/key_encode.c')
-rw-r--r-- | lib/x509/key_encode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/x509/key_encode.c b/lib/x509/key_encode.c index bbc766fd72..388e57776a 100644 --- a/lib/x509/key_encode.c +++ b/lib/x509/key_encode.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2011-2012 Free Software Foundation, Inc. + * Copyright (C) 2013 Red Hat * * Author: Nikos Mavrogiannopoulos * @@ -465,7 +466,7 @@ _gnutls_asn1_encode_rsa(ASN1_TYPE * c2, gnutls_pk_params_st * params) cleanup: if (ret < 0) - asn1_delete_structure(c2); + asn1_delete_structure2(c2, ASN1_DELETE_FLAG_ZEROIZE); gnutls_pk_params_clear(&pk_params); gnutls_pk_params_release(&pk_params); @@ -554,8 +555,8 @@ _gnutls_asn1_encode_ecc(ASN1_TYPE * c2, gnutls_pk_params_st * params) _gnutls_free_datum(&pubkey); return 0; - cleanup: - asn1_delete_structure(c2); +cleanup: + asn1_delete_structure2(c2, ASN1_DELETE_FLAG_ZEROIZE); _gnutls_free_datum(&pubkey); return ret; @@ -635,7 +636,7 @@ _gnutls_asn1_encode_dsa(ASN1_TYPE * c2, gnutls_pk_params_st * params) return 0; cleanup: - asn1_delete_structure(c2); + asn1_delete_structure2(c2, ASN1_DELETE_FLAG_ZEROIZE); return ret; } |