]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix genstr/genconf option in asn1parse
authorNeil Horman <nhorman@openssl.org>
Tue, 5 Dec 2023 19:50:01 +0000 (14:50 -0500)
committerNeil Horman <nhorman@openssl.org>
Wed, 13 Dec 2023 16:10:30 +0000 (11:10 -0500)
commit749fcc0e3ce796474a15d6fac221e57daeacff1e
tree6caefdc59ae2e400ad5f177840597ff86de425d8
parent75caab2718aecc8eea78945083e9d3d671f2be53
Fix genstr/genconf option in asn1parse

At some point the asn1parse applet was changed to default the inform to
PEM, and defalt input file to stdin.  Doing so broke the -genstr|conf options,
in that, before we attempt to generate an ASN1 block from the provided
genstr string, we attempt to read a PEM input from stdin.  As a result,
this command:
openssl asn1parse -genstr OID:1.2.3.4
hangs because we are attempting a blocking read on stdin, waiting for
data that never arrives

Fix it by giving priority to genstr|genconf, such that, if set, will just run
do_generate on that string and exit

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22957)
apps/asn1parse.c