X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fasn1%2Ft_crl.c;h=60db305756076332c9cf2149b7bef2af04315b29;hb=bb2297a41d1873e38daf9428be5cb5181b5751a2;hp=d78e4a8f8878609ada45afb425f65af3f399a80e;hpb=08e9c1af6c26f74ef7f7524be4b89241ff232a8c;p=oweals%2Fopenssl.git diff --git a/crypto/asn1/t_crl.c b/crypto/asn1/t_crl.c index d78e4a8f88..60db305756 100644 --- a/crypto/asn1/t_crl.c +++ b/crypto/asn1/t_crl.c @@ -64,8 +64,7 @@ #include #include -static void ext_print(BIO *out, X509_EXTENSION *ex); -#ifndef NO_FP_API +#ifndef OPENSSL_NO_FP_API int X509_CRL_print_fp(FILE *fp, X509_CRL *x) { BIO *b; @@ -86,11 +85,10 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x) int X509_CRL_print(BIO *out, X509_CRL *x) { char buf[256]; - unsigned char *s; 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); @@ -109,15 +107,12 @@ 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; icrl->extensions, 0, 8); rev = X509_CRL_get_REVOKED(x); - if(sk_X509_REVOKED_num(rev)) + if(sk_X509_REVOKED_num(rev) > 0) BIO_printf(out, "Revoked Certificates:\n"); else BIO_printf(out, "No Revoked Certificates.\n"); @@ -128,39 +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)); - } - - i=OBJ_obj2nid(x->sig_alg->algorithm); - BIO_printf(out," Signature Algorithm: %s", - (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)); - - s = x->signature->data; - n = x->signature->length; - for (i=0; iextensions, 0, 8); } - BIO_write(out,"\n",1); + 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); -}