From 69fa5acf8b5a2a9fddf49f3a29cade50c7c04cdc Mon Sep 17 00:00:00 2001 From: chren Date: Tue, 27 Sep 2016 16:43:32 +0200 Subject: [PATCH] limit pin length --- src/trezor/ui/pin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/trezor/ui/pin.py b/src/trezor/ui/pin.py index be4c9c2063..0b9a073fc5 100644 --- a/src/trezor/ui/pin.py +++ b/src/trezor/ui/pin.py @@ -35,7 +35,7 @@ class PinMatrix(): header = '*' * len(self.pin) if self.pin else self.label # clear canvas under input line - display.bar(48, 0, 144, 48, ui.BLACK) + display.bar(0, 0, 205, 48, ui.BLACK) # input line with a header display.text_center(120, 30, header, ui.BOLD, ui.GREY, ui.BLACK) @@ -63,4 +63,5 @@ class PinMatrix(): self.pin = '' for btn in self.pin_buttons: if btn.send(event, pos) == BTN_CLICKED: - self.pin += btn.content + if len(self.pin) < 9: + self.pin += btn.content