trezor: allow PIN of length 50 for T1 firmware >=1.10.0 and TT firmware >=2.4.0 (closes #8526)
This commit is contained in:
@@ -287,8 +287,15 @@ class TrezorClientBase(HardwareClientBase, Logger):
|
||||
pin = self.handler.get_pin(msg.format(self.device), show_strength=show_strength)
|
||||
if not pin:
|
||||
raise Cancelled
|
||||
if len(pin) > 9:
|
||||
self.handler.show_error(_('The PIN cannot be longer than 9 characters.'))
|
||||
# check PIN length. Depends on model and firmware version
|
||||
# https://github.com/trezor/trezor-firmware/issues/1167
|
||||
limit = 9
|
||||
if self.features.model == "1" and (1, 10, 0) <= self.client.version:
|
||||
limit = 50
|
||||
elif self.features.model == "2" and (2, 4, 0) <= self.client.version:
|
||||
limit = 50
|
||||
if len(pin) > limit:
|
||||
self.handler.show_error(_('The PIN cannot be longer than {} characters.').format(limit))
|
||||
raise Cancelled
|
||||
return pin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user