From da2dd3b51ddd69aae0fd840c0d23afa954c24ded Mon Sep 17 00:00:00 2001 From: Damian Hobson-Garcia Date: Thu, 22 Dec 2022 16:36:05 -0500 Subject: [PATCH] x509_print_ex:Use correct constant for nmflag comparison 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 Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/19963) --- crypto/x509/t_req.c | 2 +- crypto/x509/t_x509.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/x509/t_req.c b/crypto/x509/t_req.c index 095c1651009..f9cbbecd361 100644 --- a/crypto/x509/t_req.c +++ b/crypto/x509/t_req.c @@ -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)) { diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c index 68b04a56507..3e404b9adcc 100644 --- a/crypto/x509/t_x509.c +++ b/crypto/x509/t_x509.c @@ -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; } -- 2.47.2