diff options
author | Massimiliano Pala <director@openca.org> | 2018-02-19 15:47:02 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2018-02-19 16:04:16 -0500 |
commit | 058f12b7266a21f04893e88d8240b81e7c51fcd5 (patch) | |
tree | 045353a99ff01aec535fa167afbc5507967ac6e8 /crypto | |
parent | c99eaf2135c9c3ff5a00dccd00d332c0c5351776 (diff) |
Add X509_get0_authority_key_id() function
This function makes it easier to retrieve a reference to the
authority key identifier (akid->keyid) inside a certificate.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5271)
(cherry picked from commit b383aa2081467e8d49c3362d295da7bd5cb4e1d8)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/x509v3/v3_purp.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c index fa5c425ffc..9030d5369f 100644 --- a/crypto/x509v3/v3_purp.c +++ b/crypto/x509v3/v3_purp.c @@ -847,6 +847,13 @@ const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x) return x->skid; } +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + return (x->akid != NULL ? x->akid->keyid : NULL); +} + long X509_get_pathlen(X509 *x) { /* Called for side effect of caching extensions */ |