Provide the ability to create an X509_PUBKEY with a libctx/propq

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15591)
This commit is contained in:
Matt Caswell 2021-05-21 15:50:09 +01:00 committed by Pauli
parent f43f9d6313
commit d6ded941c9
3 changed files with 14 additions and 0 deletions

View File

@ -201,6 +201,18 @@ static const ASN1_EXTERN_FUNCS x509_pubkey_ff = {
IMPLEMENT_EXTERN_ASN1(X509_PUBKEY, V_ASN1_SEQUENCE, x509_pubkey_ff)
IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY)
X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq)
{
X509_PUBKEY *pubkey = NULL;
pubkey = (X509_PUBKEY *)ASN1_item_new((X509_PUBKEY_it()));
if (!x509_pubkey_set0_libctx(pubkey, libctx, propq)) {
X509_PUBKEY_free(pubkey);
pubkey = NULL;
}
return pubkey;
}
/*
* X509_PUBKEY_dup() must be implemented manually, because there is no
* support for it in ASN1_EXTERN_FUNCS.

View File

@ -550,6 +550,7 @@ DECLARE_ASN1_FUNCTIONS(X509_VAL)
DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
X509_PUBKEY *X509_PUBKEY_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);
EVP_PKEY *X509_PUBKEY_get0(const X509_PUBKEY *key);
EVP_PKEY *X509_PUBKEY_get(const X509_PUBKEY *key);

View File

@ -5407,3 +5407,4 @@ b2i_PVK_bio_ex ? 3_0_0 EXIST::FUNCTION:
i2b_PVK_bio_ex ? 3_0_0 EXIST::FUNCTION:
NCONF_get0_libctx ? 3_0_0 EXIST::FUNCTION:
NCONF_get_section_names ? 3_0_0 EXIST::FUNCTION:
X509_PUBKEY_new_ex ? 3_0_0 EXIST::FUNCTION: