fix(security): don't penalise a correct PIN after a passphrase change
A passphrase change left the PIN vault sealing the old passphrase. The next PIN unlock opened the vault, walletpassphrase answered RPC -14, and the generic catch ran the lockout curve on a correct PIN, while Settings kept showing the PIN as active. - Passphrase change: when the active wallet's vault exists at completion (same vault path as at dispatch, passphrase actually changed), the vault is marked out of date for the session and kept on disk: PIN entry is no longer offered, a warning toast says so, and Settings shows "PIN out of date" with a tooltip on how to fix it. The Change Passphrase dialog notes beforehand that a PIN will go out of date. - PIN unlock: RPC -14 after the vault opened is treated as "PIN out of date": passphrase entry, a message, no attempt counted, no lockout, and the vault is not deleted (-14 is only the daemon's answer; the vault may hold the only copy of a passphrase that opens an older backup). After a restart Settings shows the PIN as active until the first PIN attempt. - A malformed vault (zero-filled by a removeVault() whose unlink failed, truncated, unknown version) is treated as missing: passphrase entry, "PIN file unreadable", no penalty. New SecureVault::isWellFormed(). - Race guards: Set/Change/Remove PIN are disabled while a passphrase change runs, and Change Passphrase while a PIN operation runs. - Setting or removing the PIN, or switching wallets, clears the mark; setting a PIN offers PIN entry again. Change PIN keeps the mark (the vault still seals the same passphrase). - Pure decisions in data/pin_vault_policy.h, unit-tested. New strings in all 8 languages. No vault, wallet or settings format change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -237,6 +237,7 @@
|
||||
"change_pass_confirm": "Confirmar nova:",
|
||||
"change_pass_current": "Senha atual:",
|
||||
"change_pass_new": "Nova senha:",
|
||||
"change_pass_pin_note": "Esta carteira tem um PIN de desbloqueio rápido. Após a alteração ele ficará desatualizado: remova o PIN em Ajustes e defina-o novamente.",
|
||||
"change_pass_title": "Alterar senha",
|
||||
"characters": "caracteres",
|
||||
"chat": "Chat",
|
||||
@@ -1688,10 +1689,13 @@
|
||||
"sec_mode_passphrase": " Frase-senha",
|
||||
"sec_not_connected_to_daemon": "Não conectado ao daemon",
|
||||
"sec_not_connected_to_daemon_pin": "Não conectado ao daemon",
|
||||
"sec_passphrase_changed_pin_stale": "Frase-senha alterada; seu PIN está desatualizado",
|
||||
"sec_passphrase_changed_successfully": "Frase-senha alterada com sucesso",
|
||||
"sec_pin_changed_successfully": "PIN alterado com sucesso",
|
||||
"sec_pin_removed": "PIN removido",
|
||||
"sec_pin_set_successfully": "PIN definido com sucesso",
|
||||
"sec_pin_stale_msg": "PIN desatualizado. Use sua frase-senha.",
|
||||
"sec_pin_unreadable": "Arquivo do PIN ilegível. Use sua frase-senha.",
|
||||
"sec_restart_daemon_for_encryption": "Reinicie o daemon para que a criptografia entre em vigor.",
|
||||
"sec_too_many_attempts_wait": "Tentativas em excesso. Aguarde %.0f segundos...",
|
||||
"sec_total_elapsed_fmt": "Tempo total: %dm %02ds",
|
||||
@@ -1840,6 +1844,7 @@
|
||||
"settings_open_log_folder": "Abrir pasta de logs",
|
||||
"settings_other": "Outros",
|
||||
"settings_pin_active": "PIN",
|
||||
"settings_pin_out_of_date": "PIN desatualizado",
|
||||
"settings_privacy": "Privacidade",
|
||||
"settings_quick_unlock_pin": "PIN de desbloqueio rápido",
|
||||
"settings_reduce_transparency": "Reduzir transparência",
|
||||
@@ -2097,6 +2102,7 @@
|
||||
"tt_open_data_dir": "Abrir a pasta com os dados da sua carteira e da blockchain no gerenciador de arquivos",
|
||||
"tt_open_dir": "Clique para abrir no explorador de arquivos",
|
||||
"tt_open_log_folder": "Abre a pasta que contém os logs de depuração e de falhas",
|
||||
"tt_pin_out_of_date": "A frase-senha da carteira mudou depois que este PIN foi definido, então o PIN não consegue mais desbloqueá-la. Remova o PIN e defina-o novamente.",
|
||||
"tt_reduce_motion": "Desativar transições animadas e lerp de saldo para acessibilidade",
|
||||
"tt_remove_encrypt": "Remover encriptação e armazenar a carteira desprotegida",
|
||||
"tt_remove_pin": "Remover PIN e exigir frase secreta para desbloquear",
|
||||
|
||||
Reference in New Issue
Block a user