diff options
author | David von Oheimb <David.von.Oheimb@siemens.com> | 2018-01-29 16:54:40 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-03-18 17:17:55 +0000 |
commit | a4c467c96aeae3d52e2f16b8b829749ed6c55fe7 (patch) | |
tree | 1cd7cb1f417d3b1fc086de5ddcdf91c9ead38fc5 /crypto/x509v3/v3_cpols.c | |
parent | c13d2ab439a9dcbbf22ef85a00603142b0a37779 (diff) | |
download | openssl-a4c467c96aeae3d52e2f16b8b829749ed6c55fe7.zip openssl-a4c467c96aeae3d52e2f16b8b829749ed6c55fe7.tar.gz openssl-a4c467c96aeae3d52e2f16b8b829749ed6c55fe7.tar.bz2 |
remove needless empty lines when printing certificates
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6226)
Diffstat (limited to 'crypto/x509v3/v3_cpols.c')
-rw-r--r-- | crypto/x509v3/v3_cpols.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/crypto/x509v3/v3_cpols.c b/crypto/x509v3/v3_cpols.c index bfdaf0a..595de62 100644 --- a/crypto/x509v3/v3_cpols.c +++ b/crypto/x509v3/v3_cpols.c @@ -403,12 +403,15 @@ static int i2r_certpol(X509V3_EXT_METHOD *method, STACK_OF(POLICYINFO) *pol, POLICYINFO *pinfo; /* First print out the policy OIDs */ for (i = 0; i < sk_POLICYINFO_num(pol); i++) { + if (i > 0) + BIO_puts(out, "\n"); pinfo = sk_POLICYINFO_value(pol, i); BIO_printf(out, "%*sPolicy: ", indent, ""); i2a_ASN1_OBJECT(out, pinfo->policyid); - BIO_puts(out, "\n"); - if (pinfo->qualifiers) + if (pinfo->qualifiers) { + BIO_puts(out, "\n"); print_qualifiers(out, pinfo->qualifiers, indent + 2); + } } return 1; } @@ -419,10 +422,12 @@ static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, POLICYQUALINFO *qualinfo; int i; for (i = 0; i < sk_POLICYQUALINFO_num(quals); i++) { + if (i > 0) + BIO_puts(out, "\n"); qualinfo = sk_POLICYQUALINFO_value(quals, i); switch (OBJ_obj2nid(qualinfo->pqualid)) { case NID_id_qt_cps: - BIO_printf(out, "%*sCPS: %s\n", indent, "", + BIO_printf(out, "%*sCPS: %s", indent, "", qualinfo->d.cpsuri->data); break; @@ -435,7 +440,6 @@ static void print_qualifiers(BIO *out, STACK_OF(POLICYQUALINFO) *quals, BIO_printf(out, "%*sUnknown Qualifier: ", indent + 2, ""); i2a_ASN1_OBJECT(out, qualinfo->pqualid); - BIO_puts(out, "\n"); break; } } @@ -467,10 +471,11 @@ static void print_notice(BIO *out, USERNOTICE *notice, int indent) OPENSSL_free(tmp); } } - BIO_puts(out, "\n"); + if (notice->exptext) + BIO_puts(out, "\n"); } if (notice->exptext) - BIO_printf(out, "%*sExplicit Text: %s\n", indent, "", + BIO_printf(out, "%*sExplicit Text: %s", indent, "", notice->exptext->data); } @@ -484,8 +489,10 @@ void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent) BIO_puts(out, "\n"); BIO_printf(out, "%*s%s\n", indent + 2, "", node_data_critical(dat) ? "Critical" : "Non Critical"); - if (dat->qualifier_set) + if (dat->qualifier_set) { print_qualifiers(out, dat->qualifier_set, indent + 2); + BIO_puts(out, "\n"); + } else BIO_printf(out, "%*sNo Qualifiers\n", indent + 2, ""); } |