modules: port password_hash (md5/sha1/sha2/pbkdf2 + MKPASSWD, hashed OPER) and hashident
This commit is contained in:
parent
dc22dcd072
commit
c71c28457f
4 changed files with 300 additions and 1 deletions
|
|
@ -121,7 +121,10 @@ impl Command for Oper {
|
|||
}
|
||||
fn handle(&self, s: &mut Server, uid: Uid, params: &[String]) -> CmdResult {
|
||||
let (name, pass) = (¶ms[0], ¶ms[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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue