summaryrefslogtreecommitdiff
path: root/modules/database/db_atheme.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-18 22:07:31 +0000
committerSadie Powell <sadie@witchery.services>2024-03-18 22:17:14 +0000
commit5a72d8783ec5ac12d0a0c33e0b4f7e928a51157b (patch)
treed2428715124f6a077f635143e9ee56b16e57323b /modules/database/db_atheme.cpp
parente6770bc2fd090ea60751a66492912b953e2979f8 (diff)
Add verify-only support for POSIX crypt() hashes from Atheme.
Diffstat (limited to 'modules/database/db_atheme.cpp')
-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 c0a628bfd..ca53e955b 100644
--- a/modules/database/db_atheme.cpp
+++ b/modules/database/db_atheme.cpp
@@ -411,9 +411,9 @@ private:
// base64 Converted to the first encryption algorithm
// bcrypt Converted to enc_bcrypt
// crypt3-des NO
- // crypt3-md5 NO
- // crypt3-sha2-256 NO
- // crypt3-sha2-512 NO
+ // crypt3-md5 Converted to enc_posix
+ // crypt3-sha2-256 Converted to enc_posix
+ // crypt3-sha2-512 Converted to enc_posix
// ircservices Converted to enc_old
// pbkdf2 NO
// pbkdf2v2 NO
@@ -462,6 +462,9 @@ private:
else if (pass.compare(0, 11, "$rawsha512$", 11) == 0)
nc->pass = "raw-sha512:" + pass.substr(11);
+ else if (pass.compare(0, 3, "$1$", 3) == 0 || pass.compare(0, 3, "$5", 3) == 0 || pass.compare(0, 3, "$6", 3) == 0)
+ nc->pass = "posix:" + pass;
+
else if (pass.compare(0, 4, "$2a$", 4) == 0 || pass.compare(0, 4, "$2b$", 4) == 0)
nc->pass = "bcrypt:" + pass;