summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/t_x509a.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/t_x509a.c')
-rw-r--r--src/lib/libcrypto/asn1/t_x509a.c58
1 files changed, 33 insertions, 25 deletions
diff --git a/src/lib/libcrypto/asn1/t_x509a.c b/src/lib/libcrypto/asn1/t_x509a.c
index 8b18801a17..49d1be19db 100644
--- a/src/lib/libcrypto/asn1/t_x509a.c
+++ b/src/lib/libcrypto/asn1/t_x509a.c
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -65,46 +65,54 @@
65/* X509_CERT_AUX and string set routines 65/* X509_CERT_AUX and string set routines
66 */ 66 */
67 67
68int X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent) 68int
69X509_CERT_AUX_print(BIO *out, X509_CERT_AUX *aux, int indent)
69{ 70{
70 char oidstr[80], first; 71 char oidstr[80], first;
71 int i; 72 int i;
72 if(!aux) return 1; 73 if (!aux)
73 if(aux->trust) { 74 return 1;
75 if (aux->trust) {
74 first = 1; 76 first = 1;
75 BIO_printf(out, "%*sTrusted Uses:\n%*s", 77 BIO_printf(out, "%*sTrusted Uses:\n%*s",
76 indent, "", indent + 2, ""); 78 indent, "", indent + 2, "");
77 for(i = 0; i < sk_ASN1_OBJECT_num(aux->trust); i++) { 79 for (i = 0; i < sk_ASN1_OBJECT_num(aux->trust); i++) {
78 if(!first) BIO_puts(out, ", "); 80 if (!first)
79 else first = 0; 81 BIO_puts(out, ", ");
82 else
83 first = 0;
80 OBJ_obj2txt(oidstr, sizeof oidstr, 84 OBJ_obj2txt(oidstr, sizeof oidstr,
81 sk_ASN1_OBJECT_value(aux->trust, i), 0); 85 sk_ASN1_OBJECT_value(aux->trust, i), 0);
82 BIO_puts(out, oidstr); 86 BIO_puts(out, oidstr);
83 } 87 }
84 BIO_puts(out, "\n"); 88 BIO_puts(out, "\n");
85 } else BIO_printf(out, "%*sNo Trusted Uses.\n", indent, ""); 89 } else
86 if(aux->reject) { 90 BIO_printf(out, "%*sNo Trusted Uses.\n", indent, "");
91 if (aux->reject) {
87 first = 1; 92 first = 1;
88 BIO_printf(out, "%*sRejected Uses:\n%*s", 93 BIO_printf(out, "%*sRejected Uses:\n%*s",
89 indent, "", indent + 2, ""); 94 indent, "", indent + 2, "");
90 for(i = 0; i < sk_ASN1_OBJECT_num(aux->reject); i++) { 95 for (i = 0; i < sk_ASN1_OBJECT_num(aux->reject); i++) {
91 if(!first) BIO_puts(out, ", "); 96 if (!first)
92 else first = 0; 97 BIO_puts(out, ", ");
98 else
99 first = 0;
93 OBJ_obj2txt(oidstr, sizeof oidstr, 100 OBJ_obj2txt(oidstr, sizeof oidstr,
94 sk_ASN1_OBJECT_value(aux->reject, i), 0); 101 sk_ASN1_OBJECT_value(aux->reject, i), 0);
95 BIO_puts(out, oidstr); 102 BIO_puts(out, oidstr);
96 } 103 }
97 BIO_puts(out, "\n"); 104 BIO_puts(out, "\n");
98 } else BIO_printf(out, "%*sNo Rejected Uses.\n", indent, ""); 105 } else
99 if(aux->alias) BIO_printf(out, "%*sAlias: %s\n", indent, "", 106 BIO_printf(out, "%*sNo Rejected Uses.\n", indent, "");
100 aux->alias->data); 107 if (aux->alias)
101 if(aux->keyid) { 108 BIO_printf(out, "%*sAlias: %s\n", indent, "",
109 aux->alias->data);
110 if (aux->keyid) {
102 BIO_printf(out, "%*sKey Id: ", indent, ""); 111 BIO_printf(out, "%*sKey Id: ", indent, "");
103 for(i = 0; i < aux->keyid->length; i++) 112 for (i = 0; i < aux->keyid->length; i++)
104 BIO_printf(out, "%s%02X", 113 BIO_printf(out, "%s%02X", i ? ":" : "",
105 i ? ":" : "", 114 aux->keyid->data[i]);
106 aux->keyid->data[i]); 115 BIO_write(out, "\n", 1);
107 BIO_write(out,"\n",1);
108 } 116 }
109 return 1; 117 return 1;
110} 118}