summaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-10 14:50:56 +0000
committerSadie Powell <sadie@witchery.services>2024-03-10 15:09:38 +0000
commit9a8cac060d60aee638e368e96afb46967d6d8190 (patch)
tree32365ea7ebb3e255907e352fcf867877ab9cd6a9 /include/modules
parent0353338436141cd27cebd776cbc74e568e801ffe (diff)
Add support for encrypting passwords with the Argon2 algorithm.
Closes #369.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/encryption.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/modules/encryption.h b/include/modules/encryption.h
index 0eec23ec3..71d35044a 100644
--- a/include/modules/encryption.h
+++ b/include/modules/encryption.h
@@ -63,6 +63,12 @@ namespace Encryption
virtual ~Provider() = default;
+ /** Checks whether a plain text value matches a hash created by this provider. */
+ virtual bool Compare(const Anope::string &hash, const Anope::string &plain)
+ {
+ return hash.equals_cs(plain);
+ }
+
/** Creates a new encryption context. */
virtual std::unique_ptr<Context> CreateContext() = 0;