Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix modperl startup.

User.h and Utils.h should not depend on each other, and instead of name
of default method need to have a function in CUtils, which hashes using
default method (such function is in CUser now)
  • Loading branch information...
commit a6716486c9568f9410ded7f8ad7615f2d476fe0d 1 parent cc52a7d
@DarthGandalf DarthGandalf authored
Showing with 6 additions and 0 deletions.
  1. +2 −0  include/znc/User.h
  2. +3 −0  include/znc/Utils.h
  3. +1 −0  src/Utils.cpp
View
2  include/znc/User.h
@@ -33,6 +33,7 @@ class CUser {
bool ParseConfig(CConfig* Config, CString& sError);
+ // TODO refactor this
enum eHashType {
HASH_NONE,
HASH_MD5,
@@ -43,6 +44,7 @@ class CUser {
// 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);
}
View
3  include/znc/Utils.h
@@ -45,7 +45,10 @@ class CUtils {
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();
View
1  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();
Please sign in to comment.
Something went wrong with that request. Please try again.