Fix for use of deprecated OpenSSL HMAC functions

This commit is contained in:
William Robinet 2020-10-06 10:44:32 +02:00
parent f2da9fa2d5
commit 356a0d9cf8
2 changed files with 4 additions and 4 deletions

View file

@ -363,7 +363,7 @@ static int tls_check_mac(d,ct,ver,data,datalen,iv,ivlen,mac)
UCHAR buf[128];
md=EVP_get_digestbyname(digests[d->cs->dig-0x40]);
HMAC_Init(hm,d->mac_key->data,d->mac_key->len,md);
HMAC_Init_ex(hm,d->mac_key->data,d->mac_key->len,md,NULL);
fmt_seq(d->seq,buf);
d->seq++;

View file

@ -677,12 +677,12 @@ static int tls_P_hash(ssl,secret,seed,md,out)
A_l=seed->len;
while(left){
HMAC_Init(hm,secret->data,secret->len,md);
HMAC_Init_ex(hm,secret->data,secret->len,md,NULL);
HMAC_Update(hm,A,A_l);
HMAC_Final(hm,_A,&A_l);
A=_A;
HMAC_Init(hm,secret->data,secret->len,md);
HMAC_Init_ex(hm,secret->data,secret->len,md,NULL);
HMAC_Update(hm,A,A_l);
HMAC_Update(hm,seed->data,seed->len);
HMAC_Final(hm,tmp,&tmp_l);
@ -1068,7 +1068,7 @@ static int ssl_generate_session_hash(ssl,d)
int r,_status,dgi;
unsigned int len;
const EVP_MD *md;
HMAC_CTX *dgictx = HMAC_CTX_new();
EVP_MD_CTX *dgictx = EVP_MD_CTX_create();
if((r=r_data_alloc(&d->session_hash,EVP_MAX_MD_SIZE)))
ABORT(r);