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 /providers/implementations/rands | |
parent | 5e2d22d53ed322a7124e26a4fbd116a8210eb77a (diff) | |
download | openssl-ed576acdf591d4164905ab98e89ca5a3b99d90ab.zip openssl-ed576acdf591d4164905ab98e89ca5a3b99d90ab.tar.gz openssl-ed576acdf591d4164905ab98e89ca5a3b99d90ab.tar.bz2 |
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 'providers/implementations/rands')
-rw-r--r-- | providers/implementations/rands/drbg_ctr.c | 5 | ||||
-rw-r--r-- | providers/implementations/rands/drbg_hash.c | 6 | ||||
-rw-r--r-- | providers/implementations/rands/drbg_hmac.c | 8 |
3 files changed, 10 insertions, 9 deletions
diff --git a/providers/implementations/rands/drbg_ctr.c b/providers/implementations/rands/drbg_ctr.c index 48e8677..458feca 100644 --- a/providers/implementations/rands/drbg_ctr.c +++ b/providers/implementations/rands/drbg_ctr.c @@ -540,7 +540,7 @@ static int drbg_ctr_init(PROV_DRBG *drbg) ERR_raise(ERR_LIB_PROV, PROV_R_MISSING_CIPHER); return 0; } - ctr->keylen = keylen = EVP_CIPHER_key_length(ctr->cipher_ctr); + ctr->keylen = keylen = EVP_CIPHER_get_key_length(ctr->cipher_ctr); if (ctr->ctx_ecb == NULL) ctr->ctx_ecb = EVP_CIPHER_CTX_new(); if (ctr->ctx_ctr == NULL) @@ -645,7 +645,8 @@ static int drbg_ctr_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_CIPHER); if (p != NULL) { if (ctr->cipher_ctr == NULL - || !OSSL_PARAM_set_utf8_string(p, EVP_CIPHER_name(ctr->cipher_ctr))) + || !OSSL_PARAM_set_utf8_string(p, + EVP_CIPHER_get0_name(ctr->cipher_ctr))) return 0; } diff --git a/providers/implementations/rands/drbg_hash.c b/providers/implementations/rands/drbg_hash.c index 4db104c..6deb0a2 100644 --- a/providers/implementations/rands/drbg_hash.c +++ b/providers/implementations/rands/drbg_hash.c @@ -438,7 +438,7 @@ static int drbg_hash_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_DIGEST); if (p != NULL) { md = ossl_prov_digest_md(&hash->digest); - if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_name(md))) + if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_get0_name(md))) return 0; } @@ -468,13 +468,13 @@ static int drbg_hash_set_ctx_params(void *vctx, const OSSL_PARAM params[]) md = ossl_prov_digest_md(&hash->digest); if (md != NULL) { - if ((EVP_MD_flags(md) & EVP_MD_FLAG_XOF) != 0) { + if ((EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF) != 0) { ERR_raise(ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED); return 0; } /* These are taken from SP 800-90 10.1 Table 2 */ - hash->blocklen = EVP_MD_size(md); + hash->blocklen = EVP_MD_get_size(md); /* See SP800-57 Part1 Rev4 5.6.1 Table 3 */ ctx->strength = 64 * (hash->blocklen >> 3); if (ctx->strength > 256) diff --git a/providers/implementations/rands/drbg_hmac.c b/providers/implementations/rands/drbg_hmac.c index 67c0339..e68465a 100644 --- a/providers/implementations/rands/drbg_hmac.c +++ b/providers/implementations/rands/drbg_hmac.c @@ -326,7 +326,7 @@ static int drbg_hmac_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) if (p != NULL) { if (hmac->ctx == NULL) return 0; - name = EVP_MAC_name(EVP_MAC_CTX_mac(hmac->ctx)); + name = EVP_MAC_get0_name(EVP_MAC_CTX_get0_mac(hmac->ctx)); if (!OSSL_PARAM_set_utf8_string(p, name)) return 0; } @@ -334,7 +334,7 @@ static int drbg_hmac_get_ctx_params(void *vdrbg, OSSL_PARAM params[]) p = OSSL_PARAM_locate(params, OSSL_DRBG_PARAM_DIGEST); if (p != NULL) { md = ossl_prov_digest_md(&hmac->digest); - if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_name(md))) + if (md == NULL || !OSSL_PARAM_set_utf8_string(p, EVP_MD_get0_name(md))) return 0; } @@ -369,7 +369,7 @@ static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[]) * digests. */ md = ossl_prov_digest_md(&hmac->digest); - if (md != NULL && (EVP_MD_flags(md) & EVP_MD_FLAG_XOF) != 0) { + if (md != NULL && (EVP_MD_get_flags(md) & EVP_MD_FLAG_XOF) != 0) { ERR_raise(ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED); return 0; } @@ -380,7 +380,7 @@ static int drbg_hmac_set_ctx_params(void *vctx, const OSSL_PARAM params[]) if (hmac->ctx != NULL) { /* These are taken from SP 800-90 10.1 Table 2 */ - hmac->blocklen = EVP_MD_size(md); + hmac->blocklen = EVP_MD_get_size(md); /* See SP800-57 Part1 Rev4 5.6.1 Table 3 */ ctx->strength = 64 * (int)(hmac->blocklen >> 3); if (ctx->strength > 256) |