Use inner algorithm when printing certificate.

(Imported from upstream's 004efdbb41f731d36bf12d251909aaa08704a756.)

The outer algorithm is already printed at the bottom of the function. This
allows any tools which print the X509 this way to determine if there is a
mismatch. This is also the point where the TBSCertificate is printed, not the
Certificate. See upstream's RT #3665.

Change-Id: I89baa4e4b626abf8813545a90eaa4409489ad893
Reviewed-on: https://boringssl-review.googlesource.com/3022
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
David Benjamin 2015-01-25 18:52:11 -05:00 committed by Adam Langley
parent e3b24674ef
commit df1cda345f

View File

@ -160,16 +160,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag)
if(!(cflag & X509_FLAG_NO_SIGNAME)) if(!(cflag & X509_FLAG_NO_SIGNAME))
{ {
if(X509_signature_print(bp, x->sig_alg, NULL) <= 0) if (X509_signature_print(bp, ci->signature, NULL) <= 0)
goto err; goto err;
#if 0
if (BIO_printf(bp,"%8sSignature Algorithm: ","") <= 0)
goto err;
if (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0)
goto err;
if (BIO_puts(bp, "\n") <= 0)
goto err;
#endif
} }
if(!(cflag & X509_FLAG_NO_ISSUER)) if(!(cflag & X509_FLAG_NO_ISSUER))