diff options
| author | 2020-06-25 03:17:17 +0100 | |
|---|---|---|
| committer | 2020-06-25 03:23:39 +0100 | |
| commit | 355d51770e9a6d868eab7aa5442f4c0ac08a0046 (patch) | |
| tree | ef331c1ba228ff947d0bd1b33748ea52e0d9cd37 /src/modules/m_bcrypt.cpp | |
| parent | Use InspIRCd::TimingSafeCompare in more places. (diff) | |
Fix checking bcrypt hashes.
Thanks to @lethality for reporting this.
Diffstat (limited to 'src/modules/m_bcrypt.cpp')
| -rw-r--r-- | src/modules/m_bcrypt.cpp | 5 |
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; |
