mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add sha256 support
This imports the sha256 code from http://www.ouah.org/ogay/sha2/ (The other hashes from sha-2 were removed). sha256 is a much stronger hashing algorithm than md5 is (There were successful birthday attacks against md5). All the code now defaults to creating sha256 salted hashes (The salting used is the same as before). Old znc.conf files can still be read. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1618 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -240,8 +240,8 @@ class CAdminMod : public CModule {
|
||||
}
|
||||
else if (var == "password") {
|
||||
const CString sSalt = CUtils::GetSalt();
|
||||
const CString sHash = CUtils::SaltedHash(value, sSalt);
|
||||
user->SetPass(sHash, true, sSalt);
|
||||
const CString sHash = CUser::SaltedHash(value, sSalt);
|
||||
user->SetPass(sHash, CUser::HASH_DEFAULT, sSalt);
|
||||
PutModule("Password has been changed!!");
|
||||
}
|
||||
else
|
||||
@@ -391,7 +391,7 @@ class CAdminMod : public CModule {
|
||||
|
||||
CUser* pNewUser = new CUser(sUsername);
|
||||
CString sSalt = CUtils::GetSalt();
|
||||
pNewUser->SetPass(CUtils::SaltedHash(sPassword, sSalt), true, sSalt);
|
||||
pNewUser->SetPass(CUser::SaltedHash(sPassword, sSalt), CUser::HASH_DEFAULT, sSalt);
|
||||
if (sIRCServer.size())
|
||||
pNewUser->AddServer(sIRCServer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user