summaryrefslogtreecommitdiff
path: root/crypto/crmf
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-02-25 13:48:27 +1000
committerPauli <ppzgs1@gmail.com>2021-02-28 17:25:48 +1000
commit1dc28e742d0a7e37f76353680afac547e88375ef (patch)
tree1d9c93c1a8c014e52714a928b425103293e681aa /crypto/crmf
parent4a5d8c0cb7a57cc8019f16ec3218cc1044652dcc (diff)
downloadopenssl-new-1dc28e742d0a7e37f76353680afac547e88375ef.tar.gz
crmf: 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 'crypto/crmf')
-rw-r--r--crypto/crmf/crmf_pbm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/crmf/crmf_pbm.c b/crypto/crmf/crmf_pbm.c
index ffa94667ee..03730c1505 100644
--- a/crypto/crmf/crmf_pbm.c
+++ b/crypto/crmf/crmf_pbm.c
@@ -140,7 +140,7 @@ int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
int ok = 0;
EVP_MAC *mac = NULL;
EVP_MAC_CTX *mctx = NULL;
- OSSL_PARAM macparams[3] = {OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END};
+ OSSL_PARAM macparams[2] = { OSSL_PARAM_END, OSSL_PARAM_END };
if (out == NULL || pbmp == NULL || pbmp->mac == NULL
|| pbmp->mac->algorithm == NULL || msg == NULL || sec == NULL) {
@@ -207,12 +207,10 @@ int OSSL_CRMF_pbm_new(OSSL_LIB_CTX *libctx, const char *propq,
macparams[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST,
(char *)mdname, 0);
- macparams[1] = OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY,
- basekey, bklen);
if ((mac = EVP_MAC_fetch(libctx, "HMAC", propq)) == NULL
|| (mctx = EVP_MAC_CTX_new(mac)) == NULL
|| !EVP_MAC_CTX_set_params(mctx, macparams)
- || !EVP_MAC_init(mctx)
+ || !EVP_MAC_init(mctx, basekey, bklen, macparams)
|| !EVP_MAC_update(mctx, msg, msglen)
|| !EVP_MAC_final(mctx, mac_res, outlen, EVP_MAX_MD_SIZE))
goto err;