diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-22 17:05:36 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2018-02-22 17:05:36 +0000 |
commit | 1fc1769fd2f8ca4e70e5a228566e675229846544 (patch) | |
tree | acf8f80209574fdcc3fccb2ed752809cd837e15b /lib/libcrypto | |
parent | b8f9210008a6e15c411c6b88f55de3bd8aa34d93 (diff) |
Provide X509_get0_pubkey().
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/Symbols.list | 1 | ||||
-rw-r--r-- | lib/libcrypto/x509/x509.h | 5 | ||||
-rw-r--r-- | lib/libcrypto/x509/x509_cmp.c | 10 |
3 files changed, 12 insertions, 4 deletions
diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index bd821d71803..15cc4710be3 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -2955,6 +2955,7 @@ X509_free X509_get0_extensions X509_get0_notAfter X509_get0_notBefore +X509_get0_pubkey X509_get0_pubkey_bitstr X509_get0_signature X509_get1_email diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 906cadaea39..1dafabe971b 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.37 2018/02/22 17:01:44 jsing Exp $ */ +/* $OpenBSD: x509.h,v 1.38 2018/02/22 17:05:35 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -994,7 +994,8 @@ const ASN1_TIME *X509_get0_notAfter(const X509 *x); ASN1_TIME *X509_getm_notAfter(const X509 *x); int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); EVP_PKEY * X509_get_pubkey(X509 *x); -ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); +EVP_PKEY * X509_get0_pubkey(X509 *x); +ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x); int X509_certificate_type(X509 *x,EVP_PKEY *pubkey /* optional */); int X509_REQ_set_version(X509_REQ *x,long version); diff --git a/lib/libcrypto/x509/x509_cmp.c b/lib/libcrypto/x509/x509_cmp.c index 72fbef15446..440467521b9 100644 --- a/lib/libcrypto/x509/x509_cmp.c +++ b/lib/libcrypto/x509/x509_cmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_cmp.c,v 1.27 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: x509_cmp.c,v 1.28 2018/02/22 17:05:35 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -321,11 +321,17 @@ X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name) EVP_PKEY * X509_get_pubkey(X509 *x) { - if ((x == NULL) || (x->cert_info == NULL)) + if (x == NULL || x->cert_info == NULL) return (NULL); return (X509_PUBKEY_get(x->cert_info->key)); } +EVP_PKEY * +X509_get0_pubkey(X509 *x) +{ + return X509_get_pubkey(x); +} + ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x) { |