diff --git a/ssl/ssldecode.c b/ssl/ssldecode.c index 373042c..db0d32c 100644 --- a/ssl/ssldecode.c +++ b/ssl/ssldecode.c @@ -589,12 +589,14 @@ static int tls_P_hash(ssl,secret,seed,md,out) HMAC_Init(&hm,secret->data,secret->len,md); HMAC_Update(&hm,A,A_l); HMAC_Final(&hm,_A,&A_l); + HMAC_cleanup(&hm); A=_A; HMAC_Init(&hm,secret->data,secret->len,md); HMAC_Update(&hm,A,A_l); HMAC_Update(&hm,seed->data,seed->len); HMAC_Final(&hm,tmp,&tmp_l); + HMAC_cleanup(&hm); tocpy=MIN(left,tmp_l); memcpy(ptr,tmp,tocpy); @@ -602,8 +604,6 @@ static int tls_P_hash(ssl,secret,seed,md,out) left-=tocpy; } - HMAC_cleanup(&hm); - CRDUMPD("P_hash out",out); return (0);