From 6d8a39589fbd403bd7bb3899e64e7b2ea90a239c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 20 Oct 2021 13:06:40 +0200 Subject: [PATCH] Catch up with OpenSSL API changes. --- t/t_hmac_sha1.c | 12 ++++++------ t/t_hmac_sha224.c | 12 ++++++------ t/t_hmac_sha256.c | 12 ++++++------ t/t_hmac_sha384.c | 12 ++++++------ t/t_hmac_sha512.c | 12 ++++++------ 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/t/t_hmac_sha1.c b/t/t_hmac_sha1.c index a509360..2c22e27 100644 --- a/t/t_hmac_sha1.c +++ b/t/t_hmac_sha1.c @@ -48,13 +48,13 @@ static void t_hmac_sha1_complete(const void *key, size_t keylen, const void *msg, size_t msglen, uint8_t *mac) { - HMAC_CTX ctx; + HMAC_CTX *ctx; - HMAC_CTX_init(&ctx); - HMAC_Init_ex(&ctx, key, keylen, EVP_sha1(), NULL); - HMAC_Update(&ctx, msg, msglen); - HMAC_Final(&ctx, mac, NULL); - HMAC_CTX_cleanup(&ctx); + ctx = HMAC_CTX_new(); + HMAC_Init_ex(ctx, key, keylen, EVP_sha1(), NULL); + HMAC_Update(ctx, msg, msglen); + HMAC_Final(ctx, mac, NULL); + HMAC_CTX_free(ctx); } #else diff --git a/t/t_hmac_sha224.c b/t/t_hmac_sha224.c index 426d10f..36af581 100644 --- a/t/t_hmac_sha224.c +++ b/t/t_hmac_sha224.c @@ -48,13 +48,13 @@ static void t_hmac_sha224_complete(const void *key, size_t keylen, const void *msg, size_t msglen, uint8_t *mac) { - HMAC_CTX ctx; + HMAC_CTX *ctx; - HMAC_CTX_init(&ctx); - HMAC_Init_ex(&ctx, key, keylen, EVP_sha224(), NULL); - HMAC_Update(&ctx, msg, msglen); - HMAC_Final(&ctx, mac, NULL); - HMAC_CTX_cleanup(&ctx); + ctx = HMAC_CTX_new(); + HMAC_Init_ex(ctx, key, keylen, EVP_sha224(), NULL); + HMAC_Update(ctx, msg, msglen); + HMAC_Final(ctx, mac, NULL); + HMAC_CTX_free(ctx); } #else diff --git a/t/t_hmac_sha256.c b/t/t_hmac_sha256.c index 666e3cc..44347f2 100644 --- a/t/t_hmac_sha256.c +++ b/t/t_hmac_sha256.c @@ -48,13 +48,13 @@ static void t_hmac_sha256_complete(const void *key, size_t keylen, const void *msg, size_t msglen, uint8_t *mac) { - HMAC_CTX ctx; + HMAC_CTX *ctx; - HMAC_CTX_init(&ctx); - HMAC_Init_ex(&ctx, key, keylen, EVP_sha256(), NULL); - HMAC_Update(&ctx, msg, msglen); - HMAC_Final(&ctx, mac, NULL); - HMAC_CTX_cleanup(&ctx); + ctx = HMAC_CTX_new(); + HMAC_Init_ex(ctx, key, keylen, EVP_sha256(), NULL); + HMAC_Update(ctx, msg, msglen); + HMAC_Final(ctx, mac, NULL); + HMAC_CTX_free(ctx); } #else diff --git a/t/t_hmac_sha384.c b/t/t_hmac_sha384.c index 2ace283..1e9b93e 100644 --- a/t/t_hmac_sha384.c +++ b/t/t_hmac_sha384.c @@ -48,13 +48,13 @@ static void t_hmac_sha384_complete(const void *key, size_t keylen, const void *msg, size_t msglen, uint8_t *mac) { - HMAC_CTX ctx; + HMAC_CTX *ctx; - HMAC_CTX_init(&ctx); - HMAC_Init_ex(&ctx, key, keylen, EVP_sha384(), NULL); - HMAC_Update(&ctx, msg, msglen); - HMAC_Final(&ctx, mac, NULL); - HMAC_CTX_cleanup(&ctx); + ctx = HMAC_CTX_new(); + HMAC_Init_ex(ctx, key, keylen, EVP_sha384(), NULL); + HMAC_Update(ctx, msg, msglen); + HMAC_Final(ctx, mac, NULL); + HMAC_CTX_free(ctx); } #else diff --git a/t/t_hmac_sha512.c b/t/t_hmac_sha512.c index 7701713..5855a06 100644 --- a/t/t_hmac_sha512.c +++ b/t/t_hmac_sha512.c @@ -48,13 +48,13 @@ static void t_hmac_sha512_complete(const void *key, size_t keylen, const void *msg, size_t msglen, uint8_t *mac) { - HMAC_CTX ctx; + HMAC_CTX *ctx; - HMAC_CTX_init(&ctx); - HMAC_Init_ex(&ctx, key, keylen, EVP_sha512(), NULL); - HMAC_Update(&ctx, msg, msglen); - HMAC_Final(&ctx, mac, NULL); - HMAC_CTX_cleanup(&ctx); + ctx = HMAC_CTX_new(); + HMAC_Init_ex(ctx, key, keylen, EVP_sha512(), NULL); + HMAC_Update(ctx, msg, msglen); + HMAC_Final(ctx, mac, NULL); + HMAC_CTX_free(ctx); } #else