summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/t_crl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/t_crl.c')
-rw-r--r--src/lib/libcrypto/asn1/t_crl.c49
1 files changed, 8 insertions, 41 deletions
diff --git a/src/lib/libcrypto/asn1/t_crl.c b/src/lib/libcrypto/asn1/t_crl.c
index d78e4a8f88..60db305756 100644
--- a/src/lib/libcrypto/asn1/t_crl.c
+++ b/src/lib/libcrypto/asn1/t_crl.c
@@ -64,8 +64,7 @@
64#include <openssl/x509.h> 64#include <openssl/x509.h>
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67static void ext_print(BIO *out, X509_EXTENSION *ex); 67#ifndef OPENSSL_NO_FP_API
68#ifndef NO_FP_API
69int X509_CRL_print_fp(FILE *fp, X509_CRL *x) 68int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
70 { 69 {
71 BIO *b; 70 BIO *b;
@@ -86,11 +85,10 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
86int X509_CRL_print(BIO *out, X509_CRL *x) 85int X509_CRL_print(BIO *out, X509_CRL *x)
87{ 86{
88 char buf[256]; 87 char buf[256];
89 unsigned char *s;
90 STACK_OF(X509_REVOKED) *rev; 88 STACK_OF(X509_REVOKED) *rev;
91 X509_REVOKED *r; 89 X509_REVOKED *r;
92 long l; 90 long l;
93 int i, j, n; 91 int i, n;
94 92
95 BIO_printf(out, "Certificate Revocation List (CRL):\n"); 93 BIO_printf(out, "Certificate Revocation List (CRL):\n");
96 l = X509_CRL_get_version(x); 94 l = X509_CRL_get_version(x);
@@ -109,15 +107,12 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
109 BIO_printf(out,"\n"); 107 BIO_printf(out,"\n");
110 108
111 n=X509_CRL_get_ext_count(x); 109 n=X509_CRL_get_ext_count(x);
112 if (n > 0) { 110 X509V3_extensions_print(out, "CRL extensions",
113 BIO_printf(out,"%8sCRL extensions:\n",""); 111 x->crl->extensions, 0, 8);
114 for (i=0; i<n; i++) ext_print(out, X509_CRL_get_ext(x, i));
115 }
116
117 112
118 rev = X509_CRL_get_REVOKED(x); 113 rev = X509_CRL_get_REVOKED(x);
119 114
120 if(sk_X509_REVOKED_num(rev)) 115 if(sk_X509_REVOKED_num(rev) > 0)
121 BIO_printf(out, "Revoked Certificates:\n"); 116 BIO_printf(out, "Revoked Certificates:\n");
122 else BIO_printf(out, "No Revoked Certificates.\n"); 117 else BIO_printf(out, "No Revoked Certificates.\n");
123 118
@@ -128,39 +123,11 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
128 BIO_printf(out,"\n Revocation Date: ",""); 123 BIO_printf(out,"\n Revocation Date: ","");
129 ASN1_TIME_print(out,r->revocationDate); 124 ASN1_TIME_print(out,r->revocationDate);
130 BIO_printf(out,"\n"); 125 BIO_printf(out,"\n");
131 for(j = 0; j < X509_REVOKED_get_ext_count(r); j++) 126 X509V3_extensions_print(out, "CRL entry extensions",
132 ext_print(out, X509_REVOKED_get_ext(r, j)); 127 r->extensions, 0, 8);
133 }
134
135 i=OBJ_obj2nid(x->sig_alg->algorithm);
136 BIO_printf(out," Signature Algorithm: %s",
137 (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i));
138
139 s = x->signature->data;
140 n = x->signature->length;
141 for (i=0; i<n; i++, s++)
142 {
143 if ((i%18) == 0) BIO_write(out,"\n ",9);
144 BIO_printf(out,"%02x%s",*s, ((i+1) == n)?"":":");
145 } 128 }
146 BIO_write(out,"\n",1); 129 X509_signature_print(out, x->sig_alg, x->signature);
147 130
148 return 1; 131 return 1;
149 132
150} 133}
151
152static void ext_print(BIO *out, X509_EXTENSION *ex)
153{
154 ASN1_OBJECT *obj;
155 int j;
156 BIO_printf(out,"%12s","");
157 obj=X509_EXTENSION_get_object(ex);
158 i2a_ASN1_OBJECT(out,obj);
159 j=X509_EXTENSION_get_critical(ex);
160 BIO_printf(out, ": %s\n", j ? "critical":"","");
161 if(!X509V3_EXT_print(out, ex, 0, 16)) {
162 BIO_printf(out, "%16s", "");
163 M_ASN1_OCTET_STRING_print(out,ex->value);
164 }
165 BIO_write(out,"\n",1);
166}