prov: use new MAC_init arguments in signature legacy code
[openssl.git] / providers / implementations / signature / mac_legacy.c
index 7d23e36..fb99221 100644 (file)
@@ -117,11 +117,11 @@ static int mac_digest_sign_init(void *vpmacctx, const char *mdname, void *vkey)
                               (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;
@@ -172,9 +172,13 @@ static void *mac_dupctx(void *vpmacctx)
         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;