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": "确认新密码:",
|
||||
"change_pass_current": "当前密码短语:",
|
||||
"change_pass_new": "新密码短语:",
|
||||
"change_pass_pin_note": "此钱包设有快速解锁 PIN。更改后它将过时:请在设置中移除 PIN 并重新设置。",
|
||||
"change_pass_title": "更改密码短语",
|
||||
"characters": "字符",
|
||||
"chat": "聊天",
|
||||
@@ -1688,10 +1689,13 @@
|
||||
"sec_mode_passphrase": " 密码短语",
|
||||
"sec_not_connected_to_daemon": "未连接到守护进程",
|
||||
"sec_not_connected_to_daemon_pin": "未连接到守护进程",
|
||||
"sec_passphrase_changed_pin_stale": "密码短语已更改;PIN 已过时",
|
||||
"sec_passphrase_changed_successfully": "密码短语更改成功",
|
||||
"sec_pin_changed_successfully": "PIN 更改成功",
|
||||
"sec_pin_removed": "PIN 已移除",
|
||||
"sec_pin_set_successfully": "PIN 设置成功",
|
||||
"sec_pin_stale_msg": "PIN 已过时。请使用密码短语。",
|
||||
"sec_pin_unreadable": "无法读取 PIN 文件。请使用密码短语。",
|
||||
"sec_restart_daemon_for_encryption": "请重启守护进程以使加密生效。",
|
||||
"sec_too_many_attempts_wait": "尝试次数过多。请等待 %.0f 秒…",
|
||||
"sec_total_elapsed_fmt": "总耗时:%d 分 %02d 秒",
|
||||
@@ -1840,6 +1844,7 @@
|
||||
"settings_open_log_folder": "打开日志文件夹",
|
||||
"settings_other": "其他",
|
||||
"settings_pin_active": "PIN",
|
||||
"settings_pin_out_of_date": "PIN 已过时",
|
||||
"settings_privacy": "隐私",
|
||||
"settings_quick_unlock_pin": "快速解锁 PIN",
|
||||
"settings_reduce_transparency": "降低透明度",
|
||||
@@ -2097,6 +2102,7 @@
|
||||
"tt_open_data_dir": "在文件管理器中打开包含您钱包和区块链数据的文件夹",
|
||||
"tt_open_dir": "点击在文件管理器中打开",
|
||||
"tt_open_log_folder": "打开包含调试和崩溃日志的文件夹",
|
||||
"tt_pin_out_of_date": "设置此 PIN 后钱包密码短语已更改,因此该 PIN 无法再解锁钱包。请移除 PIN 并重新设置。",
|
||||
"tt_reduce_motion": "禁用动画过渡和余额渐变以提高无障碍性",
|
||||
"tt_remove_encrypt": "移除加密并以未受保护状态存储钱包",
|
||||
"tt_remove_pin": "移除 PIN 并要求密码解锁",
|
||||
|
||||
Reference in New Issue
Block a user