add 'Signature Value:' line and correct indentation when printing X.509 signature value
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
This commit is contained in:
parent
0742eb9f66
commit
5743d1268d
@ -302,11 +302,14 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
|
||||
const ASN1_STRING *sig)
|
||||
{
|
||||
int sig_nid;
|
||||
if (BIO_puts(bp, " Signature Algorithm: ") <= 0)
|
||||
int indent = 4;
|
||||
if (BIO_printf(bp, "%*sSignature Algorithm: ", indent, "") <= 0)
|
||||
return 0;
|
||||
if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0)
|
||||
return 0;
|
||||
|
||||
if (sig && BIO_printf(bp, "\n%*sSignature Value:", indent, "") <= 0)
|
||||
return 0;
|
||||
sig_nid = OBJ_obj2nid(sigalg->algorithm);
|
||||
if (sig_nid != NID_undef) {
|
||||
int pkey_nid, dig_nid;
|
||||
@ -314,13 +317,13 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
|
||||
if (OBJ_find_sigid_algs(sig_nid, &dig_nid, &pkey_nid)) {
|
||||
ameth = EVP_PKEY_asn1_find(NULL, pkey_nid);
|
||||
if (ameth && ameth->sig_print)
|
||||
return ameth->sig_print(bp, sigalg, sig, 9, 0);
|
||||
return ameth->sig_print(bp, sigalg, sig, indent + 4, 0);
|
||||
}
|
||||
}
|
||||
if (BIO_write(bp, "\n", 1) != 1)
|
||||
return 0;
|
||||
if (sig)
|
||||
return X509_signature_dump(bp, sig, 9);
|
||||
return X509_signature_dump(bp, sig, indent + 4);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ Certificate:
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Signature Value:
|
||||
04:8f:c3:77:48:06:29:c0:8d:66:2e:6b:48:a3:b3:e0:dd:5b:
|
||||
0a:e7:a4:0b:7e:72:91:fc:37:29:7f:81:1e:60:66:7b:ba:94:
|
||||
30:f8:c0:79:56:bc:ed:87:88:d9:bd:d8:7b:dc:1b:87:bb:ef:
|
||||
|
@ -40,6 +40,7 @@ Certificate:
|
||||
X509v3 Basic Constraints:
|
||||
CA:TRUE
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Signature Value:
|
||||
04:8f:c3:77:48:06:29:c0:8d:66:2e:6b:48:a3:b3:e0:dd:5b:
|
||||
0a:e7:a4:0b:7e:72:91:fc:37:29:7f:81:1e:60:66:7b:ba:94:
|
||||
30:f8:c0:79:56:bc:ed:87:88:d9:bd:d8:7b:dc:1b:87:bb:ef:
|
||||
|
@ -9,6 +9,7 @@ Certificate Revocation List (CRL):
|
||||
1
|
||||
No Revoked Certificates.
|
||||
Signature Algorithm: sha256WithRSAEncryption
|
||||
Signature Value:
|
||||
85:e5:e5:fe:d4:13:3f:07:1a:07:53:6f:f7:a5:01:c9:80:f4:
|
||||
8a:7a:f3:74:fc:af:dd:6a:21:47:88:99:7b:29:bf:46:0b:02:
|
||||
98:d7:80:75:46:f6:cd:da:b5:0f:ff:9f:0c:b7:e6:aa:8e:f6:
|
||||
|
Loading…
x
Reference in New Issue
Block a user