From 4a5d8c0cb7a57cc8019f16ec3218cc1044652dcc Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 25 Feb 2021 13:48:00 +1000 Subject: [PATCH] apps: updates for the new additional MAC_init arguments Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/14310) --- apps/lib/s_cb.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/lib/s_cb.c b/apps/lib/s_cb.c index 3761d91395..6737eca13e 100644 --- a/apps/lib/s_cb.c +++ b/apps/lib/s_cb.c @@ -741,7 +741,7 @@ int generate_cookie_callback(SSL *ssl, unsigned char *cookie, int res = 0; EVP_MAC *hmac = NULL; EVP_MAC_CTX *ctx = NULL; - OSSL_PARAM params[3], *p = params; + OSSL_PARAM params[2], *p = params; size_t mac_len; /* Initialize a random secret */ @@ -792,14 +792,8 @@ int generate_cookie_callback(SSL *ssl, unsigned char *cookie, goto end; } *p++ = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, "SHA1", 0); - *p++ = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY, cookie_secret, - COOKIE_SECRET_LENGTH); *p = OSSL_PARAM_construct_end(); - if (!EVP_MAC_CTX_set_params(ctx, params)) { - BIO_printf(bio_err, "HMAC context parameter setting failed\n"); - goto end; - } - if (!EVP_MAC_init(ctx)) { + if (!EVP_MAC_init(ctx, cookie_secret, COOKIE_SECRET_LENGTH, params)) { BIO_printf(bio_err, "HMAC context initialisation failed\n"); goto end; }