diff options
70 files changed, 136 insertions, 137 deletions
diff --git a/crypto/bn/bn_ctx.c b/crypto/bn/bn_ctx.c index 86a9538cb8..05b266b090 100644 --- a/crypto/bn/bn_ctx.c +++ b/crypto/bn/bn_ctx.c @@ -249,7 +249,7 @@ BIGNUM *BN_CTX_get(BN_CTX *ctx) return ret; } -OSSL_LIB_CTX *bn_get_lib_ctx(BN_CTX *ctx) +OSSL_LIB_CTX *bn_get_libctx(BN_CTX *ctx) { if (ctx == NULL) return NULL; diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c index 4208f2d4d8..cf0d802679 100644 --- a/crypto/bn/bn_rand.c +++ b/crypto/bn/bn_rand.c @@ -25,7 +25,7 @@ static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom, { unsigned char *buf = NULL; int b, ret = 0, bit, bytes, mask; - OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx); + OSSL_LIB_CTX *libctx = bn_get_libctx(ctx); if (bits == 0) { if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY) @@ -254,7 +254,7 @@ int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range, unsigned char *k_bytes = NULL; int ret = 0; EVP_MD *md = NULL; - OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx); + OSSL_LIB_CTX *libctx = bn_get_libctx(ctx); if (mdctx == NULL) goto err; diff --git a/crypto/dh/dh_kdf.c b/crypto/dh/dh_kdf.c index 67c19a5ff6..9737d4d712 100644 --- a/crypto/dh/dh_kdf.c +++ b/crypto/dh/dh_kdf.c @@ -69,7 +69,7 @@ int DH_KDF_X9_42(unsigned char *out, size_t outlen, int nid; const char *key_alg = NULL; const OSSL_PROVIDER *prov = EVP_MD_provider(md); - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov); nid = OBJ_obj2nid(key_oid); if (nid == NID_undef) diff --git a/crypto/ec/ec_cvt.c b/crypto/ec/ec_cvt.c index 57e53d752e..c841ad741d 100644 --- a/crypto/ec/ec_cvt.c +++ b/crypto/ec/ec_cvt.c @@ -54,7 +54,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, meth = EC_GFp_mont_method(); #endif - ret = ec_group_new_ex(bn_get_lib_ctx(ctx), NULL, meth); + ret = ec_group_new_ex(bn_get_libctx(ctx), NULL, meth); if (ret == NULL) return NULL; @@ -75,7 +75,7 @@ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, meth = EC_GF2m_simple_method(); - ret = ec_group_new_ex(bn_get_lib_ctx(ctx), NULL, meth); + ret = ec_group_new_ex(bn_get_libctx(ctx), NULL, meth); if (ret == NULL) return NULL; diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c index 567957ad92..f27bb4c1e4 100644 --- a/crypto/encode_decode/decoder_meth.c +++ b/crypto/encode_decode/decoder_meth.c @@ -245,7 +245,7 @@ static void *construct_decoder(const OSSL_ALGORITHM *algodef, * namemap entry, this is it. Should the name already exist there, we * know that ossl_namemap_add() will return its corresponding number. */ - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); const char *names = algodef->algorithm_names; int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR); @@ -380,7 +380,7 @@ int OSSL_DECODER_number(const OSSL_DECODER *decoder) int OSSL_DECODER_is_a(const OSSL_DECODER *decoder, const char *name) { if (decoder->base.prov != NULL) { - OSSL_LIB_CTX *libctx = ossl_provider_library_context(decoder->base.prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); return ossl_namemap_name2num(namemap, name) == decoder->base.id; @@ -398,7 +398,7 @@ static void decoder_do_one(OSSL_PROVIDER *provider, int no_store, void *vdata) { struct decoder_do_all_data_st *data = vdata; - OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(provider); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); const char *names = algodef->algorithm_names; int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR); @@ -434,7 +434,7 @@ void OSSL_DECODER_names_do_all(const OSSL_DECODER *decoder, return; if (decoder->base.prov != NULL) { - OSSL_LIB_CTX *libctx = ossl_provider_library_context(decoder->base.prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(decoder->base.prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); ossl_namemap_doall_names(namemap, decoder->base.id, fn, data); diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c index bc3c1bd32a..bee54bf63a 100644 --- a/crypto/encode_decode/encoder_meth.c +++ b/crypto/encode_decode/encoder_meth.c @@ -257,7 +257,7 @@ static void *construct_encoder(const OSSL_ALGORITHM *algodef, * namemap entry, this is it. Should the name already exist there, we * know that ossl_namemap_add() will return its corresponding number. */ - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); const char *names = algodef->algorithm_names; int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR); @@ -392,7 +392,7 @@ int OSSL_ENCODER_number(const OSSL_ENCODER *encoder) int OSSL_ENCODER_is_a(const OSSL_ENCODER *encoder, const char *name) { if (encoder->base.prov != NULL) { - OSSL_LIB_CTX *libctx = ossl_provider_library_context(encoder->base.prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); return ossl_namemap_name2num(namemap, name) == encoder->base.id; @@ -410,7 +410,7 @@ static void encoder_do_one(OSSL_PROVIDER *provider, int no_store, void *vdata) { struct encoder_do_all_data_st *data = vdata; - OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(provider); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); const char *names = algodef->algorithm_names; int id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR); @@ -451,7 +451,7 @@ void OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder, return; if (encoder->base.prov != NULL) { - OSSL_LIB_CTX *libctx = ossl_provider_library_context(encoder->base.prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(encoder->base.prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); ossl_namemap_doall_names(namemap, encoder->base.id, fn, data); diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 2f665e9b85..929c95eed8 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -1183,7 +1183,7 @@ static OSSL_LIB_CTX *EVP_CIPHER_CTX_get_libctx(EVP_CIPHER_CTX *ctx) return NULL; prov = EVP_CIPHER_provider(cipher); - return ossl_provider_library_context(prov); + return ossl_provider_libctx(prov); } #endif diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c index 761996b313..e8d1336aa3 100644 --- a/crypto/evp/evp_fetch.c +++ b/crypto/evp/evp_fetch.c @@ -185,7 +185,7 @@ static void *construct_evp_method(const OSSL_ALGORITHM *algodef, * number. */ struct evp_method_data_st *methdata = data; - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(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); @@ -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; - OSSL_LIB_CTX *libctx = ossl_provider_library_context(provider); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(provider); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); int name_id = ossl_namemap_add_names(namemap, 0, algo->algorithm_names, NAME_SEPARATOR); @@ -524,7 +524,7 @@ void evp_generic_do_all(OSSL_LIB_CTX *libctx, int operation_id, const char *evp_first_name(const OSSL_PROVIDER *prov, int name_id) { - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(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 */ - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(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) { - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); ossl_namemap_doall_names(namemap, number, fn, data); diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index e16b8bb4a5..cc30bc3495 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -1070,7 +1070,7 @@ int EVP_PKEY_can_sign(const EVP_PKEY *pkey) } } else { const OSSL_PROVIDER *prov = EVP_KEYMGMT_provider(pkey->keymgmt); - OSSL_LIB_CTX *libctx = ossl_provider_library_context(prov); + OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov); const char *supported_sig = pkey->keymgmt->query_operation_name != NULL ? pkey->keymgmt->query_operation_name(OSSL_OP_SIGNATURE) @@ -1886,7 +1886,7 @@ int evp_pkey_copy_downgraded(EVP_PKEY **dest, const EVP_PKEY *src) * that we are using. */ OSSL_LIB_CTX *libctx = - ossl_provider_library_context(keymgmt->prov); + ossl_provider_libctx(keymgmt->prov); EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_from_pkey(libctx, *dest, NULL); diff --git a/crypto/ffc/ffc_params_generate.c b/crypto/ffc/ffc_params_generate.c index 60a17402b8..815b38efbf 100644 --- a/crypto/ffc/ffc_params_generate.c +++ b/crypto/ffc/ffc_params_generate.c @@ -320,7 +320,7 @@ static int generate_q_fips186_4(BN_CTX *ctx, BIGNUM *q, const EVP_MD *evpmd, unsigned char md[EVP_MAX_MD_SIZE]; int mdsize = EVP_MD_size(evpmd); unsigned char *pmd; - OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx); + OSSL_LIB_CTX *libctx = bn_get_libctx(ctx); /* find q */ for (;;) { @@ -391,7 +391,7 @@ static int generate_q_fips186_2(BN_CTX *ctx, BIGNUM *q, const EVP_MD *evpmd, unsigned char buf2[EVP_MAX_MD_SIZE]; unsigned char md[EVP_MAX_MD_SIZE]; int i, r, ret = 0, m = *retm; - OSSL_LIB_CTX *libctx = bn_get_lib_ctx(ctx); + OSSL_LIB_CTX *libctx = bn_get_libctx(ctx); /* find q */ for (;;) { diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index bbe212d125..b22a75e20d 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -74,7 +74,7 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, * The parameter query isn't available but the library context can be * extracted from the passed digest. */ - kdf = EVP_KDF_fetch(ossl_provider_library_context(EVP_MD_provider(md_type)), + kdf = EVP_KDF_fetch(ossl_provider_libctx(EVP_MD_provider(md_type)), "PKCS12KDF", NULL); if (kdf == NULL) return 0; diff --git a/crypto/provider_core.c b/crypto/provider_core.c index 961f5b9260..52e68641ae 100644 --- a/crypto/provider_core.c +++ b/crypto/provider_core.c @@ -817,7 +817,7 @@ void *ossl_provider_prov_ctx(const OSSL_PROVIDER *prov) return NULL; } -OSSL_LIB_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov) +OSSL_LIB_CTX *ossl_provider_libctx(const OSSL_PROVIDER *prov) { /* TODO(3.0) just: return prov->libctx; */ return prov != NULL ? prov->libctx : NULL; @@ -850,7 +850,7 @@ int ossl_provider_self_test(const OSSL_PROVIDER *prov) return 1; ret = prov->self_test(prov->provctx); if (ret == 0) - evp_method_store_flush(ossl_provider_library_context(prov)); + evp_method_store_flush(ossl_provider_libctx(prov)); return ret; } @@ -941,7 +941,7 @@ static const OSSL_PARAM param_types[] = { static OSSL_FUNC_core_gettable_params_fn core_gettable_params; static OSSL_FUNC_core_get_params_fn core_get_params; static OSSL_FUNC_core_thread_start_fn core_thread_start; -static OSSL_FUNC_core_get_library_context_fn core_get_libctx; +static OSSL_FUNC_core_get_libctx_fn core_get_libctx; #ifndef FIPS_MODULE static OSSL_FUNC_core_new_error_fn core_new_error; static OSSL_FUNC_core_set_error_debug_fn core_set_error_debug; @@ -997,7 +997,7 @@ static OPENSSL_CORE_CTX *core_get_libctx(const OSSL_CORE_HANDLE *handle) */ OSSL_PROVIDER *prov = (OSSL_PROVIDER *)handle; - return (OPENSSL_CORE_CTX *)ossl_provider_library_context(prov); + return (OPENSSL_CORE_CTX *)ossl_provider_libctx(prov); } static int core_thread_start(const OSSL_CORE_HANDLE *handle, @@ -1080,7 +1080,7 @@ static int core_pop_error_to_mark(const OSSL_CORE_HANDLE *handle) static const OSSL_DISPATCH core_dispatch_[] = { { OSSL_FUNC_CORE_GETTABLE_PARAMS, (void (*)(void))core_gettable_params }, { OSSL_FUNC_CORE_GET_PARAMS, (void (*)(void))core_get_params }, - { OSSL_FUNC_CORE_GET_LIBRARY_CONTEXT, (void (*)(void))core_get_libctx }, + { OSSL_FUNC_CORE_GET_LIBCTX, (void (*)(void))core_get_libctx }, { OSSL_FUNC_CORE_THREAD_START, (void (*)(void))core_thread_start }, #ifndef FIPS_MODULE { OSSL_FUNC_CORE_NEW_ERROR, (void (*)(void))core_new_error }, |