Lines 154-160
static void calculate_hmac_sha256(const
Link Here
|
154 |
unsigned int res_len = WD_AUTH_HASH_LEN; |
154 |
unsigned int res_len = WD_AUTH_HASH_LEN; |
155 |
HMAC_CTX *ctx = NULL; |
155 |
HMAC_CTX *ctx = NULL; |
156 |
|
156 |
|
157 |
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) |
157 |
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) |
158 |
ctx = HMAC_CTX_new(); |
158 |
ctx = HMAC_CTX_new(); |
159 |
HMAC_CTX_reset(ctx); |
159 |
HMAC_CTX_reset(ctx); |
160 |
#else |
160 |
#else |
Lines 165-171
static void calculate_hmac_sha256(const
Link Here
|
165 |
HMAC_Init_ex(ctx, key, strlen(key), EVP_sha256(), NULL); |
165 |
HMAC_Init_ex(ctx, key, strlen(key), EVP_sha256(), NULL); |
166 |
HMAC_Update(ctx, (unsigned char*)data, len); |
166 |
HMAC_Update(ctx, (unsigned char*)data, len); |
167 |
HMAC_Final(ctx, (unsigned char*)str, &res_len); |
167 |
HMAC_Final(ctx, (unsigned char*)str, &res_len); |
168 |
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) |
168 |
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) |
169 |
HMAC_CTX_reset(ctx); |
169 |
HMAC_CTX_reset(ctx); |
170 |
HMAC_CTX_free(ctx); |
170 |
HMAC_CTX_free(ctx); |
171 |
#else |
171 |
#else |