/*
- * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
(char *)mdname,
(char *)engine,
pmacctx->key->properties,
- pmacctx->key->priv_key,
- pmacctx->key->priv_key_len))
+ NULL, 0))
return 0;
- if (!EVP_MAC_init(pmacctx->macctx))
+ if (!EVP_MAC_init(pmacctx->macctx, pmacctx->key->priv_key,
+ pmacctx->key->priv_key_len, NULL))
return 0;
return 1;
return NULL;
*dstctx = *srcctx;
+ dstctx->propq = NULL;
dstctx->key = NULL;
dstctx->macctx = NULL;
+ if (srcctx->propq != NULL && (dstctx->propq = OPENSSL_strdup(srcctx->propq)) == NULL)
+ goto err;
+
if (srcctx->key != NULL && !ossl_mac_key_up_ref(srcctx->key))
goto err;
dstctx->key = srcctx->key;