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:
@ -206,7 +206,7 @@ static wchar_t *WpLogin(WEBUI *wu, LIST *params)
|
||||
|
||||
// Administrator authentication
|
||||
Rand(random,sizeof(random));
|
||||
Hash(securepass, password, StrLen(password), true);
|
||||
Sha0(securepass, password, StrLen(password));
|
||||
SecurePassword(securepass, securepass, random);
|
||||
result = AdminCheckPassword(wu->Cedar, random, securepass, hubname, false, NULL);
|
||||
|
||||
@ -730,7 +730,7 @@ static wchar_t *WpNewHub(WEBUI *wu, LIST *params)
|
||||
|
||||
Zero(&t, sizeof(t));
|
||||
StrCpy(t.HubName, sizeof(t.HubName), hubname);
|
||||
Hash(t.HashedPassword, passwd, StrLen(passwd), true);
|
||||
Sha0(t.HashedPassword, passwd, StrLen(passwd));
|
||||
HashPassword(t.SecurePassword, ADMINISTRATOR_USERNAME, passwd);
|
||||
t.Online = true;
|
||||
t.HubType = HUB_TYPE_STANDALONE;
|
||||
|
Reference in New Issue
Block a user