aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509v3/v3_purp.c
diff options
context:
space:
mode:
authorMassimiliano Pala <director@openca.org>2018-02-19 15:47:02 -0500
committerRich Salz <rsalz@openssl.org>2018-02-19 15:47:02 -0500
commitb383aa2081467e8d49c3362d295da7bd5cb4e1d8 (patch)
tree7d0d94682a592749303e41914413cc4ec75a28d7 /crypto/x509v3/v3_purp.c
parent5f7470df83cb179f793026a5950c1446866c9cab (diff)
downloadopenssl-b383aa2081467e8d49c3362d295da7bd5cb4e1d8.zip
openssl-b383aa2081467e8d49c3362d295da7bd5cb4e1d8.tar.gz
openssl-b383aa2081467e8d49c3362d295da7bd5cb4e1d8.tar.bz2
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)
Diffstat (limited to 'crypto/x509v3/v3_purp.c')
-rw-r--r--crypto/x509v3/v3_purp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_purp.c b/crypto/x509v3/v3_purp.c
index 2ff8854..6c78041 100644
--- a/crypto/x509v3/v3_purp.c
+++ b/crypto/x509v3/v3_purp.c
@@ -848,6 +848,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 */