From afdec13dd972592fd01195cd591538848de5403c Mon Sep 17 00:00:00 2001 From: "Dr. Matthias St. Pierre" Date: Wed, 31 Jul 2019 17:02:45 +0200 Subject: Add missing accessors for X509 AuthorityKeyIdentifier Complements commit b383aa208146, which added X509_get0_authority_key_id(). const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x); [NEW] const ASN1_INTEGER *X509_get0_authority_serial(X509 *x); [NEW] Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/9493) --- crypto/x509/v3_purp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crypto') diff --git a/crypto/x509/v3_purp.c b/crypto/x509/v3_purp.c index d0ac7e6ed9..40f976bdda 100644 --- a/crypto/x509/v3_purp.c +++ b/crypto/x509/v3_purp.c @@ -890,6 +890,20 @@ const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x) return (x->akid != NULL ? x->akid->keyid : NULL); } +const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + return (x->akid != NULL ? x->akid->issuer : NULL); +} + +const ASN1_INTEGER *X509_get0_authority_serial(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + return (x->akid != NULL ? x->akid->serial : NULL); +} + long X509_get_pathlen(X509 *x) { /* Called for side effect of caching extensions */ -- cgit v1.2.3