x509_print_ex:Use correct constant for nmflag comparison
authorDamian Hobson-Garcia <dhobsong@igel.co.jp>
Thu, 22 Dec 2022 21:36:05 +0000 (16:36 -0500)
committerMatt Caswell <matt@openssl.org>
Thu, 26 Oct 2023 14:48:00 +0000 (15:48 +0100)
The X509_FLAG_COMPAT constant is defined as a value of the
X509_print_ex() cflags argument, and so it should not be used
to compare against values for use with X509_NAME_print flags.
Use XN_FLAG_COMPAT, which has the same value, instead.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/19963)

crypto/x509/t_req.c
crypto/x509/t_x509.c

index 095c16510099922c2ed94bf2344ca965d9367d2c..f9cbbecd361399f2ede0b96096276c70a73b1e9e 100644 (file)
@@ -49,7 +49,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
         nmindent = 12;
     }
 
-    if (nmflags == X509_FLAG_COMPAT)
+    if (nmflags == XN_FLAG_COMPAT)
         nmindent = 16;
 
     if (!(cflag & X509_FLAG_NO_HEADER)) {
index 68b04a565075290e129a394da76c9eb42692b385..3e404b9adcc8d41a824fc6369b5c925586fed985 100644 (file)
@@ -65,7 +65,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
         nmindent = 12;
     }
 
-    if (nmflags == X509_FLAG_COMPAT) {
+    if (nmflags == XN_FLAG_COMPAT) {
         nmindent = 16;
         printok = 1;
     }