Skip to content

Commit

Permalink
x509_print_ex:Use correct constant for nmflag comparison
Browse files Browse the repository at this point in the history
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 #19963)

(cherry picked from commit da2dd3b)
  • Loading branch information
dhobsong authored and mattcaswell committed Oct 26, 2023
1 parent 4230172 commit d7f20c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto/x509/t_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/x509/t_x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d7f20c7

Please sign in to comment.