sasl: advertise and relay ECDSA-NIST256P-CHALLENGE
This commit is contained in:
parent
dfbe8e8c4a
commit
ed58813ea5
2 changed files with 9 additions and 6 deletions
|
|
@ -335,6 +335,7 @@ impl Command for Authenticate {
|
||||||
CmdResult::Ok
|
CmdResult::Ok
|
||||||
} else if arg.eq_ignore_ascii_case("PLAIN")
|
} else if arg.eq_ignore_ascii_case("PLAIN")
|
||||||
|| arg.eq_ignore_ascii_case("SCRAM-SHA-256")
|
|| arg.eq_ignore_ascii_case("SCRAM-SHA-256")
|
||||||
|
|| arg.eq_ignore_ascii_case("ECDSA-NIST256P-CHALLENGE")
|
||||||
{
|
{
|
||||||
if !have_services {
|
if !have_services {
|
||||||
s.numeric(
|
s.numeric(
|
||||||
|
|
@ -344,12 +345,14 @@ impl Command for Authenticate {
|
||||||
);
|
);
|
||||||
return CmdResult::Fail;
|
return CmdResult::Fail;
|
||||||
}
|
}
|
||||||
// SCRAM is challenge-response, so the password never crosses the wire —
|
// SCRAM and ECDSA are challenge-response, so the password/key never
|
||||||
// it's fine to offer over plaintext too. The rounds relay mech-agnostically.
|
// crosses the wire — fine over plaintext too. Rounds relay mech-agnostically.
|
||||||
let mech = if arg.eq_ignore_ascii_case("PLAIN") {
|
let mech = if arg.eq_ignore_ascii_case("PLAIN") {
|
||||||
"PLAIN"
|
"PLAIN"
|
||||||
} else {
|
} else if arg.eq_ignore_ascii_case("SCRAM-SHA-256") {
|
||||||
"SCRAM-SHA-256"
|
"SCRAM-SHA-256"
|
||||||
|
} else {
|
||||||
|
"ECDSA-NIST256P-CHALLENGE"
|
||||||
};
|
};
|
||||||
if let Some(u) = s.users.get_mut(&uid) {
|
if let Some(u) = s.users.get_mut(&uid) {
|
||||||
u.sasl_mech = Some(mech.to_string());
|
u.sasl_mech = Some(mech.to_string());
|
||||||
|
|
@ -382,7 +385,7 @@ impl Command for Authenticate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
s.numeric(uid, RPL_SASLMECHS, "PLAIN,SCRAM-SHA-256 :are available SASL mechanisms");
|
s.numeric(uid, RPL_SASLMECHS, "PLAIN,SCRAM-SHA-256,ECDSA-NIST256P-CHALLENGE :are available SASL mechanisms");
|
||||||
s.numeric(uid, ERR_SASLFAIL, ":Unsupported SASL mechanism");
|
s.numeric(uid, ERR_SASLFAIL, ":Unsupported SASL mechanism");
|
||||||
CmdResult::Fail
|
CmdResult::Fail
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -194,9 +194,9 @@ impl Caps {
|
||||||
.map(|c| {
|
.map(|c| {
|
||||||
if *c == "sasl" && cap302 {
|
if *c == "sasl" && cap302 {
|
||||||
if secure {
|
if secure {
|
||||||
"sasl=PLAIN,EXTERNAL,SCRAM-SHA-256".to_string()
|
"sasl=PLAIN,EXTERNAL,SCRAM-SHA-256,ECDSA-NIST256P-CHALLENGE".to_string()
|
||||||
} else {
|
} else {
|
||||||
"sasl=PLAIN,SCRAM-SHA-256".to_string()
|
"sasl=PLAIN,SCRAM-SHA-256,ECDSA-NIST256P-CHALLENGE".to_string()
|
||||||
}
|
}
|
||||||
} else if *c == "draft/multiline" && cap302 {
|
} else if *c == "draft/multiline" && cap302 {
|
||||||
format!("draft/multiline=max-bytes={mline_bytes},max-lines={mline_lines}")
|
format!("draft/multiline=max-bytes={mline_bytes},max-lines={mline_lines}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue