mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-10 01:34:58 +03:00
Revamp digest functions
- Hash() has been removed because it was ambiguous, Md5() and Sha0() are proper replacements. - HMacMd5() and HMacSha1() now share a common implementation handled by the new Internal_HMac() function. - NewMd() and MdProcess() now support plain hashing (without the key). - NewMd(), SetMdKey() and MdProcess() now check the OpenSSL functions' return value and in case of failure a debug message is printed along with the error string, if available. - SetMdKey()'s return value has been changed from void to bool, so that it's possible to know whether the function succeeded or not. - MdProcess()' return value has been changed from void to UINT (unsigned int) and the function now returns the number of bytes written by HMAC_Final() or EVP_DigestFinal_ex().
This commit is contained in:
@ -2676,7 +2676,7 @@ void MsChapV2_GenerateChallenge8(UCHAR *dst, UCHAR *client_challenge, UCHAR *ser
|
||||
WriteBuf(b, username2, StrLen(username2));
|
||||
}
|
||||
|
||||
HashSha1(hash, b->Buf, b->Size);
|
||||
Sha1(hash, b->Buf, b->Size);
|
||||
|
||||
FreeBuf(b);
|
||||
|
||||
@ -2739,14 +2739,14 @@ void MsChapV2Server_GenerateResponse(UCHAR *dst, UCHAR *nt_password_hash_hash, U
|
||||
WriteBuf(b, nt_password_hash_hash, 16);
|
||||
WriteBuf(b, client_response, 24);
|
||||
WriteBuf(b, magic1, StrLen(magic1));
|
||||
HashSha1(digest, b->Buf, b->Size);
|
||||
Sha1(digest, b->Buf, b->Size);
|
||||
FreeBuf(b);
|
||||
|
||||
b = NewBuf();
|
||||
WriteBuf(b, digest, sizeof(digest));
|
||||
WriteBuf(b, challenge8, 8);
|
||||
WriteBuf(b, magic2, StrLen(magic2));
|
||||
HashSha1(dst, b->Buf, b->Size);
|
||||
Sha1(dst, b->Buf, b->Size);
|
||||
FreeBuf(b);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user