summaryrefslogtreecommitdiff
path: root/modules/database
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-10 19:46:26 +0000
committerSadie Powell <sadie@witchery.services>2024-03-10 20:46:03 +0000
commit9a984a814810306f2ca2690a0c8c25bcb1e87258 (patch)
tree5d4196b6049288a34d66624a6ae215d0e6ff4545 /modules/database
parentfb9c8950ed0fea4c981e2ea7301f5f969296a116 (diff)
Implement verify-only support for raw SHA-2 passwords.
Diffstat (limited to 'modules/database')
-rw-r--r--modules/database/db_atheme.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/database/db_atheme.cpp b/modules/database/db_atheme.cpp
index 5871605a8..3e613562b 100644
--- a/modules/database/db_atheme.cpp
+++ b/modules/database/db_atheme.cpp
@@ -428,8 +428,8 @@ private:
// pbkdf2v2 NO
// rawmd5 Converted to enc_md5
// rawsha1 Converted to enc_sha1
- // rawsha2-256 Converted to enc_sha256
- // rawsha2-512 NO
+ // rawsha2-256 Converted to enc_sha2
+ // rawsha2-512 Converted to enc_sha2
// scrypt NO
if (pass.compare(0, 18, "$anope$enc_sha256$", 18) == 0)
{
@@ -466,7 +466,10 @@ private:
nc->pass = "sha1:" + pass.substr(9);
else if (pass.compare(0, 11, "$rawsha256$", 11) == 0)
- nc->pass = "sha256:" + pass.substr(11) + ":6a09e667bb67ae853c6ef372a54ff53a510e527f9b05688c1f83d9ab5be0cd19";
+ nc->pass = "raw-sha256:" + pass.substr(11);
+
+ else if (pass.compare(0, 11, "$rawsha512$", 11) == 0)
+ nc->pass = "raw-sha512:" + pass.substr(11);
else if (pass.compare(0, 4, "$2a$", 4) == 0 || pass.compare(0, 4, "$2b$", 4) == 0)
nc->pass = "bcrypt:" + pass;