From 5a72d8783ec5ac12d0a0c33e0b4f7e928a51157b Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 18 Mar 2024 22:07:31 +0000 Subject: Add verify-only support for POSIX crypt() hashes from Atheme. --- modules/database/db_atheme.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'modules/database') 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; -- cgit