summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-06-25 03:17:17 +0100
committerSadie Powell <sadie@witchery.services>2020-06-25 03:23:39 +0100
commit355d51770e9a6d868eab7aa5442f4c0ac08a0046 (patch)
treeef331c1ba228ff947d0bd1b33748ea52e0d9cd37 /src
parent57dfd6249a69ae6b667230c3597fb4b86e31db70 (diff)
Fix checking bcrypt hashes.
Thanks to @lethality for reporting this.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_bcrypt.cpp5
1 files changed, 5 insertions, 0 deletions
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;