From 9a8cac060d60aee638e368e96afb46967d6d8190 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 10 Mar 2024 14:50:56 +0000 Subject: Add support for encrypting passwords with the Argon2 algorithm. Closes #369. --- modules/database/db_atheme.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'modules/database') diff --git a/modules/database/db_atheme.cpp b/modules/database/db_atheme.cpp index d3877b625..5871605a8 100644 --- a/modules/database/db_atheme.cpp +++ b/modules/database/db_atheme.cpp @@ -416,7 +416,7 @@ private: // some of them currently. // // anope-enc-sha256 Converted to enc_sha256 - // argon2 NO + // argon2 Converted to enc_argon2 // base64 Converted to the first encryption algorithm // bcrypt Converted to enc_bcrypt // crypt3-des NO @@ -440,6 +440,15 @@ private: nc->pass = "sha256:" + Anope::Hex(pass) + ":" + Anope::Hex(iv); } + else if (pass.compare(0, 9, "$argon2d$", 9) == 0) + nc->pass = "argon2d:" + pass; + + else if (pass.compare(0, 9, "$argon2i$", 9) == 0) + nc->pass = "argon2i:" + pass; + + else if (pass.compare(0, 10, "$argon2id$", 10) == 0) + nc->pass = "argon2id:" + pass; + else if (pass.compare(0, 8, "$base64$", 8) == 0) { Anope::string rawpass; -- cgit