From 355d51770e9a6d868eab7aa5442f4c0ac08a0046 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 25 Jun 2020 03:17:17 +0100 Subject: Fix checking bcrypt hashes. Thanks to @lethality for reporting this. --- src/modules/m_bcrypt.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/modules/m_bcrypt.cpp b/src/modules/m_bcrypt.cpp index a8de729d2..a9a1ef2ae 100644 --- a/src/modules/m_bcrypt.cpp +++ b/src/modules/m_bcrypt.cpp @@ -56,6 +56,11 @@ class BCryptProvider : public HashProvider return Generate(data, Salt()); } + bool Compare(const std::string& input, const std::string& hash) CXX11_OVERRIDE + { + return InspIRCd::TimingSafeCompare(Generate(input, hash), hash); + } + std::string ToPrintable(const std::string& raw) CXX11_OVERRIDE { return raw; -- cgit v1.2.3