diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-12-14 18:42:28 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-12-14 18:42:28 +0000 |
commit | 2c15d426b927444652cb53f39bc8463a1e6b91a6 (patch) | |
tree | 9850785e8806f5b6ff8dd633e35c603ed333d235 /crypto/asn1/t_crl.c | |
parent | bdcfe1d165b46d9263d3395535631305c3e27bd6 (diff) | |
download | openssl-2c15d426b927444652cb53f39bc8463a1e6b91a6.tar.gz |
New function X509V3_extensions_print() this removes extension duplication
from the print routines.
Reorganisation of OCSP code: initial print routines in ocsp_prn.c. Doesn't
work fully because OCSP extensions aren't reimplemented yet.
Implement some ASN1 functions needed to compile OCSP code.
Diffstat (limited to 'crypto/asn1/t_crl.c')
-rw-r--r-- | crypto/asn1/t_crl.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/crypto/asn1/t_crl.c b/crypto/asn1/t_crl.c index 3a1443386d..f7b938bde2 100644 --- a/crypto/asn1/t_crl.c +++ b/crypto/asn1/t_crl.c @@ -64,7 +64,6 @@ #include <openssl/x509.h> #include <openssl/x509v3.h> -static void ext_print(BIO *out, X509_EXTENSION *ex); #ifndef NO_FP_API int X509_CRL_print_fp(FILE *fp, X509_CRL *x) { @@ -89,7 +88,7 @@ int X509_CRL_print(BIO *out, X509_CRL *x) STACK_OF(X509_REVOKED) *rev; X509_REVOKED *r; long l; - int i, j, n; + int i, n; BIO_printf(out, "Certificate Revocation List (CRL):\n"); l = X509_CRL_get_version(x); @@ -108,11 +107,8 @@ int X509_CRL_print(BIO *out, X509_CRL *x) BIO_printf(out,"\n"); n=X509_CRL_get_ext_count(x); - if (n > 0) { - BIO_printf(out,"%8sCRL extensions:\n",""); - for (i=0; i<n; i++) ext_print(out, X509_CRL_get_ext(x, i)); - } - + X509V3_extensions_print(out, "CRL extensions", + x->crl->extensions, 0, 8); rev = X509_CRL_get_REVOKED(x); @@ -127,27 +123,11 @@ int X509_CRL_print(BIO *out, X509_CRL *x) BIO_printf(out,"\n Revocation Date: ",""); ASN1_TIME_print(out,r->revocationDate); BIO_printf(out,"\n"); - for(j = 0; j < X509_REVOKED_get_ext_count(r); j++) - ext_print(out, X509_REVOKED_get_ext(r, j)); + X509V3_extensions_print(out, "CRL entry extensions", + r->extensions, 0, 8); } X509_signature_print(out, x->sig_alg, x->signature); return 1; } - -static void ext_print(BIO *out, X509_EXTENSION *ex) -{ - ASN1_OBJECT *obj; - int j; - BIO_printf(out,"%12s",""); - obj=X509_EXTENSION_get_object(ex); - i2a_ASN1_OBJECT(out,obj); - j=X509_EXTENSION_get_critical(ex); - BIO_printf(out, ": %s\n", j ? "critical":"",""); - if(!X509V3_EXT_print(out, ex, 0, 16)) { - BIO_printf(out, "%16s", ""); - M_ASN1_OCTET_STRING_print(out,ex->value); - } - BIO_write(out,"\n",1); -} |