While ASN1_ENCODING is currently only used with types that should only
contain public information, we assume that ASN.1 may contain sensitive
information, hence use freezero() here instead of free().
ok deraadt@ tb@
-/* $OpenBSD: tasn_utl.c,v 1.14 2022/05/10 05:19:23 jsing Exp $ */
+/* $OpenBSD: tasn_utl.c,v 1.15 2022/05/12 19:24:38 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
enc = asn1_get_enc_ptr(pval, it);
if (enc) {
- free(enc->enc);
+ freezero(enc->enc, enc->len);
enc->enc = NULL;
enc->len = 0;
enc->modified = 1;
if (!enc)
return 1;
- free(enc->enc);
+ freezero(enc->enc, enc->len);
enc->enc = malloc(inlen);
if (!enc->enc)
return 0;