mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Encrypt.c: fix MdProcess()'s HMAC implementation
This commit is contained in:
parent
4c0e562019
commit
53c8abfd80
@ -461,6 +461,13 @@ UINT MdProcess(MD *md, void *dest, void *src, UINT size)
|
|||||||
|
|
||||||
if (md->IsHMac)
|
if (md->IsHMac)
|
||||||
{
|
{
|
||||||
|
// WARNING: Do not remove the call to HMAC_Init_ex(), it's required even if the context is initialized by SetMdKey()!
|
||||||
|
if (HMAC_Init_ex(md->Ctx, NULL, 0, NULL, NULL) == false)
|
||||||
|
{
|
||||||
|
Debug("MdProcess(): HMAC_Init_ex() failed with error: %s\n", OpenSSL_Error());
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (HMAC_Update(md->Ctx, src, size) == false)
|
if (HMAC_Update(md->Ctx, src, size) == false)
|
||||||
{
|
{
|
||||||
Debug("MdProcess(): HMAC_Update() failed with error: %s\n", OpenSSL_Error());
|
Debug("MdProcess(): HMAC_Update() failed with error: %s\n", OpenSSL_Error());
|
||||||
|
Loading…
Reference in New Issue
Block a user