X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=test_digest.c;h=bebbf7a97ca899fc89f889a9aca06ab2a8b4dec4;hb=28a0a193549a9b778a14fade0219b9daa0e7c5db;hp=876505b5d029e43e7e85266a836a827b3564121e;hpb=b56b7ee05276b92c282efa412ae94163b88ec350;p=openssl-gost%2Fengine.git diff --git a/test_digest.c b/test_digest.c index 876505b..bebbf7a 100644 --- a/test_digest.c +++ b/test_digest.c @@ -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);