bugfix: check candidate Main PIN with trick pins from SE2, not just settings

This commit is contained in:
scgbckbone 2025-03-24 16:30:27 +01:00 committed by doc-hex
parent e726637319
commit b6098a94e5
2 changed files with 5 additions and 1 deletions

View File

@ -28,6 +28,7 @@ This lists the new changes that have not yet been published in a normal release.
- Bugfix: Enable to restore dev backup with custom password other than 12 words format
- Bugfix: Virtual Disk auto mode ignore already signed PSBTs (with "-signed" in file name)
- Bugfix: Virtual Disk auto mode stuck on "Reading..." screen
- Bugfix: Do not allow to change Main PIN to value already used as Trick PIN even if Trick PIN is hidden
# Mk4 Specific Changes

View File

@ -299,9 +299,12 @@ class TrickPinMgmt:
def check_new_main_pin(self, pin):
# user is trying to change main PIN to new value; check for issues
# - dups bad but also: delta mode pin might not work w/ longer main true pin
# - deciding whether TP already exists must be done via comms with SE2
# as checking only self.tp is not sufficient for hidden TPs or after fast wipe
# - return error msg or None
assert isinstance(pin, str)
if pin in self.tp:
b, slot = tp.get_by_pin(pin)
if slot is not None:
return 'That PIN is already in use as a Trick PIN.'
for d_pin in self.get_deltamode_pins():