CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2026/05/16 00:27:05

Modified files:
        lib/libcrypto/x509: x509_prn.c 

Log message:
Ensure X509V3_EXT_print() only returns 0 and 1

In a rare mistake by schwarze, X509V3_EXT_print() is documented to return
0 and 1. This is also what most internal callers expect.

However, if either X509V3_EXT_DUMP_UNKNOWN or X509V3_EXT_PARSE_UNKNOWN is
set, the extension has an unknown NID or on failure to deserialize the
extension value, the return values of BIO_dump_indent() (which is number
of bytes written or -1 on error) and ASN1_parse_dump() (which is 0, 1, or
2 on EOC) are propagated.

Follow what OpenSSL did and translate to Boolean returns. Error indicators
are rather useless here since most errors are ignored anyway. Most callers
do if (!X509V3_EXT_print(...)) but they also pass a zero flag.

Reported by N. Dossche

ok kenjiro

Reply via email to