mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
02db7354fe
If the user set nmflags == XN_FLAG_COMPAT and X509_NAME_print_ex(3) failed, the error return value of 0 was misinterpreted as an indicator of success, causing X509_print_ex(3) to ignore the error, continue printing, and potentially return successfully even though not all the content of the certificate was printed. The X509_NAME_print_ex(3) manual page explains that this function indicates failure by returning 0 if nmflags == XN_FLAG_COMPAT and by returning -1 if nmflags != XN_FLAG_COMPAT. Note that just checking for <= 0 in all cases would not be correct either because X509_NAME_print_ex(3) returns 0 to indicate that it successfully printed zero bytes in some cases, for example when all three of the following conditions hold: 1. nmflags != XN_FLAG_COMPAT 2. indent == 0 (which X509_print_ex(3) does use in some cases) 3. the name object is NULL or empty Thanks to Ingo Schwarze <schwarze@openbsd.org> for finding the bug, and Joel Sing <jsing@openbsd.org> for contributing an idea for the fix. Reviewed-by: Ben Kaduk <kaduk@mit.edu> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16009) |
||
---|---|---|
.. | ||
build.info | ||
by_dir.c | ||
by_file.c | ||
by_store.c | ||
ext_dat.h | ||
pcy_cache.c | ||
pcy_data.c | ||
pcy_lib.c | ||
pcy_local.h | ||
pcy_map.c | ||
pcy_node.c | ||
pcy_tree.c | ||
standard_exts.h | ||
t_crl.c | ||
t_req.c | ||
t_x509.c | ||
v3_addr.c | ||
v3_admis.c | ||
v3_admis.h | ||
v3_akeya.c | ||
v3_akid.c | ||
v3_asid.c | ||
v3_bcons.c | ||
v3_bitst.c | ||
v3_conf.c | ||
v3_cpols.c | ||
v3_crld.c | ||
v3_enum.c | ||
v3_extku.c | ||
v3_genn.c | ||
v3_ia5.c | ||
v3_info.c | ||
v3_int.c | ||
v3_ist.c | ||
v3_lib.c | ||
v3_ncons.c | ||
v3_pci.c | ||
v3_pcia.c | ||
v3_pcons.c | ||
v3_pku.c | ||
v3_pmaps.c | ||
v3_prn.c | ||
v3_purp.c | ||
v3_san.c | ||
v3_skid.c | ||
v3_sxnet.c | ||
v3_tlsf.c | ||
v3_utf8.c | ||
v3_utl.c | ||
v3err.c | ||
x509_att.c | ||
x509_cmp.c | ||
x509_d2.c | ||
x509_def.c | ||
x509_err.c | ||
x509_ext.c | ||
x509_local.h | ||
x509_lu.c | ||
x509_meth.c | ||
x509_obj.c | ||
x509_r2x.c | ||
x509_req.c | ||
x509_set.c | ||
x509_trust.c | ||
x509_txt.c | ||
x509_v3.c | ||
x509_vfy.c | ||
x509_vpm.c | ||
x509cset.c | ||
x509name.c | ||
x509rset.c | ||
x509spki.c | ||
x509type.c | ||
x_all.c | ||
x_attrib.c | ||
x_crl.c | ||
x_exten.c | ||
x_name.c | ||
x_pubkey.c | ||
x_req.c | ||
x_x509.c | ||
x_x509a.c |