modules: port password_hash (md5/sha1/sha2/pbkdf2 + MKPASSWD, hashed OPER) and hashident

This commit is contained in:
Jean Chevronnet 2026-08-09 11:40:17 +00:00
parent dc22dcd072
commit c71c28457f
4 changed files with 300 additions and 1 deletions

View file

@ -121,7 +121,10 @@ impl Command for Oper {
}
fn handle(&self, s: &mut Server, uid: Uid, params: &[String]) -> CmdResult {
let (name, pass) = (&params[0], &params[1]);
if s.opers.iter().any(|(n, p)| n == name && p == pass) {
if s.opers
.iter()
.any(|(n, p)| n == name && crate::modules::password_hash::verify(p, pass))
{
s.oper_up(uid);
CmdResult::Ok
} else {