mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 00:04:57 +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:
@ -2519,7 +2519,7 @@ void SiLoadInitialConfiguration(SERVER *s)
|
||||
|
||||
// Initialize the password
|
||||
{
|
||||
Hash(s->HashedPassword, "", 0, true);
|
||||
Sha0(s->HashedPassword, "", 0);
|
||||
}
|
||||
|
||||
// Set the encryption algorithm name to default
|
||||
@ -5103,7 +5103,7 @@ void SiLoadHubCfg(SERVER *s, FOLDER *f, char *name)
|
||||
// Password
|
||||
if (CfgGetByte(f, "HashedPassword", h->HashedPassword, sizeof(h->HashedPassword)) != sizeof(h->HashedPassword))
|
||||
{
|
||||
Hash(h->HashedPassword, "", 0, true);
|
||||
Sha0(h->HashedPassword, "", 0);
|
||||
}
|
||||
if (CfgGetByte(f, "SecurePassword", h->SecurePassword, sizeof(h->SecurePassword)) != sizeof(h->SecurePassword))
|
||||
{
|
||||
@ -5942,7 +5942,7 @@ void SiLoadServerCfg(SERVER *s, FOLDER *f)
|
||||
// Password
|
||||
if (CfgGetByte(f, "HashedPassword", s->HashedPassword, sizeof(s->HashedPassword)) != sizeof(s->HashedPassword))
|
||||
{
|
||||
Hash(s->HashedPassword, "", 0, true);
|
||||
Sha0(s->HashedPassword, "", 0);
|
||||
}
|
||||
|
||||
if (s->ServerType != SERVER_TYPE_STANDALONE)
|
||||
|
Reference in New Issue
Block a user