Add SASL SCRAM-SHA-256 and SCRAM-SHA-512

This commit is contained in:
Jean Chevronnet 2026-07-12 01:34:53 +00:00
parent 172e50c748
commit 496c0f99a6
No known key found for this signature in database
8 changed files with 569 additions and 58 deletions

View file

@ -20,12 +20,21 @@ pub struct Server {
pub description: String,
#[serde(default = "default_protocol")]
pub protocol: u32,
// PBKDF2 cost baked into new SCRAM verifiers at registration. High by
// default for offline-attack resistance; lower it if registration latency
// on the single-threaded link matters more than verifier strength.
#[serde(default = "default_scram_iterations")]
pub scram_iterations: u32,
}
fn default_protocol() -> u32 {
1206 // InspIRCd 4 spanning-tree protocol (1205 = insp3)
}
fn default_scram_iterations() -> u32 {
crate::engine::scram::DEFAULT_ITERATIONS
}
impl Config {
pub fn load(path: &str) -> anyhow::Result<Self> {
let raw = std::fs::read_to_string(path)?;