[Security] Add challenge-response auth with scrypt verifiers and stop storing plaintext passwords

Challenge-response authentication: the client derives a scrypt verifier
(RFC 7914, EVP_PBE_scrypt, N=32768, r=8, p=1) and authenticates with
HMAC-SHA256(key, nonce), so neither the password nor its hash is
transmitted. The stored format becomes
"$scrypt$<n>$<r>$<p>$<salt>$<verifier>" and Response_PasswordSalt
now carries the cost parameters. Strict servers only accept scrypt
verifiers; legacy accounts are migrated after a successful login.

Fix #344 for challenge-response servers: a saved profile stores the
derived verifier under the password key instead of the plaintext password.
The connect dialog loads it without revealing it, autoconnect passes it
through, the change-password dialog no longer prefills the old password
field with it, and the client only persists the verifier when
"Save password" is checked.

Took 3 minutes

Took 1 minute

Took 10 seconds

Took 7 minutes
This commit is contained in:
Lukas Brübach 2026-08-04 11:36:10 +02:00 • committed by BruebachL
parent d6fbfb32a1
commit 7a3067d4a8
33 changed files with 834 additions and 30 deletions

View file

@ -28,6 +28,7 @@ message SessionCommand {
FORGOT_PASSWORD_CHALLENGE = 1023;
REQUEST_PASSWORD_SALT = 1024;
SET_CARD_ART_PARAMS = 1025;
SUBMIT_PASSWORD_VERIFIER = 1026;
REPLAY_LIST = 1100;
REPLAY_DOWNLOAD = 1101;
REPLAY_MODIFY_MATCH = 1102;
@ -223,3 +224,14 @@ message Command_SetCardArtParams {
optional double vertical_offset = 5;
optional double zoom = 6;
}
// Client uploads the new password verifier to migrate a legacy account
// after a successful challenge-response login. Idempotent; only applies
// to accounts still using the legacy password format.
message Command_SubmitPasswordVerifier {
extend SessionCommand {
optional Command_SubmitPasswordVerifier ext = 1026;
}
// Full verifier string to store, e.g. "$scrypt$32768$8$1$<salt>$<verifier>"
required string password_verifier = 1;
}