diff --git a/tdutils/td/utils/crypto.cpp b/tdutils/td/utils/crypto.cpp index 7b033ad0b..51dae8377 100644 --- a/tdutils/td/utils/crypto.cpp +++ b/tdutils/td/utils/crypto.cpp @@ -888,15 +888,11 @@ static void hmac_impl(const char *digest, Slice key, Slice message, MutableSlice EVP_MAC_CTX *ctx = EVP_MAC_CTX_new(hmac); LOG_IF(FATAL, ctx == nullptr); - OSSL_PARAM params[3]; + OSSL_PARAM params[2]; params[0] = OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, const_cast(digest), 0); - params[1] = - OSSL_PARAM_construct_octet_string(OSSL_MAC_PARAM_KEY, const_cast(key.ubegin()), key.size()); - params[2] = OSSL_PARAM_construct_end(); + params[1] = OSSL_PARAM_construct_end(); - int res = EVP_MAC_CTX_set_params(ctx, params); - LOG_IF(FATAL, res != 1); - res = EVP_MAC_init(ctx); + int res = EVP_MAC_init(ctx, const_cast(key.ubegin()), key.size(), params); LOG_IF(FATAL, res != 1); res = EVP_MAC_update(ctx, message.ubegin(), message.size()); LOG_IF(FATAL, res != 1);