diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-06-08 11:15:02 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2017-06-08 11:15:06 +0200 |
commit | cbee503887d2b477a3a974158ec2ccfd41947b0c (patch) | |
tree | 190146c0a0320897dd4bdc8b1854cbb1e46c4830 | |
parent | b03010b964f304a036a841ff1b89172309087482 (diff) | |
download | gnutls-cbee503887d2b477a3a974158ec2ccfd41947b0c.tar.gz |
_gnutls_x509_privkey_reinit: ensure fields will not be re-used
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | lib/x509/privkey.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c index aa6577bd9b..98c977e76c 100644 --- a/lib/x509/privkey.c +++ b/lib/x509/privkey.c @@ -64,6 +64,8 @@ void _gnutls_x509_privkey_reinit(gnutls_x509_privkey_t key) { gnutls_pk_params_clear(&key->params); gnutls_pk_params_release(&key->params); + /* avoid re-use of fields which may have had some sensible value */ + memset(&key->params, 0, sizeof(key->params)); asn1_delete_structure2(&key->key, ASN1_DELETE_FLAG_ZEROIZE); key->key = ASN1_TYPE_EMPTY; } |