Derive registration credentials off-thread; rate-limit REGISTER; constant-time SCRAM compare

This commit is contained in:
Jean Chevronnet 2026-07-12 02:31:52 +00:00
parent 496c0f99a6
commit 9a918839fe
No known key found for this signature in database
10 changed files with 214 additions and 36 deletions

View file

@ -35,6 +35,19 @@ pub enum NetAction {
// advertised SASL mechanism list), otherwise a user uid (e.g. their account).
Metadata { target: String, key: String, value: String },
Raw(String),
// Internal only, never serialized to the wire: a registration whose password
// still needs its (expensive) key derivation. The link layer runs the
// derivation off-thread, then calls Engine::complete_register.
DeferRegister { account: String, password: String, email: Option<String>, reply: RegReply },
}
// How to answer a registration once its credentials have been derived.
#[derive(Debug, Clone)]
pub enum RegReply {
// IRCv3 account-registration relay: answer the requesting ircd.
Relay { reqid: String, kind: String },
// NickServ REGISTER: NOTICE the requesting user, logging them in on success.
NickServ { agent: String, uid: String, nick: String },
}
pub trait Protocol: Send {