diff --git a/include/znc/User.h b/include/znc/User.h index db86b95f..2991a93a 100644 --- a/include/znc/User.h +++ b/include/znc/User.h @@ -33,6 +33,7 @@ public: bool ParseConfig(CConfig* Config, CString& sError); + // TODO refactor this enum eHashType { HASH_NONE, HASH_MD5, @@ -43,6 +44,7 @@ public: // If you change the default hash here and in HASH_DEFAULT, // don't forget CUtils::sDefaultHash! + // TODO refactor this static CString SaltedHash(const CString& sPass, const CString& sSalt) { return CUtils::SaltedSHA256Hash(sPass, sSalt); } diff --git a/include/znc/Utils.h b/include/znc/Utils.h index 54716560..c8f55556 100644 --- a/include/znc/Utils.h +++ b/include/znc/Utils.h @@ -45,7 +45,10 @@ public: static void PrintAction(const CString& sMessage); static void PrintStatus(bool bSuccess, const CString& sMessage = ""); +#ifndef SWIGPERL + // TODO refactor this static const CString sDefaultHash; +#endif static CString GetSaltedHashPass(CString& sSalt); static CString GetSalt(); diff --git a/src/Utils.cpp b/src/Utils.cpp index 67849989..7474ad56 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -148,6 +148,7 @@ unsigned long CUtils::GetLongIP(const CString& sIP) { // If you change this here and in GetSaltedHashPass(), // don't forget CUser::HASH_DEFAULT! +// TODO refactor this const CString CUtils::sDefaultHash = "sha256"; CString CUtils::GetSaltedHashPass(CString& sSalt) { sSalt = GetSalt();