Skip to content

Commit

Permalink
ASN1: Reset the content dump flag after dumping
Browse files Browse the repository at this point in the history
When encountering a badly coded item, the DER printer (ASN1_print_dump())
sets a flag to ensure that an additional hex dump of the offending content
is printed as part of the output.  Unfortunately, this flag is never reset,
which means that all following items are printed with the extra hex dump,
whether they are faulty or not.

Resetting the flag after hex dumping ensures that only the faulty contents
are printed with the additional hex dump.

Fixes openssl#14626

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from openssl#14627)
  • Loading branch information
levitte committed Mar 21, 2021
1 parent abded2c commit 6e34a10
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crypto/asn1/asn1_par.c
Expand Up @@ -337,6 +337,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
}
if (BIO_puts(bp, "]") <= 0)
goto end;
dump_cont = 0;
}

if (!nl) {
Expand Down

0 comments on commit 6e34a10

Please sign in to comment.