Add CUtils::SaltedHash() for doing salted hashes and do some cleanup

The stuff in CUtils::GetHashPass() and CUtils::GetSaltedHashPass() shouldn't
hurt, since we don't do such stuff in other places for passwords either.

This should improve the readability of the code a lot.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1324 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-01-08 15:57:32 +00:00
parent efcbf7884f
commit a3169af5bd
5 changed files with 19 additions and 53 deletions

View File

@@ -999,8 +999,8 @@ CUser* CWebAdminSock::GetNewUser(CString& sPageRet, CUser* pUser) {
if (!sArg.empty()) {
CString sSalt = CUtils::GetSalt();
CString sSaltedPass = sArg + sSalt;
pNewUser->SetPass(sSaltedPass.MD5(), true, sSalt);
CString sHash = CUtils::SaltedHash(sArg, sSalt);
pNewUser->SetPass(sHash, true, sSalt);
}
VCString vsArgs;