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/encode_decode/encoder_meth.c | |
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/encode_decode/encoder_meth.c')
-rw-r--r-- | crypto/encode_decode/encoder_meth.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c index 93929b5360..bc3c1bd32a 100644 --- a/crypto/encode_decode/encoder_meth.c +++ b/crypto/encode_decode/encoder_meth.c @@ -69,20 +69,20 @@ static void encoder_store_free(void *vstore) ossl_method_store_free(vstore); } -static void *encoder_store_new(OPENSSL_CTX *ctx) +static void *encoder_store_new(OSSL_LIB_CTX *ctx) { return ossl_method_store_new(ctx); } -static const OPENSSL_CTX_METHOD encoder_store_method = { +static const OSSL_LIB_CTX_METHOD encoder_store_method = { encoder_store_new, encoder_store_free, }; /* Data to be passed through ossl_method_construct() */ struct encoder_data_st { - OPENSSL_CTX *libctx; + OSSL_LIB_CTX *libctx; OSSL_METHOD_CONSTRUCT_METHOD *mcm; int id; /* For get_encoder_from_store() */ const char *names; /* For get_encoder_from_store() */ @@ -95,7 +95,7 @@ struct encoder_data_st { */ /* Temporary encoder method store, constructor and destructor */ -static void *alloc_tmp_encoder_store(OPENSSL_CTX *ctx) +static void *alloc_tmp_encoder_store(OSSL_LIB_CTX *ctx) { return ossl_method_store_new(ctx); } @@ -107,14 +107,14 @@ static void dealloc_tmp_encoder_store(void *store) } /* Get the permanent encoder store */ -static OSSL_METHOD_STORE *get_encoder_store(OPENSSL_CTX *libctx) +static OSSL_METHOD_STORE *get_encoder_store(OSSL_LIB_CTX *libctx) { - return openssl_ctx_get_data(libctx, OPENSSL_CTX_ENCODER_STORE_INDEX, - &encoder_store_method); + return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_ENCODER_STORE_INDEX, + &encoder_store_method); } /* Get encoder methods from a store, or put one in */ -static void *get_encoder_from_store(OPENSSL_CTX *libctx, void *store, +static void *get_encoder_from_store(OSSL_LIB_CTX *libctx, void *store, void *data) { struct encoder_data_st *methdata = data; @@ -136,7 +136,7 @@ static void *get_encoder_from_store(OPENSSL_CTX *libctx, void *store, return method; } -static int put_encoder_in_store(OPENSSL_CTX *libctx, void *store, +static int put_encoder_in_store(OSSL_LIB_CTX *libctx, void *store, void *method, const OSSL_PROVIDER *prov, int operation_id, const char *names, const char *propdef, void *unused) @@ -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. */ - 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 id = ossl_namemap_add_names(namemap, 0, names, NAME_SEPARATOR); @@ -286,7 +286,7 @@ static void free_encoder(void *method) } /* Fetching support. Can fetch by numeric identity or by name */ -static OSSL_ENCODER *inner_ossl_encoder_fetch(OPENSSL_CTX *libctx, +static OSSL_ENCODER *inner_ossl_encoder_fetch(OSSL_LIB_CTX *libctx, int id, const char *name, const char *properties) { @@ -343,13 +343,13 @@ static OSSL_ENCODER *inner_ossl_encoder_fetch(OPENSSL_CTX *libctx, return method; } -OSSL_ENCODER *OSSL_ENCODER_fetch(OPENSSL_CTX *libctx, const char *name, +OSSL_ENCODER *OSSL_ENCODER_fetch(OSSL_LIB_CTX *libctx, const char *name, const char *properties) { return inner_ossl_encoder_fetch(libctx, 0, name, properties); } -OSSL_ENCODER *ossl_encoder_fetch_by_number(OPENSSL_CTX *libctx, int id, +OSSL_ENCODER *ossl_encoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id, const char *properties) { return inner_ossl_encoder_fetch(libctx, id, NULL, properties); @@ -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) { - OPENSSL_CTX *libctx = ossl_provider_library_context(encoder->base.prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(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; - OPENSSL_CTX *libctx = ossl_provider_library_context(provider); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(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); @@ -426,7 +426,7 @@ static void encoder_do_one(OSSL_PROVIDER *provider, } } -void OSSL_ENCODER_do_all_provided(OPENSSL_CTX *libctx, +void OSSL_ENCODER_do_all_provided(OSSL_LIB_CTX *libctx, void (*fn)(OSSL_ENCODER *encoder, void *arg), void *arg) { @@ -451,7 +451,7 @@ void OSSL_ENCODER_names_do_all(const OSSL_ENCODER *encoder, return; if (encoder->base.prov != NULL) { - OPENSSL_CTX *libctx = ossl_provider_library_context(encoder->base.prov); + OSSL_LIB_CTX *libctx = ossl_provider_library_context(encoder->base.prov); OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx); ossl_namemap_doall_names(namemap, encoder->base.id, fn, data); |