From 32f5c251643a7a63223ac191923071b3cccb480a Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 18 Sep 2015 02:38:49 +0100 Subject: Use accessor functions in X509_CRL_print(). Reviewed-by: Rich Salz --- crypto/asn1/t_crl.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'crypto/asn1') diff --git a/crypto/asn1/t_crl.c b/crypto/asn1/t_crl.c index a76e1125e8..8400e851c9 100644 --- a/crypto/asn1/t_crl.c +++ b/crypto/asn1/t_crl.c @@ -63,7 +63,6 @@ #include #include #include -#include "internal/x509_int.h" #include #ifndef OPENSSL_NO_STDIO @@ -87,6 +86,8 @@ int X509_CRL_print(BIO *out, X509_CRL *x) { STACK_OF(X509_REVOKED) *rev; X509_REVOKED *r; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *sig; long l; int i; char *p; @@ -94,8 +95,9 @@ int X509_CRL_print(BIO *out, X509_CRL *x) BIO_printf(out, "Certificate Revocation List (CRL):\n"); l = X509_CRL_get_version(x); BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l + 1, l); - i = OBJ_obj2nid(x->sig_alg.algorithm); - X509_signature_print(out, &x->sig_alg, NULL); + X509_CRL_get0_signature(&sig, &sig_alg, x); + i = X509_CRL_get_signature_nid(x); + X509_signature_print(out, sig_alg, NULL); p = X509_NAME_oneline(X509_CRL_get_issuer(x), NULL, 0); BIO_printf(out, "%8sIssuer: %s\n", "", p); OPENSSL_free(p); @@ -108,7 +110,8 @@ int X509_CRL_print(BIO *out, X509_CRL *x) BIO_printf(out, "NONE"); BIO_printf(out, "\n"); - X509V3_extensions_print(out, "CRL extensions", x->crl.extensions, 0, 8); + X509V3_extensions_print(out, "CRL extensions", + X509_CRL_get0_extensions(x), 0, 8); rev = X509_CRL_get_REVOKED(x); @@ -120,14 +123,14 @@ int X509_CRL_print(BIO *out, X509_CRL *x) for (i = 0; i < sk_X509_REVOKED_num(rev); i++) { r = sk_X509_REVOKED_value(rev, i); BIO_printf(out, " Serial Number: "); - i2a_ASN1_INTEGER(out, r->serialNumber); + i2a_ASN1_INTEGER(out, X509_REVOKED_get0_serialNumber(r)); BIO_printf(out, "\n Revocation Date: "); - ASN1_TIME_print(out, r->revocationDate); + ASN1_TIME_print(out, X509_REVOKED_get0_revocationDate(r)); BIO_printf(out, "\n"); X509V3_extensions_print(out, "CRL entry extensions", - r->extensions, 0, 8); + X509_REVOKED_get0_extensions(r), 0, 8); } - X509_signature_print(out, &x->sig_alg, x->signature); + X509_signature_print(out, sig_alg, sig); return 1; -- cgit v1.2.3