aboutsummaryrefslogtreecommitdiff
path: root/test_digest.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-06-12 16:13:40 +1000
committerGitHub <noreply@github.com>2020-06-12 09:13:40 +0300
commit30860f940321eb4762d6449ffef48fc93ad2d2e8 (patch)
treeabe9f38345892f64c128de7151623cc1954ed685 /test_digest.c
parent250f9cd5bb0ae299a7f225d66ff5fcb3bbcb1a70 (diff)
downloadgost-engine-30860f940321eb4762d6449ffef48fc93ad2d2e8.zip
gost-engine-30860f940321eb4762d6449ffef48fc93ad2d2e8.tar.gz
gost-engine-30860f940321eb4762d6449ffef48fc93ad2d2e8.tar.bz2
EVP_MAC: APIs were renamed so they need to be fixed in here too. (#267)
Diffstat (limited to 'test_digest.c')
-rw-r--r--test_digest.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test_digest.c b/test_digest.c
index 6a35533..06b3db4 100644
--- a/test_digest.c
+++ b/test_digest.c
@@ -529,7 +529,7 @@ static int do_hmac_prov(int iter, const EVP_MD *type, const char *plaintext,
EVP_MAC *hmac;
T(hmac = EVP_MAC_fetch(NULL, "HMAC", NULL));
EVP_MAC_CTX *ctx;
- T(ctx = EVP_MAC_CTX_new(hmac));
+ T(ctx = EVP_MAC_new_ctx(hmac));
OSSL_PARAM params[] = {
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_DIGEST,
(char *)EVP_MD_name(type), 0),
@@ -537,11 +537,11 @@ static int do_hmac_prov(int iter, const EVP_MD *type, const char *plaintext,
(char *)t->key, t->key_size),
OSSL_PARAM_END
};
- T(EVP_MAC_CTX_set_params(ctx, params));
+ T(EVP_MAC_set_ctx_params(ctx, params));
T(EVP_MAC_init(ctx));
T(EVP_MAC_update(ctx, (unsigned char *)plaintext, t->psize));
T(EVP_MAC_final(ctx, md, &len, EVP_MAX_MD_SIZE));
- EVP_MAC_CTX_free(ctx);
+ EVP_MAC_free_ctx(ctx);
EVP_MAC_free(hmac);
if (t->mdsize)
@@ -606,17 +606,17 @@ static int do_cmac_prov(int iter, const char *plaintext,
EVP_MAC *cmac;
T(cmac = EVP_MAC_fetch(NULL, "CMAC", NULL));
EVP_MAC_CTX *ctx;
- T(ctx = EVP_MAC_CTX_new(cmac));
+ T(ctx = EVP_MAC_new_ctx(cmac));
OSSL_PARAM params[] = {
OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_CIPHER, mdname, 0),
OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, (char *)t->key, t->key_size),
OSSL_PARAM_END
};
- T(EVP_MAC_CTX_set_params(ctx, params));
+ T(EVP_MAC_set_ctx_params(ctx, params));
T(EVP_MAC_init(ctx));
T(EVP_MAC_update(ctx, (unsigned char *)plaintext, t->psize));
T(EVP_MAC_final(ctx, md, &len, EVP_MAX_MD_SIZE));
- EVP_MAC_CTX_free(ctx);
+ EVP_MAC_free_ctx(ctx);
EVP_MAC_free(cmac);
/* CMAC provider will not respect outsize, and will output full block.