diff options
author | Pauli <ppzgs1@gmail.com> | 2021-02-25 13:48:00 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-02-28 17:25:48 +1000 |
commit | 4a5d8c0cb7a57cc8019f16ec3218cc1044652dcc (patch) | |
tree | 4ec62435bd91de52115e597b365d586e7b89e5a3 /apps/lib | |
parent | 2211bf6bb795c59f43aa93d746c46de63843d7cd (diff) |
apps: updates for the new additional MAC_init arguments
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/14310)
Diffstat (limited to 'apps/lib')
-rw-r--r-- | apps/lib/s_cb.c | 10 |
1 files 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; } |