Skip to content

Commit

Permalink
x509_print_ex: Remove unused setting when XN_FLAG_COMPAT is set
Browse files Browse the repository at this point in the history
Calling X509_NAME_print_ex with XN_FLAG_COMPAT falls back to calling
X509_NAME_print().  The obase parameter to X509_NAME_print() is not
used, so setting it to a different value has no effect.

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

(cherry picked from commit 2126ca3)
  • Loading branch information
dhobsong authored and mattcaswell committed Oct 26, 2023
1 parent b01e6bc commit 436c75b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions crypto/x509/t_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
nmindent = 12;
}

if (nmflags == XN_FLAG_COMPAT) {
nmindent = 16;
if (nmflags == XN_FLAG_COMPAT)
printok = 1;
}

if (!(cflag & X509_FLAG_NO_HEADER)) {
if (BIO_write(bp, "Certificate Request:\n", 21) <= 0)
Expand Down
4 changes: 1 addition & 3 deletions crypto/x509/t_x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
nmindent = 12;
}

if (nmflags == XN_FLAG_COMPAT) {
nmindent = 16;
if (nmflags == XN_FLAG_COMPAT)
printok = 1;
}

if (!(cflag & X509_FLAG_NO_HEADER)) {
if (BIO_write(bp, "Certificate:\n", 13) <= 0)
Expand Down

0 comments on commit 436c75b

Please sign in to comment.