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/store | |
parent | 5e2d22d53ed322a7124e26a4fbd116a8210eb77a (diff) | |
download | openssl-ed576acdf591d4164905ab98e89ca5a3b99d90ab.tar.gz |
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/store')
-rw-r--r-- | crypto/store/store_lib.c | 13 | ||||
-rw-r--r-- | crypto/store/store_meth.c | 8 | ||||
-rw-r--r-- | crypto/store/store_result.c | 4 |
3 files changed, 13 insertions, 12 deletions
diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c index 1409f3aef4..f7939ea0dd 100644 --- a/crypto/store/store_lib.c +++ b/crypto/store/store_lib.c @@ -124,7 +124,7 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq, && (fetched_loader = OSSL_STORE_LOADER_fetch(schemes[i], libctx, propq)) != NULL) { const OSSL_PROVIDER *provider = - OSSL_STORE_LOADER_provider(fetched_loader); + OSSL_STORE_LOADER_get0_provider(fetched_loader); void *provctx = OSSL_PROVIDER_get0_provider_ctx(provider); loader_ctx = fetched_loader->p_open(provctx, uri); @@ -351,7 +351,8 @@ int OSSL_STORE_find(OSSL_STORE_CTX *ctx, const OSSL_STORE_SEARCH *search) break; case OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT: if (OSSL_PARAM_BLD_push_utf8_string(bld, OSSL_STORE_PARAM_DIGEST, - EVP_MD_name(search->digest), 0) + EVP_MD_get0_name(search->digest), + 0) && OSSL_PARAM_BLD_push_octet_string(bld, OSSL_STORE_PARAM_FINGERPRINT, search->string, @@ -790,7 +791,7 @@ int OSSL_STORE_supports_search(OSSL_STORE_CTX *ctx, int search_type) if (ctx->fetched_loader != NULL) { void *provctx = - ossl_provider_ctx(OSSL_STORE_LOADER_provider(ctx->fetched_loader)); + ossl_provider_ctx(OSSL_STORE_LOADER_get0_provider(ctx->fetched_loader)); const OSSL_PARAM *params; const OSSL_PARAM *p_subject = NULL; const OSSL_PARAM *p_issuer = NULL; @@ -879,11 +880,11 @@ OSSL_STORE_SEARCH *OSSL_STORE_SEARCH_by_key_fingerprint(const EVP_MD *digest, return NULL; } - if (digest != NULL && len != (size_t)EVP_MD_size(digest)) { + if (digest != NULL && len != (size_t)EVP_MD_get_size(digest)) { ERR_raise_data(ERR_LIB_OSSL_STORE, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST, "%s size is %d, fingerprint size is %zu", - EVP_MD_name(digest), EVP_MD_size(digest), len); + EVP_MD_get0_name(digest), EVP_MD_get_size(digest), len); OPENSSL_free(search); return NULL; } @@ -976,7 +977,7 @@ OSSL_STORE_CTX *OSSL_STORE_attach(BIO *bp, const char *scheme, && (fetched_loader = OSSL_STORE_LOADER_fetch(scheme, libctx, propq)) != NULL) { const OSSL_PROVIDER *provider = - OSSL_STORE_LOADER_provider(fetched_loader); + OSSL_STORE_LOADER_get0_provider(fetched_loader); void *provctx = OSSL_PROVIDER_get0_provider_ctx(provider); OSSL_CORE_BIO *cbio = ossl_core_bio_new_from_bio(bp); diff --git a/crypto/store/store_meth.c b/crypto/store/store_meth.c index 7bf0a329ce..7f11d4fbea 100644 --- a/crypto/store/store_meth.c +++ b/crypto/store/store_meth.c @@ -373,7 +373,7 @@ OSSL_STORE_LOADER *ossl_store_loader_fetch_by_number(OSSL_LIB_CTX *libctx, * Library of basic method functions */ -const OSSL_PROVIDER *OSSL_STORE_LOADER_provider(const OSSL_STORE_LOADER *loader) +const OSSL_PROVIDER *OSSL_STORE_LOADER_get0_provider(const OSSL_STORE_LOADER *loader) { if (!ossl_assert(loader != NULL)) { ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_PASSED_NULL_PARAMETER); @@ -383,7 +383,7 @@ const OSSL_PROVIDER *OSSL_STORE_LOADER_provider(const OSSL_STORE_LOADER *loader) return loader->prov; } -const char *OSSL_STORE_LOADER_properties(const OSSL_STORE_LOADER *loader) +const char *OSSL_STORE_LOADER_get0_properties(const OSSL_STORE_LOADER *loader) { if (!ossl_assert(loader != NULL)) { ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_PASSED_NULL_PARAMETER); @@ -393,7 +393,7 @@ const char *OSSL_STORE_LOADER_properties(const OSSL_STORE_LOADER *loader) return loader->propdef; } -int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader) +int OSSL_STORE_LOADER_get_number(const OSSL_STORE_LOADER *loader) { if (!ossl_assert(loader != NULL)) { ERR_raise(ERR_LIB_OSSL_STORE, ERR_R_PASSED_NULL_PARAMETER); @@ -403,7 +403,7 @@ int OSSL_STORE_LOADER_number(const OSSL_STORE_LOADER *loader) return loader->scheme_id; } -const char *OSSL_STORE_LOADER_description(const OSSL_STORE_LOADER *loader) +const char *OSSL_STORE_LOADER_get0_description(const OSSL_STORE_LOADER *loader) { return loader->description; } diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c index 7c48d182a8..c78d96d532 100644 --- a/crypto/store/store_result.c +++ b/crypto/store/store_result.c @@ -88,7 +88,7 @@ int ossl_store_handle_load_result(const OSSL_PARAM params[], void *arg) OSSL_STORE_INFO **v = &cbdata->v; OSSL_STORE_CTX *ctx = cbdata->ctx; const OSSL_PROVIDER *provider = - OSSL_STORE_LOADER_provider(ctx->fetched_loader); + OSSL_STORE_LOADER_get0_provider(ctx->fetched_loader); OSSL_LIB_CTX *libctx = ossl_provider_libctx(provider); const char *propq = ctx->properties; const OSSL_PARAM *p; @@ -206,7 +206,7 @@ static EVP_PKEY *try_key_ref(struct extracted_param_data_st *data, * 2. The keymgmt is from another provider, then we must * do the export/import dance. */ - if (EVP_KEYMGMT_provider(keymgmt) == provider) { + if (EVP_KEYMGMT_get0_provider(keymgmt) == provider) { keydata = evp_keymgmt_load(keymgmt, data->ref, data->ref_size); } else { struct evp_keymgmt_util_try_import_data_st import_data; |