diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-09-18 02:38:49 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-09-22 13:07:46 +0100 |
commit | 32f5c251643a7a63223ac191923071b3cccb480a (patch) | |
tree | d55a9ec058296f2a708fc8372da0c658df4dea30 /crypto | |
parent | 1f143e08a5cde8e3fa6b5b80988bd6be7673428a (diff) |
Use accessor functions in X509_CRL_print().
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/t_crl.c | 19 |
1 files changed, 11 insertions, 8 deletions
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 <openssl/bn.h> #include <openssl/objects.h> #include <openssl/x509.h> -#include "internal/x509_int.h" #include <openssl/x509v3.h> #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; |