diff options
-rw-r--r-- | src/modules/m_bcrypt.cpp | 11 | ||||
-rw-r--r-- | src/modules/m_pbkdf2.cpp | 2 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/modules/m_bcrypt.cpp b/src/modules/m_bcrypt.cpp index 04cb06b08..a8de729d2 100644 --- a/src/modules/m_bcrypt.cpp +++ b/src/modules/m_bcrypt.cpp @@ -56,17 +56,6 @@ class BCryptProvider : public HashProvider return Generate(data, Salt()); } - bool Compare(const std::string& input, const std::string& hash) CXX11_OVERRIDE - { - std::string ret = Generate(input, hash); - if (ret.empty()) - return false; - - if (ret == hash) - return true; - return false; - } - std::string ToPrintable(const std::string& raw) CXX11_OVERRIDE { return raw; diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index a4ac69f12..8a57936fd 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -126,7 +126,7 @@ class PBKDF2Provider : public HashProvider return false; std::string cmp = PBKDF2(input, hs.salt, hs.iterations, hs.length); - return (cmp == hs.hash); + return InspIRCd::TimingSafeCompare(cmp, hs.hash); } std::string ToPrintable(const std::string& raw) CXX11_OVERRIDE |