diff options
author | Matt Caswell <matt@openssl.org> | 2020-06-18 09:26:22 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-07-16 14:21:07 +0200 |
commit | 865adf97c9b8271788ee7293ecde9e8a643a1c45 (patch) | |
tree | d4fe29fa8c0587aa4316dc550d57526559f6f6f3 /crypto/modes | |
parent | 8dab4de53887639abc1152288fac76506beb87b3 (diff) |
Revert "The EVP_MAC functions have been renamed for consistency. The EVP_MAC_CTX_*"
The commit claimed to make things more consistent. In fact it makes it
less so. Revert back to the previous namig convention.
This reverts commit d9c2fd51e2e278bc3f7793a104ff7b4879f6d63a.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12186)
Diffstat (limited to 'crypto/modes')
-rw-r--r-- | crypto/modes/siv128.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/crypto/modes/siv128.c b/crypto/modes/siv128.c index f7fadf26d4..d3655674b4 100644 --- a/crypto/modes/siv128.c +++ b/crypto/modes/siv128.c @@ -94,7 +94,7 @@ __owur static ossl_inline int siv128_do_s2v_p(SIV128_CONTEXT *ctx, SIV_BLOCK *ou EVP_MAC_CTX *mac_ctx; int ret = 0; - mac_ctx = EVP_MAC_dup_ctx(ctx->mac_ctx_init); + mac_ctx = EVP_MAC_CTX_dup(ctx->mac_ctx_init); if (mac_ctx == NULL) return 0; @@ -121,7 +121,7 @@ __owur static ossl_inline int siv128_do_s2v_p(SIV128_CONTEXT *ctx, SIV_BLOCK *ou ret = 1; err: - EVP_MAC_free_ctx(mac_ctx); + EVP_MAC_CTX_free(mac_ctx); return ret; } @@ -182,20 +182,20 @@ int CRYPTO_siv128_init(SIV128_CONTEXT *ctx, const unsigned char *key, int klen, /* TODO(3.0) library context */ || (ctx->mac = EVP_MAC_fetch(NULL, OSSL_MAC_NAME_CMAC, NULL)) == NULL - || (ctx->mac_ctx_init = EVP_MAC_new_ctx(ctx->mac)) == NULL - || !EVP_MAC_set_ctx_params(ctx->mac_ctx_init, params) + || (ctx->mac_ctx_init = EVP_MAC_CTX_new(ctx->mac)) == NULL + || !EVP_MAC_CTX_set_params(ctx->mac_ctx_init, params) || !EVP_EncryptInit_ex(ctx->cipher_ctx, ctr, NULL, key + klen, NULL) - || (mac_ctx = EVP_MAC_dup_ctx(ctx->mac_ctx_init)) == NULL + || (mac_ctx = EVP_MAC_CTX_dup(ctx->mac_ctx_init)) == NULL || !EVP_MAC_update(mac_ctx, zero, sizeof(zero)) || !EVP_MAC_final(mac_ctx, ctx->d.byte, &out_len, sizeof(ctx->d.byte))) { EVP_CIPHER_CTX_free(ctx->cipher_ctx); - EVP_MAC_free_ctx(ctx->mac_ctx_init); - EVP_MAC_free_ctx(mac_ctx); + EVP_MAC_CTX_free(ctx->mac_ctx_init); + EVP_MAC_CTX_free(mac_ctx); EVP_MAC_free(ctx->mac); return 0; } - EVP_MAC_free_ctx(mac_ctx); + EVP_MAC_CTX_free(mac_ctx); ctx->final_ret = -1; ctx->crypto_ok = 1; @@ -211,8 +211,8 @@ int CRYPTO_siv128_copy_ctx(SIV128_CONTEXT *dest, SIV128_CONTEXT *src) memcpy(&dest->d, &src->d, sizeof(src->d)); if (!EVP_CIPHER_CTX_copy(dest->cipher_ctx, src->cipher_ctx)) return 0; - EVP_MAC_free_ctx(dest->mac_ctx_init); - dest->mac_ctx_init = EVP_MAC_dup_ctx(src->mac_ctx_init); + EVP_MAC_CTX_free(dest->mac_ctx_init); + dest->mac_ctx_init = EVP_MAC_CTX_dup(src->mac_ctx_init); if (dest->mac_ctx_init == NULL) return 0; return 1; @@ -232,15 +232,15 @@ int CRYPTO_siv128_aad(SIV128_CONTEXT *ctx, const unsigned char *aad, siv128_dbl(&ctx->d); - if ((mac_ctx = EVP_MAC_dup_ctx(ctx->mac_ctx_init)) == NULL + if ((mac_ctx = EVP_MAC_CTX_dup(ctx->mac_ctx_init)) == NULL || !EVP_MAC_update(mac_ctx, aad, len) || !EVP_MAC_final(mac_ctx, mac_out.byte, &out_len, sizeof(mac_out.byte)) || out_len != SIV_LEN) { - EVP_MAC_free_ctx(mac_ctx); + EVP_MAC_CTX_free(mac_ctx); return 0; } - EVP_MAC_free_ctx(mac_ctx); + EVP_MAC_CTX_free(mac_ctx); siv128_xorblock(&ctx->d, &mac_out); @@ -352,7 +352,7 @@ int CRYPTO_siv128_cleanup(SIV128_CONTEXT *ctx) if (ctx != NULL) { EVP_CIPHER_CTX_free(ctx->cipher_ctx); ctx->cipher_ctx = NULL; - EVP_MAC_free_ctx(ctx->mac_ctx_init); + EVP_MAC_CTX_free(ctx->mac_ctx_init); ctx->mac_ctx_init = NULL; EVP_MAC_free(ctx->mac); ctx->mac = NULL; |