mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-24 02:13:02 -07:00
[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
This commit is contained in:
parent
5257a8bfa8
commit
088e932882
33 changed files with 675 additions and 23 deletions
|
|
@ -101,6 +101,16 @@ password=123456
|
|||
; Accept only registered users? default is false (accept unregistered users)
|
||||
regonly=false
|
||||
|
||||
[security]
|
||||
|
||||
; How strictly new authentication features are enforced. Possible values:
|
||||
; * legacy: only accept the legacy 1000-round SHA-512 password hashes;
|
||||
; * mixed: accept both legacy hashes and challenge-response authentication (default);
|
||||
; * strict: only accept challenge-response authentication from clients that support it,
|
||||
; and reject plain password submissions. Legacy accounts are migrated to PBKDF2
|
||||
; automatically on their next successful login.
|
||||
authentication_strictness=mixed
|
||||
|
||||
[users]
|
||||
|
||||
; The minimum length a username can be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue