diff options
author | Richard Levitte <levitte@openssl.org> | 2020-08-18 20:39:45 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-08-20 12:32:00 +0200 |
commit | 22b814443eea4ef4ea86d5d5677601d6645606d9 (patch) | |
tree | 8c29025ed8bc952d64f10b5822b78d84574ccc02 /include | |
parent | 3b1fd0b003572554ad9bb3914527c160bc6a7727 (diff) |
X509: Add d2i_PUBKEY_ex(), which take a libctx and propq
Just like d2i_PrivateKey() / d2i_PrivateKey_ex(), there's a need to
associate an EVP_PKEY extracted from a PUBKEY to a library context and
a property query string. Without it, a provider-native EVP_PKEY can
only fetch necessary internal algorithms from the default library
context, even though an application specific context should be used.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12671)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/x509.h | 3 | ||||
-rw-r--r-- | include/openssl/x509.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/crypto/x509.h b/include/crypto/x509.h index 87d71de420..c663b68abd 100644 --- a/include/crypto/x509.h +++ b/include/crypto/x509.h @@ -306,3 +306,6 @@ int asn1_item_digest_with_libctx(const ASN1_ITEM *it, const EVP_MD *type, unsigned int *len, OPENSSL_CTX *libctx, const char *propq); int X509_add_cert_new(STACK_OF(X509) **sk, X509 *cert, int flags); + +int X509_PUBKEY_get0_libctx(OPENSSL_CTX **plibctx, const char **ppropq, + const X509_PUBKEY *key); diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 71a5f77301..c373fc9845 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -522,6 +522,8 @@ EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key); int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain); long X509_get_pathlen(X509 *x); DECLARE_ASN1_ENCODE_FUNCTIONS_only(EVP_PKEY, PUBKEY) +EVP_PKEY *d2i_PUBKEY_ex(EVP_PKEY **a, const unsigned char **pp, long length, + OPENSSL_CTX *libctx, const char *propq); # ifndef OPENSSL_NO_RSA DECLARE_ASN1_ENCODE_FUNCTIONS_only(RSA, RSA_PUBKEY) # endif |