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/cms/cms_enc.c | |
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/cms/cms_enc.c')
-rw-r--r-- | crypto/cms/cms_enc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index 09dbb21275..a896148dd8 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -62,7 +62,8 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec, cipher = EVP_get_cipherbyobj(calg->algorithm); } if (cipher != NULL) { - fetched_ciph = EVP_CIPHER_fetch(libctx, EVP_CIPHER_name(cipher), propq); + fetched_ciph = EVP_CIPHER_fetch(libctx, EVP_CIPHER_get0_name(cipher), + propq); if (fetched_ciph != NULL) cipher = fetched_ciph; } @@ -79,9 +80,9 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec, } if (enc) { - calg->algorithm = OBJ_nid2obj(EVP_CIPHER_CTX_type(ctx)); + calg->algorithm = OBJ_nid2obj(EVP_CIPHER_CTX_get_type(ctx)); /* Generate a random IV if we need one */ - ivlen = EVP_CIPHER_CTX_iv_length(ctx); + ivlen = EVP_CIPHER_CTX_get_iv_length(ctx); if (ivlen > 0) { if (RAND_bytes_ex(libctx, iv, ivlen, 0) <= 0) goto err; @@ -92,7 +93,7 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec, ERR_raise(ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR); goto err; } - if ((EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { + if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { piv = aparams.iv; if (ec->taglen > 0 && EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG, @@ -102,7 +103,7 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec, } } } - len = EVP_CIPHER_CTX_key_length(ctx); + len = EVP_CIPHER_CTX_get_key_length(ctx); if (len <= 0) goto err; tkeylen = (size_t)len; @@ -160,10 +161,10 @@ BIO *ossl_cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec, ERR_raise(ERR_LIB_CMS, ERR_R_MALLOC_FAILURE); goto err; } - if ((EVP_CIPHER_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { + if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_AEAD_CIPHER)) { memcpy(aparams.iv, piv, ivlen); aparams.iv_len = ivlen; - aparams.tag_len = EVP_CIPHER_CTX_tag_length(ctx); + aparams.tag_len = EVP_CIPHER_CTX_get_tag_length(ctx); if (aparams.tag_len <= 0) goto err; } |