diff options
author | Dr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com> | 2020-10-15 12:55:50 +0300 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2020-10-15 11:59:53 +0100 |
commit | b425001010044adbdbcd98f8682694b30b73bbf4 (patch) | |
tree | e87a5b512d7869cb6a500ecc74b706281be762cf /crypto/evp | |
parent | 29000e43ea257bf54f6ccb2064b3744853b821b2 (diff) |
Rename OPENSSL_CTX prefix to OSSL_LIB_CTX
Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix,
e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER.
The OPENSSL_CTX type stands out a little by using a different prefix.
For consistency reasons, this type is renamed to OSSL_LIB_CTX.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12621)
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/asymcipher.c | 4 | ||||
-rw-r--r-- | crypto/evp/digest.c | 6 | ||||
-rw-r--r-- | crypto/evp/evp_enc.c | 8 | ||||
-rw-r--r-- | crypto/evp/evp_fetch.c | 58 | ||||
-rw-r--r-- | crypto/evp/evp_local.h | 8 | ||||
-rw-r--r-- | crypto/evp/evp_pkey.c | 2 | ||||
-rw-r--r-- | crypto/evp/evp_rand.c | 4 | ||||
-rw-r--r-- | crypto/evp/exchange.c | 4 | ||||
-rw-r--r-- | crypto/evp/kdf_meth.c | 4 | ||||
-rw-r--r-- | crypto/evp/kem.c | 4 | ||||
-rw-r--r-- | crypto/evp/keymgmt_meth.c | 6 | ||||
-rw-r--r-- | crypto/evp/m_sigver.c | 6 | ||||
-rw-r--r-- | crypto/evp/mac_meth.c | 4 | ||||
-rw-r--r-- | crypto/evp/names.c | 5 | ||||
-rw-r--r-- | crypto/evp/p5_crpt2.c | 2 | ||||
-rw-r--r-- | crypto/evp/p_lib.c | 19 | ||||
-rw-r--r-- | crypto/evp/p_sign.c | 2 | ||||
-rw-r--r-- | crypto/evp/p_verify.c | 2 | ||||
-rw-r--r-- | crypto/evp/pbe_scrypt.c | 2 | ||||
-rw-r--r-- | crypto/evp/pmeth_lib.c | 8 | ||||
-rw-r--r-- | crypto/evp/signature.c | 4 |
21 files changed, 82 insertions, 80 deletions
diff --git a/crypto/evp/asymcipher.c b/crypto/evp/asymcipher.c index f28bfe6aef..0c767179e6 100644 --- a/crypto/evp/asymcipher.c +++ b/crypto/evp/asymcipher.c @@ -405,7 +405,7 @@ OSSL_PROVIDER *EVP_ASYM_CIPHER_provider(const EVP_ASYM_CIPHER *cipher) return cipher->prov; } -EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm, +EVP_ASYM_CIPHER *EVP_ASYM_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { return evp_generic_fetch(ctx, OSSL_OP_ASYM_CIPHER, algorithm, properties, @@ -424,7 +424,7 @@ int EVP_ASYM_CIPHER_number(const EVP_ASYM_CIPHER *cipher) return cipher->name_id; } -void EVP_ASYM_CIPHER_do_all_provided(OPENSSL_CTX *libctx, +void EVP_ASYM_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_ASYM_CIPHER *cipher, void *arg), void *arg) diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c index 524d3ede8d..281749558d 100644 --- a/crypto/evp/digest.c +++ b/crypto/evp/digest.c @@ -83,7 +83,7 @@ int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) #ifndef FIPS_MODULE EVP_MD_CTX *evp_md_ctx_new_ex(EVP_PKEY *pkey, const ASN1_OCTET_STRING *id, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { EVP_MD_CTX *ctx; EVP_PKEY_CTX *pctx = NULL; @@ -954,7 +954,7 @@ static void evp_md_free(void *md) EVP_MD_free(md); } -EVP_MD *EVP_MD_fetch(OPENSSL_CTX *ctx, const char *algorithm, +EVP_MD *EVP_MD_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { EVP_MD *md = @@ -987,7 +987,7 @@ void EVP_MD_free(EVP_MD *md) OPENSSL_free(md); } -void EVP_MD_do_all_provided(OPENSSL_CTX *libctx, +void EVP_MD_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_MD *mac, void *arg), void *arg) { diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 62c0966409..2f665e9b85 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1174,7 +1174,7 @@ const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher) } #ifndef FIPS_MODULE -static OPENSSL_CTX *EVP_CIPHER_CTX_get_libctx(EVP_CIPHER_CTX *ctx) +static OSSL_LIB_CTX *EVP_CIPHER_CTX_get_libctx(EVP_CIPHER_CTX *ctx) { const EVP_CIPHER *cipher = ctx->cipher; const OSSL_PROVIDER *prov; @@ -1197,7 +1197,7 @@ int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key) #else { int kl; - OPENSSL_CTX *libctx = EVP_CIPHER_CTX_get_libctx(ctx); + OSSL_LIB_CTX *libctx = EVP_CIPHER_CTX_get_libctx(ctx); kl = EVP_CIPHER_CTX_key_length(ctx); if (kl <= 0 || RAND_priv_bytes_ex(libctx, key, kl) <= 0) @@ -1456,7 +1456,7 @@ static void evp_cipher_free(void *cipher) EVP_CIPHER_free(cipher); } -EVP_CIPHER *EVP_CIPHER_fetch(OPENSSL_CTX *ctx, const char *algorithm, +EVP_CIPHER *EVP_CIPHER_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { EVP_CIPHER *cipher = @@ -1494,7 +1494,7 @@ void EVP_CIPHER_free(EVP_CIPHER *cipher) OPENSSL_free(cipher); } -void EVP_CIPHER_do_all_provided(OPENSSL_CTX *libctx, +void EVP_CIPHER_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_CIPHER *mac, void *arg), void *arg) { diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index 253b76a786..761996b313 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -28,20 +28,20 @@ static void evp_method_store_free(void *vstore) ossl_method_store_free(vstore); } -static void *evp_method_store_new(OPENSSL_CTX *ctx) +static void *evp_method_store_new(OSSL_LIB_CTX *ctx) { return ossl_method_store_new(ctx); } -static const OPENSSL_CTX_METHOD evp_method_store_method = { +static const OSSL_LIB_CTX_METHOD evp_method_store_method = { evp_method_store_new, evp_method_store_free, }; /* Data to be passed through ossl_method_construct() */ struct evp_method_data_st { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; OSSL_METHOD_CONSTRUCT_METHOD *mcm; int operation_id; /* For get_evp_method_from_store() */ int name_id; /* For get_evp_method_from_store() */ @@ -59,7 +59,7 @@ struct evp_method_data_st { /* * Generic routines to fetch / create EVP methods with ossl_method_construct() */ -static void *alloc_tmp_evp_method_store(OPENSSL_CTX *ctx) +static void *alloc_tmp_evp_method_store(OSSL_LIB_CTX *ctx) { return ossl_method_store_new(ctx); } @@ -70,10 +70,10 @@ static void *alloc_tmp_evp_method_store(OPENSSL_CTX *ctx) ossl_method_store_free(store); } -static OSSL_METHOD_STORE *get_evp_method_store(OPENSSL_CTX *libctx) +static OSSL_METHOD_STORE *get_evp_method_store(OSSL_LIB_CTX *libctx) { - return openssl_ctx_get_data(libctx, OPENSSL_CTX_EVP_METHOD_STORE_INDEX, - &evp_method_store_method); + return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_EVP_METHOD_STORE_INDEX, + &evp_method_store_method); } /* @@ -95,7 +95,7 @@ static uint32_t evp_method_id(int name_id, unsigned int operation_id) return ((name_id << 8) & 0xFFFFFF00) | (operation_id & 0x000000FF); } -static void *get_evp_method_from_store(OPENSSL_CTX *libctx, void *store, +static void *get_evp_method_from_store(OSSL_LIB_CTX *libctx, void *store, void *data) { struct evp_method_data_st *methdata = data; @@ -133,7 +133,7 @@ static void *get_evp_method_from_store(OPENSSL_CTX *libctx, void *store, return method; } -static int put_evp_method_in_store(OPENSSL_CTX *libctx, void *store, +static int put_evp_method_in_store(OSSL_LIB_CTX *libctx, void *store, void *method, const OSSL_PROVIDER *prov, int operation_id, const char *names, const char *propdef, void *data) @@ -185,7 +185,7 @@ static void *construct_evp_method(const OSSL_ALGORITHM *algodef, * number. */ struct evp_method_data_st *methdata = data; - OPENSSL_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); const char *names = algodef->algorithm_names; int name_id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR); @@ -215,21 +215,21 @@ static void destruct_evp_method(void *method, void *data) methdata->destruct_method(method); } -static const char *libctx_descriptor(OPENSSL_CTX *libctx) +static const char *libctx_descriptor(OSSL_LIB_CTX *libctx) { #ifdef FIPS_MODULE return "FIPS internal library context"; #else - if (openssl_ctx_is_global_default(libctx)) + if (ossl_lib_ctx_is_global_default(libctx)) return "Global default library context"; - if (openssl_ctx_is_default(libctx)) + if (ossl_lib_ctx_is_default(libctx)) return "Thread-local default library context"; return "Non-default library context"; #endif } static void * -inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, +inner_evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id, int name_id, const char *name, const char *properties, void *(*new_method)(int name_id, @@ -352,7 +352,7 @@ inner_evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, return method; } -void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, +void *evp_generic_fetch(OSSL_LIB_CTX *libctx, int operation_id, const char *name, const char *properties, void *(*new_method)(int name_id, const OSSL_DISPATCH *fns, @@ -372,7 +372,7 @@ void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id, * This is meant to be used when one method needs to fetch an associated * other method. */ -void *evp_generic_fetch_by_number(OPENSSL_CTX *libctx, int operation_id, +void *evp_generic_fetch_by_number(OSSL_LIB_CTX *libctx, int operation_id, int name_id, const char *properties, void *(*new_method)(int name_id, const OSSL_DISPATCH *fns, @@ -386,7 +386,7 @@ void *evp_generic_fetch_by_number(OPENSSL_CTX *libctx, int operation_id, free_method); } -void evp_method_store_flush(OPENSSL_CTX *libctx) +void evp_method_store_flush(OSSL_LIB_CTX *libctx) { OSSL_METHOD_STORE *store = get_evp_method_store(libctx); @@ -394,7 +394,7 @@ void evp_method_store_flush(OPENSSL_CTX *libctx) ossl_method_store_flush_cache(store, 1); } -static int evp_set_parsed_default_properties(OPENSSL_CTX *libctx, +static int evp_set_parsed_default_properties(OSSL_LIB_CTX *libctx, OSSL_PROPERTY_LIST *def_prop, int loadconfig) { @@ -412,7 +412,7 @@ static int evp_set_parsed_default_properties(OPENSSL_CTX *libctx, return 0; } -int evp_set_default_properties_int(OPENSSL_CTX *libctx, const char *propq, +int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq, int loadconfig) { OSSL_PROPERTY_LIST *pl = NULL; @@ -424,12 +424,12 @@ int evp_set_default_properties_int(OPENSSL_CTX *libctx, const char *propq, return evp_set_parsed_default_properties(libctx, pl, loadconfig); } -int EVP_set_default_properties(OPENSSL_CTX *libctx, const char *propq) +int EVP_set_default_properties(OSSL_LIB_CTX *libctx, const char *propq) { return evp_set_default_properties_int(libctx, propq, 1); } -static int evp_default_properties_merge(OPENSSL_CTX *libctx, const char *propq) +static int evp_default_properties_merge(OSSL_LIB_CTX *libctx, const char *propq) { OSSL_PROPERTY_LIST **plp = ossl_ctx_global_properties(libctx, 1); OSSL_PROPERTY_LIST *pl1, *pl2; @@ -451,7 +451,7 @@ static int evp_default_properties_merge(OPENSSL_CTX *libctx, const char *propq) return evp_set_parsed_default_properties(libctx, pl2, 0); } -static int evp_default_property_is_enabled(OPENSSL_CTX *libctx, +static int evp_default_property_is_enabled(OSSL_LIB_CTX *libctx, const char *prop_name) { OSSL_PROPERTY_LIST **plp = ossl_ctx_global_properties(libctx, 1); @@ -459,12 +459,12 @@ static int evp_default_property_is_enabled(OPENSSL_CTX *libctx, return plp != NULL && ossl_property_is_enabled(libctx, prop_name, *plp); } -int EVP_default_properties_is_fips_enabled(OPENSSL_CTX *libctx) +int EVP_default_properties_is_fips_enabled(OSSL_LIB_CTX *libctx) { return evp_default_property_is_enabled(libctx, "fips"); } -int EVP_default_properties_enable_fips(OPENSSL_CTX *libctx, int enable) +int EVP_default_properties_enable_fips(OSSL_LIB_CTX *libctx, int enable) { const char *query = (enable != 0) ? "fips=yes" : "-fips"; @@ -484,7 +484,7 @@ static void do_one(OSSL_PROVIDER *provider, const OSSL_ALGORITHM *algo, int no_store, void *vdata) { struct do_all_data_st *data = vdata; - OPENSSL_CTX *libctx = ossl_provider_library_context(provider); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); int name_id = ossl_namemap_add_names(namemap, 0, algo->algorithm_names, NAME_SEPARATOR); @@ -499,7 +499,7 @@ static void do_one(OSSL_PROVIDER *provider, const OSSL_ALGORITHM *algo, } } -void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id, +void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id, void (*user_fn)(void *method, void *arg), void *user_arg, void *(*new_method)(int name_id, @@ -524,7 +524,7 @@ void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id, const char *evp_first_name(const OSSL_PROVIDER *prov, int name_id) { - OPENSSL_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); return ossl_namemap_num2name(namemap, name_id, 0); @@ -536,7 +536,7 @@ int evp_is_a(OSSL_PROVIDER *prov, int number, /* * For a |prov| that is NULL, the library context will be NULL */ - OPENSSL_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); if (prov == NULL) @@ -548,7 +548,7 @@ void evp_names_do_all(OSSL_PROVIDER *prov, int number, void (*fn)(const char *name, void *data), void *data) { - OPENSSL_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); ossl_namemap_doall_names(namemap, number, fn, data); diff --git a/crypto/evp/evp_local.h b/crypto/evp/evp_local.h index 285c69103b..0112cdca02 100644 --- a/crypto/evp/evp_local.h +++ b/crypto/evp/evp_local.h @@ -232,21 +232,21 @@ int is_partially_overlapping(const void *ptr1, const void *ptr2, int len); #include <openssl/types.h> #include <openssl/core.h> -void *evp_generic_fetch(OPENSSL_CTX *ctx, int operation_id, +void *evp_generic_fetch(OSSL_LIB_CTX *ctx, int operation_id, const char *name, const char *properties, void *(*new_method)(int name_id, const OSSL_DISPATCH *fns, OSSL_PROVIDER *prov), int (*up_ref_method)(void *), void (*free_method)(void *)); -void *evp_generic_fetch_by_number(OPENSSL_CTX *ctx, int operation_id, +void *evp_generic_fetch_by_number(OSSL_LIB_CTX *ctx, int operation_id, int name_id, const char *properties, void *(*new_method)(int name_id, const OSSL_DISPATCH *fns, OSSL_PROVIDER *prov), int (*up_ref_method)(void *), void (*free_method)(void *)); -void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id, +void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id, void (*user_fn)(void *method, void *arg), void *user_arg, void *(*new_method)(int name_id, @@ -255,7 +255,7 @@ void evp_generic_do_all(OPENSSL_CTX *libctx, int operation_id, void (*free_method)(void *)); /* Internal fetchers for method types that are to be combined with others */ -EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OPENSSL_CTX *ctx, int name_id, +EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OSSL_LIB_CTX *ctx, int name_id, const char *properties); /* Internal structure constructors for fetched methods */ diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index b9fabf29f0..9e7c978656 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -18,7 +18,7 @@ /* Extract a private key from a PKCS8 structure */ -EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OPENSSL_CTX *libctx, +EVP_PKEY *EVP_PKCS82PKEY_ex(const PKCS8_PRIV_KEY_INFO *p8, OSSL_LIB_CTX *libctx, const char *propq) { EVP_PKEY *pkey = NULL; diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c index c0729656cb..44b648705c 100644 --- a/crypto/evp/evp_rand.c +++ b/crypto/evp/evp_rand.c @@ -263,7 +263,7 @@ static void *evp_rand_from_dispatch(int name_id, return rand; } -EVP_RAND *EVP_RAND_fetch(OPENSSL_CTX *libctx, const char *algorithm, +EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties) { return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties, @@ -447,7 +447,7 @@ const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand) ossl_provider_ctx(EVP_RAND_provider(rand))); } -void EVP_RAND_do_all_provided(OPENSSL_CTX *libctx, +void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_RAND *rand, void *arg), void *arg) { diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c index ea1f771d6f..485ff28041 100644 --- a/crypto/evp/exchange.c +++ b/crypto/evp/exchange.c @@ -166,7 +166,7 @@ OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange) return exchange->prov; } -EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm, +EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { return evp_generic_fetch(ctx, OSSL_OP_KEYEXCH, algorithm, properties, @@ -457,7 +457,7 @@ int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *keyexch, const char *name) return evp_is_a(keyexch->prov, keyexch->name_id, NULL, name); } -void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx, +void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_KEYEXCH *keyexch, void *arg), void *arg) { diff --git a/crypto/evp/kdf_meth.c b/crypto/evp/kdf_meth.c index 1e0128b532..a89a8e9836 100644 --- a/crypto/evp/kdf_meth.c +++ b/crypto/evp/kdf_meth.c @@ -147,7 +147,7 @@ static void *evp_kdf_from_dispatch(int name_id, return kdf; } -EVP_KDF *EVP_KDF_fetch(OPENSSL_CTX *libctx, const char *algorithm, +EVP_KDF *EVP_KDF_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties) { return evp_generic_fetch(libctx, OSSL_OP_KDF, algorithm, properties, @@ -186,7 +186,7 @@ const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf) return kdf->settable_ctx_params(ossl_provider_ctx(EVP_KDF_provider(kdf))); } -void EVP_KDF_do_all_provided(OPENSSL_CTX *libctx, +void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_KDF *kdf, void *arg), void *arg) { diff --git a/crypto/evp/kem.c b/crypto/evp/kem.c index 5b13f0130a..2e61d2061e 100644 --- a/crypto/evp/kem.c +++ b/crypto/evp/kem.c @@ -321,7 +321,7 @@ OSSL_PROVIDER *EVP_KEM_provider(const EVP_KEM *kem) return kem->prov; } -EVP_KEM *EVP_KEM_fetch(OPENSSL_CTX *ctx, const char *algorithm, +EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { return evp_generic_fetch(ctx, OSSL_OP_KEM, algorithm, properties, @@ -340,7 +340,7 @@ int EVP_KEM_number(const EVP_KEM *kem) return kem->name_id; } -void EVP_KEM_do_all_provided(OPENSSL_CTX *libctx, +void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_KEM *kem, void *arg), void *arg) { diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c index 5453ceadda..66cef52144 100644 --- a/crypto/evp/keymgmt_meth.c +++ b/crypto/evp/keymgmt_meth.c @@ -197,7 +197,7 @@ static void *keymgmt_from_dispatch(int name_id, return keymgmt; } -EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OPENSSL_CTX *ctx, int name_id, +EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OSSL_LIB_CTX *ctx, int name_id, const char *properties) { return evp_generic_fetch_by_number(ctx, @@ -207,7 +207,7 @@ EVP_KEYMGMT *evp_keymgmt_fetch_by_number(OPENSSL_CTX *ctx, int name_id, (void (*)(void *))EVP_KEYMGMT_free); } -EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm, +EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties) { return evp_generic_fetch(ctx, OSSL_OP_KEYMGMT, algorithm, properties, @@ -259,7 +259,7 @@ int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name) return evp_is_a(keymgmt->prov, keymgmt->name_id, NULL, name); } -void EVP_KEYMGMT_do_all_provided(OPENSSL_CTX *libctx, +void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_KEYMGMT *keymgmt, void *arg), void *arg) { diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 783225b6f7..c1bddcb946 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -38,7 +38,7 @@ static const char *canon_mdname(const char *mdname) static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, const char *mdname, - OPENSSL_CTX *libctx, const char *props, + OSSL_LIB_CTX *libctx, const char *props, ENGINE *e, EVP_PKEY *pkey, int ver) { EVP_PKEY_CTX *locpctx = NULL; @@ -311,7 +311,7 @@ static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, } int EVP_DigestSignInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const char *mdname, OPENSSL_CTX *libctx, + const char *mdname, OSSL_LIB_CTX *libctx, const char *props, EVP_PKEY *pkey) { return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 0); @@ -324,7 +324,7 @@ int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, } int EVP_DigestVerifyInit_ex(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const char *mdname, OPENSSL_CTX *libctx, + const char *mdname, OSSL_LIB_CTX *libctx, const char *props, EVP_PKEY *pkey) { return do_sigver_init(ctx, pctx, NULL, mdname, libctx, props, NULL, pkey, 1); diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c index 7d02861c7c..c2b7c5c613 100644 --- a/crypto/evp/mac_meth.c +++ b/crypto/evp/mac_meth.c @@ -149,7 +149,7 @@ static void *evp_mac_from_dispatch(int name_id, return mac; } -EVP_MAC *EVP_MAC_fetch(OPENSSL_CTX *libctx, const char *algorithm, +EVP_MAC *EVP_MAC_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties) { return evp_generic_fetch(libctx, OSSL_OP_MAC, algorithm, properties, @@ -193,7 +193,7 @@ const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac) return mac->settable_ctx_params(ossl_provider_ctx(EVP_MAC_provider(mac))); } -void EVP_MAC_do_all_provided(OPENSSL_CTX *libctx, +void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(EVP_MAC *mac, void *arg), void *arg) { diff --git a/crypto/evp/names.c b/crypto/evp/names.c index 5eb7a39ae0..07fda004dc 100644 --- a/crypto/evp/names.c +++ b/crypto/evp/names.c @@ -72,7 +72,8 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name) return evp_get_cipherbyname_ex(NULL, name); } -const EVP_CIPHER *evp_get_cipherbyname_ex(OPENSSL_CTX *libctx, const char *name) +const EVP_CIPHER *evp_get_cipherbyname_ex(OSSL_LIB_CTX *libctx, + const char *name) { const EVP_CIPHER *cp; OSSL_NAMEMAP *namemap; @@ -117,7 +118,7 @@ const EVP_MD *EVP_get_digestbyname(const char *name) return evp_get_digestbyname_ex(NULL, name); } -const EVP_MD *evp_get_digestbyname_ex(OPENSSL_CTX *libctx, const char *name) +const EVP_MD *evp_get_digestbyname_ex(OSSL_LIB_CTX *libctx, const char *name) { const EVP_MD *dp; OSSL_NAMEMAP *namemap; diff --git a/crypto/evp/p5_crpt2.c b/crypto/evp/p5_crpt2.c index b827899445..830a97dde2 100644 --- a/crypto/evp/p5_crpt2.c +++ b/crypto/evp/p5_crpt2.c @@ -22,7 +22,7 @@ int pkcs5_pbkdf2_hmac_ex(const char *pass, int passlen, const unsigned char *salt, int saltlen, int iter, const EVP_MD *digest, int keylen, unsigned char *out, - OPENSSL_CTX *libctx, const char *propq) + OSSL_LIB_CTX *libctx, const char *propq) { const char *empty = ""; int rv = 1, mode = 1; diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index b394fcdebf..e16b8bb4a5 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -335,7 +335,7 @@ int EVP_PKEY_eq(const EVP_PKEY *a, const EVP_PKEY *b) } -static EVP_PKEY *new_raw_key_int(OPENSSL_CTX *libctx, +static EVP_PKEY *new_raw_key_int(OSSL_LIB_CTX *libctx, const char *strtype, const char *propq, int nidtype, @@ -450,7 +450,7 @@ static EVP_PKEY *new_raw_key_int(OPENSSL_CTX *libctx, return pkey; } -EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OPENSSL_CTX *libctx, +EVP_PKEY *EVP_PKEY_new_raw_private_key_ex(OSSL_LIB_CTX *libctx, const char *keytype, const char *propq, const unsigned char *priv, size_t len) @@ -466,7 +466,7 @@ EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e, return new_raw_key_int(NULL, NULL, NULL, type, e, priv, len, 1); } -EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OPENSSL_CTX *libctx, +EVP_PKEY *EVP_PKEY_new_raw_public_key_ex(OSSL_LIB_CTX *libctx, const char *keytype, const char *propq, const unsigned char *pub, size_t len) { @@ -576,7 +576,8 @@ int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, unsigned char *pub, static EVP_PKEY *new_cmac_key_int(const unsigned char *priv, size_t len, const char *cipher_name, - const EVP_CIPHER *cipher, OPENSSL_CTX *libctx, + const EVP_CIPHER *cipher, + OSSL_LIB_CTX *libctx, const char *propq, ENGINE *e) { # ifndef OPENSSL_NO_CMAC @@ -634,7 +635,7 @@ static EVP_PKEY *new_cmac_key_int(const unsigned char *priv, size_t len, } EVP_PKEY *EVP_PKEY_new_CMAC_key_ex(const unsigned char *priv, size_t len, - const char *cipher_name, OPENSSL_CTX *libctx, + const char *cipher_name, OSSL_LIB_CTX *libctx, const char *propq) { return new_cmac_key_int(priv, len, cipher_name, NULL, libctx, propq, NULL); @@ -1069,7 +1070,7 @@ int EVP_PKEY_can_sign(const EVP_PKEY *pkey) } } else { const OSSL_PROVIDER *prov = EVP_KEYMGMT_provider(pkey->keymgmt); - OPENSSL_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); const char *supported_sig = pkey->keymgmt->query_operation_name != NULL ? pkey->keymgmt->query_operation_name(OSSL_OP_SIGNATURE) @@ -1171,7 +1172,7 @@ static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent, int selection /* For provided encoding */, - OPENSSL_CTX *libctx /* For provided encoding */, + OSSL_LIB_CTX *libctx /* For provided encoding */, const char *propquery /* For provided encoding */, int (*legacy_print)(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx), @@ -1687,7 +1688,7 @@ int EVP_PKEY_size(const EVP_PKEY *pkey) return size; } -void *evp_pkey_export_to_provider(EVP_PKEY *pk, OPENSSL_CTX *libctx, +void *evp_pkey_export_to_provider(EVP_PKEY *pk, OSSL_LIB_CTX *libctx, EVP_KEYMGMT **keymgmt, const char *propquery) { @@ -1884,7 +1885,7 @@ int evp_pkey_copy_downgraded(EVP_PKEY **dest, const EVP_PKEY *src) * We perform the export in the same libctx as the keymgmt * that we are using. */ - OPENSSL_CTX *libctx = + OSSL_LIB_CTX *libctx = ossl_provider_library_context(keymgmt->prov); EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_pkey(libctx, *dest, NULL); diff --git a/crypto/evp/p_sign.c b/crypto/evp/p_sign.c index f530091a3e..33d23404a5 100644 --- a/crypto/evp/p_sign.c +++ b/crypto/evp/p_sign.c @@ -15,7 +15,7 @@ #include "crypto/evp.h" int EVP_SignFinal_ex(EVP_MD_CTX *ctx, unsigned char *sigret, - unsigned int *siglen, EVP_PKEY *pkey, OPENSSL_CTX *libctx, + unsigned int *siglen, EVP_PKEY *pkey, OSSL_LIB_CTX *libctx, const char *propq) { unsigned char m[EVP_MAX_MD_SIZE]; diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c index dc1ee84c15..31b04b309b 100644 --- a/crypto/evp/p_verify.c +++ b/crypto/evp/p_verify.c @@ -15,7 +15,7 @@ #include "crypto/evp.h" int EVP_VerifyFinal_ex(EVP_MD_CTX *ctx, const unsigned char *sigbuf, - |