From: Nikos Mavrogiannopoulos Date: Thu, 8 Jun 2017 09:15:02 +0000 (+0200) Subject: _gnutls_x509_privkey_reinit: ensure fields will not be re-used X-Git-Tag: gnutls_3_6_0~459 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbee503887d2b477a3a974158ec2ccfd41947b0c;p=thirdparty%2Fgnutls.git _gnutls_x509_privkey_reinit: ensure fields will not be re-used Signed-off-by: Nikos Mavrogiannopoulos --- 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; }