mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 10:05:10 -07:00
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
19 lines
723 B
Protocol Buffer
19 lines
723 B
Protocol Buffer
syntax = "proto2";
|
|
import "response.proto";
|
|
|
|
message Response_PasswordSalt {
|
|
extend Response {
|
|
optional Response_PasswordSalt ext = 1017;
|
|
}
|
|
optional string password_salt = 1;
|
|
// scrypt cost parameters for password_salt. Absent/zero for legacy accounts.
|
|
optional int32 n = 2;
|
|
optional int32 r = 3;
|
|
optional int32 p = 4;
|
|
// Server-generated challenge. When present the client must authenticate
|
|
// with a challenge-response instead of transmitting the password hash.
|
|
optional bytes nonce = 5;
|
|
// True when the account still uses the legacy password format and should
|
|
// be migrated to the scrypt format after a successful login.
|
|
optional bool needs_migration = 6;
|
|
}
|