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

@@ -827,9 +827,7 @@ bool CUser::CheckPass(const CString& sPass) const {
return (sPass == m_sPass);
}
CString sSaltedPass = sPass + m_sPassSalt;
return (m_sPass.Equals(sSaltedPass.MD5()));
return m_sPass.Equals(CUtils::SaltedHash(sPass, m_sPassSalt));
}
/*CClient* CUser::GetClient() {