X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=engines%2Fhttp.c;h=979573a858bea8551d9053997574e55e1d9e055a;hb=8822b8271b7d110a2b07795d7d25ad5677bc05c4;hp=d3fdba82a93160c5f3c13cc19ac9c1ecd6cfe652;hpb=875e8d6fa4d443068eb1c48a29f5367e454d2a37;p=fio.git diff --git a/engines/http.c b/engines/http.c index d3fdba82..979573a8 100644 --- a/engines/http.c +++ b/engines/http.c @@ -205,14 +205,25 @@ static char *_gen_hex_sha256(const char *p, size_t len) } static void _hmac(unsigned char *md, void *key, int key_len, char *data) { +#ifndef CONFIG_HAVE_OPAQUE_HMAC_CTX + HMAC_CTX _ctx; +#endif HMAC_CTX *ctx; unsigned int hmac_len; +#ifdef CONFIG_HAVE_OPAQUE_HMAC_CTX ctx = HMAC_CTX_new(); +#else + ctx = &_ctx; +#endif HMAC_Init_ex(ctx, key, key_len, EVP_sha256(), NULL); HMAC_Update(ctx, (unsigned char*)data, strlen(data)); HMAC_Final(ctx, md, &hmac_len); +#ifdef CONFIG_HAVE_OPAQUE_HMAC_CTX HMAC_CTX_free(ctx); +#else + HMAC_CTX_cleanup(ctx); +#endif } static int _curl_trace(CURL *handle, curl_infotype type,