]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
EVP_MAC_init API changed
authorDmitry Belyavskiy <beldmit@gmail.com>
Wed, 3 Mar 2021 15:04:49 +0000 (16:04 +0100)
committerDmitry Belyavskiy <beldmit@gmail.com>
Wed, 3 Mar 2021 15:04:49 +0000 (16:04 +0100)
test_digest.c

index 876505b5d029e43e7e85266a836a827b3564121e..bebbf7a97ca899fc89f889a9aca06ab2a8b4dec4 100644 (file)
@@ -533,12 +533,9 @@ static int do_hmac_prov(int iter, const EVP_MD *type, const char *plaintext,
     OSSL_PARAM params[] = {
        OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_DIGEST,
            (char *)EVP_MD_name(type), 0),
-       OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY,
-           (char *)t->key, t->key_size),
        OSSL_PARAM_END
     };
-    T(EVP_MAC_CTX_set_params(ctx, params));
-    T(EVP_MAC_init(ctx));
+    T(EVP_MAC_init(ctx, (const unsigned char *)t->key, t->key_size, params));
     T(EVP_MAC_update(ctx, (unsigned char *)plaintext, t->psize));
     T(EVP_MAC_final(ctx, md, &len, EVP_MAX_MD_SIZE));
     EVP_MAC_CTX_free(ctx);
@@ -609,11 +606,10 @@ static int do_cmac_prov(int iter, const char *plaintext,
     T(ctx = EVP_MAC_CTX_new(cmac));
     OSSL_PARAM params[] = {
        OSSL_PARAM_utf8_string(OSSL_MAC_PARAM_CIPHER, mdname, 0),
-       OSSL_PARAM_octet_string(OSSL_MAC_PARAM_KEY, (char *)t->key, t->key_size),
        OSSL_PARAM_END
     };
     T(EVP_MAC_CTX_set_params(ctx, params));
-    T(EVP_MAC_init(ctx));
+    T(EVP_MAC_init(ctx, (const unsigned char *)t->key, t->key_size, params));
     T(EVP_MAC_update(ctx, (unsigned char *)plaintext, t->psize));
     T(EVP_MAC_final(ctx, md, &len, EVP_MAX_MD_SIZE));
     EVP_MAC_CTX_free(ctx);