diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-05-21 16:58:08 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-06-01 12:40:00 +0200 |
commit | ed576acdf591d4164905ab98e89ca5a3b99d90ab (patch) | |
tree | c0f36ca1b3d42f34c0c502e700ad09b69b713d3c /crypto/encode_decode | |
parent | 5e2d22d53ed322a7124e26a4fbd116a8210eb77a (diff) |
Rename all getters to use get/get0 in name
For functions that exist in 1.1.1 provide a simple aliases via #define.
Fixes #15236
Functions with OSSL_DECODER_, OSSL_ENCODER_, OSSL_STORE_LOADER_,
EVP_KEYEXCH_, EVP_KEM_, EVP_ASYM_CIPHER_, EVP_SIGNATURE_,
EVP_KEYMGMT_, EVP_RAND_, EVP_MAC_, EVP_KDF_, EVP_PKEY_,
EVP_MD_, and EVP_CIPHER_ prefixes are renamed.
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15405)
Diffstat (limited to 'crypto/encode_decode')
-rw-r--r-- | crypto/encode_decode/decoder_lib.c | 2 | ||||
-rw-r--r-- | crypto/encode_decode/decoder_meth.c | 14 | ||||
-rw-r--r-- | crypto/encode_decode/decoder_pkey.c | 6 | ||||
-rw-r--r-- | crypto/encode_decode/encoder_lib.c | 2 | ||||
-rw-r--r-- | crypto/encode_decode/encoder_meth.c | 14 | ||||
-rw-r--r-- | crypto/encode_decode/encoder_pkey.c | 10 |
6 files changed, 24 insertions, 24 deletions
diff --git a/crypto/encode_decode/decoder_lib.c b/crypto/encode_decode/decoder_lib.c index 022c1d56e2..ddfd90aae5 100644 --- a/crypto/encode_decode/decoder_lib.c +++ b/crypto/encode_decode/decoder_lib.c @@ -300,7 +300,7 @@ int OSSL_DECODER_CTX_add_decoder(OSSL_DECODER_CTX *ctx, OSSL_DECODER *decoder) return 0; } - prov = OSSL_DECODER_provider(decoder); + prov = OSSL_DECODER_get0_provider(decoder); provctx = OSSL_PROVIDER_get0_provider_ctx(prov); if ((decoderctx = decoder->newctx(provctx)) == NULL diff --git a/crypto/encode_decode/decoder_meth.c b/crypto/encode_decode/decoder_meth.c index 48a52c9612..708b319314 100644 --- a/crypto/encode_decode/decoder_meth.c +++ b/crypto/encode_decode/decoder_meth.c @@ -401,7 +401,7 @@ OSSL_DECODER *ossl_decoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id, * Library of basic method functions */ -const OSSL_PROVIDER *OSSL_DECODER_provider(const OSSL_DECODER *decoder) +const OSSL_PROVIDER *OSSL_DECODER_get0_provider(const OSSL_DECODER *decoder) { if (!ossl_assert(decoder != NULL)) { ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER); @@ -411,7 +411,7 @@ const OSSL_PROVIDER *OSSL_DECODER_provider(const OSSL_DECODER *decoder) return decoder->base.prov; } -const char *OSSL_DECODER_properties(const OSSL_DECODER *decoder) +const char *OSSL_DECODER_get0_properties(const OSSL_DECODER *decoder) { if (!ossl_assert(decoder != NULL)) { ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER); @@ -421,7 +421,7 @@ const char *OSSL_DECODER_properties(const OSSL_DECODER *decoder) return decoder->base.propdef; } -int OSSL_DECODER_number(const OSSL_DECODER *decoder) +int OSSL_DECODER_get_number(const OSSL_DECODER *decoder) { if (!ossl_assert(decoder != NULL)) { ERR_raise(ERR_LIB_OSSL_DECODER, ERR_R_PASSED_NULL_PARAMETER); @@ -431,12 +431,12 @@ int OSSL_DECODER_number(const OSSL_DECODER *decoder) return decoder->base.id; } -const char *OSSL_DECODER_name(const OSSL_DECODER *decoder) +const char *OSSL_DECODER_get0_name(const OSSL_DECODER *decoder) { return decoder->base.name; } -const char *OSSL_DECODER_description(const OSSL_DECODER *decoder) +const char *OSSL_DECODER_get0_description(const OSSL_DECODER *decoder) { return decoder->base.description; } @@ -511,7 +511,7 @@ const OSSL_PARAM * OSSL_DECODER_gettable_params(OSSL_DECODER *decoder) { if (decoder != NULL && decoder->gettable_params != NULL) { - void *provctx = ossl_provider_ctx(OSSL_DECODER_provider(decoder)); + void *provctx = ossl_provider_ctx(OSSL_DECODER_get0_provider(decoder)); return decoder->gettable_params(provctx); } @@ -529,7 +529,7 @@ const OSSL_PARAM * OSSL_DECODER_settable_ctx_params(OSSL_DECODER *decoder) { if (decoder != NULL && decoder->settable_ctx_params != NULL) { - void *provctx = ossl_provider_ctx(OSSL_DECODER_provider(decoder)); + void *provctx = ossl_provider_ctx(OSSL_DECODER_get0_provider(decoder)); return decoder->settable_ctx_params(provctx); } diff --git a/crypto/encode_decode/decoder_pkey.c b/crypto/encode_decode/decoder_pkey.c index 0bb068ae68..c9ccb2200a 100644 --- a/crypto/encode_decode/decoder_pkey.c +++ b/crypto/encode_decode/decoder_pkey.c @@ -108,8 +108,8 @@ static int decoder_construct_pkey(OSSL_DECODER_INSTANCE *decoder_inst, if (keymgmt != NULL) { EVP_PKEY *pkey = NULL; void *keydata = NULL; - const OSSL_PROVIDER *keymgmt_prov = EVP_KEYMGMT_provider(keymgmt); - const OSSL_PROVIDER *decoder_prov = OSSL_DECODER_provider(decoder); + const OSSL_PROVIDER *keymgmt_prov = EVP_KEYMGMT_get0_provider(keymgmt); + const OSSL_PROVIDER *decoder_prov = OSSL_DECODER_get0_provider(decoder); /* * If the EVP_KEYMGMT and the OSSL_DECODER are from the @@ -226,7 +226,7 @@ static void collect_decoder(OSSL_DECODER *decoder, void *arg) { struct collect_decoder_data_st *data = arg; size_t i, end_i; - const OSSL_PROVIDER *prov = OSSL_DECODER_provider(decoder); + const OSSL_PROVIDER *prov = OSSL_DECODER_get0_provider(decoder); void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov); if (data->error_occurred) diff --git a/crypto/encode_decode/encoder_lib.c b/crypto/encode_decode/encoder_lib.c index f074c9fb60..4481773610 100644 --- a/crypto/encode_decode/encoder_lib.c +++ b/crypto/encode_decode/encoder_lib.c @@ -279,7 +279,7 @@ int OSSL_ENCODER_CTX_add_encoder(OSSL_ENCODER_CTX *ctx, OSSL_ENCODER *encoder) return 0; } - prov = OSSL_ENCODER_provider(encoder); + prov = OSSL_ENCODER_get0_provider(encoder); provctx = OSSL_PROVIDER_get0_provider_ctx(prov); if ((encoderctx = encoder->newctx(provctx)) == NULL diff --git a/crypto/encode_decode/encoder_meth.c b/crypto/encode_decode/encoder_meth.c index 3b2bc2d83e..33655c12a6 100644 --- a/crypto/encode_decode/encoder_meth.c +++ b/crypto/encode_decode/encoder_meth.c @@ -413,7 +413,7 @@ OSSL_ENCODER *ossl_encoder_fetch_by_number(OSSL_LIB_CTX *libctx, int id, * Library of basic method functions */ -const OSSL_PROVIDER *OSSL_ENCODER_provider(const OSSL_ENCODER *encoder) +const OSSL_PROVIDER *OSSL_ENCODER_get0_provider(const OSSL_ENCODER *encoder) { if (!ossl_assert(encoder != NULL)) { ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER); @@ -423,7 +423,7 @@ const OSSL_PROVIDER *OSSL_ENCODER_provider(const OSSL_ENCODER *encoder) return encoder->base.prov; } -const char *OSSL_ENCODER_properties(const OSSL_ENCODER *encoder) +const char *OSSL_ENCODER_get0_properties(const OSSL_ENCODER *encoder) { if (!ossl_assert(encoder != NULL)) { ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER); @@ -433,7 +433,7 @@ const char *OSSL_ENCODER_properties(const OSSL_ENCODER *encoder) return encoder->base.propdef; } -int OSSL_ENCODER_number(const OSSL_ENCODER *encoder) +int OSSL_ENCODER_get_number(const OSSL_ENCODER *encoder) { if (!ossl_assert(encoder != NULL)) { ERR_raise(ERR_LIB_OSSL_ENCODER, ERR_R_PASSED_NULL_PARAMETER); @@ -443,12 +443,12 @@ int OSSL_ENCODER_number(const OSSL_ENCODER *encoder) return encoder->base.id; } -const char *OSSL_ENCODER_name(const OSSL_ENCODER *encoder) +const char *OSSL_ENCODER_get0_name(const OSSL_ENCODER *encoder) { return encoder->base.name; } -const char *OSSL_ENCODER_description(const OSSL_ENCODER *encoder) +const char *OSSL_ENCODER_get0_description(const OSSL_ENCODER *encoder) { return encoder->base.description; } @@ -528,7 +528,7 @@ const OSSL_PARAM * OSSL_ENCODER_gettable_params(OSSL_ENCODER *encoder) { if (encoder != NULL && encoder->gettable_params != NULL) { - void *provctx = ossl_provider_ctx(OSSL_ENCODER_provider(encoder)); + void *provctx = ossl_provider_ctx(OSSL_ENCODER_get0_provider(encoder)); return encoder->gettable_params(provctx); } @@ -545,7 +545,7 @@ int OSSL_ENCODER_get_params(OSSL_ENCODER *encoder, OSSL_PARAM params[]) const OSSL_PARAM *OSSL_ENCODER_settable_ctx_params(OSSL_ENCODER *encoder) { if (encoder != NULL && encoder->settable_ctx_params != NULL) { - void *provctx = ossl_provider_ctx(OSSL_ENCODER_provider(encoder)); + void *provctx = ossl_provider_ctx(OSSL_ENCODER_get0_provider(encoder)); return encoder->settable_ctx_params(provctx); } diff --git a/crypto/encode_decode/encoder_pkey.c b/crypto/encode_decode/encoder_pkey.c index 3bb0702e43..4a1ffb3b3e 100644 --- a/crypto/encode_decode/encoder_pkey.c +++ b/crypto/encode_decode/encoder_pkey.c @@ -98,7 +98,7 @@ static void collect_encoder(OSSL_ENCODER *encoder, void *arg) end_i = sk_OPENSSL_CSTRING_num(data->names); for (i = 0; i < end_i; i++) { const char *name = sk_OPENSSL_CSTRING_value(data->names, i); - const OSSL_PROVIDER *prov = OSSL_ENCODER_provider(encoder); + const OSSL_PROVIDER *prov = OSSL_ENCODER_get0_provider(encoder); void *provctx = OSSL_PROVIDER_get0_provider_ctx(prov); if (!OSSL_ENCODER_is_a(encoder, name) @@ -173,8 +173,8 @@ encoder_construct_pkey(OSSL_ENCODER_INSTANCE *encoder_inst, void *arg) OSSL_ENCODER *encoder = OSSL_ENCODER_INSTANCE_get_encoder(encoder_inst); const EVP_PKEY *pk = data->pk; - const OSSL_PROVIDER *k_prov = EVP_KEYMGMT_provider(pk->keymgmt); - const OSSL_PROVIDER *e_prov = OSSL_ENCODER_provider(encoder); + const OSSL_PROVIDER *k_prov = EVP_KEYMGMT_get0_provider(pk->keymgmt); + const OSSL_PROVIDER *e_prov = OSSL_ENCODER_get0_provider(encoder); if (k_prov != e_prov) { data->encoder_inst = encoder_inst; @@ -226,7 +226,7 @@ static int ossl_encoder_ctx_setup_for_pkey(OSSL_ENCODER_CTX *ctx, } if (evp_pkey_is_provided(pkey)) { - prov = EVP_KEYMGMT_provider(pkey->keymgmt); + prov = EVP_KEYMGMT_get0_provider(pkey->keymgmt); libctx = ossl_provider_libctx(prov); } @@ -312,7 +312,7 @@ OSSL_ENCODER_CTX *OSSL_ENCODER_CTX_new_for_pkey(const EVP_PKEY *pkey, } if (evp_pkey_is_provided(pkey)) { - const OSSL_PROVIDER *prov = EVP_KEYMGMT_provider(pkey->keymgmt); + const OSSL_PROVIDER *prov = EVP_KEYMGMT_get0_provider(pkey->keymgmt); libctx = ossl_provider_libctx(prov); } |