trezor / trezor-core

:lock: Don't use this repo, use the new monorepo instead:
https://github.com/trezor/trezor-firmware
GNU General Public License v3.0
353 stars 204 forks source link

Flickering screen during PIN verification #495

Closed 1000101 closed 5 years ago

1000101 commented 5 years ago

Screen is flickering while the progressbar circle is empty. After the first line of the circle is rendered, the flickering stops. It becomes clearly visible at 10th attempt

https://streamable.com/n7r1x

prusnak commented 5 years ago

The problem is here: https://github.com/trezor/trezor-core/blob/d86abc473f935a91ee7fd33411220bcdc2a19b6d/src/trezor/pin.py#L9

If show_pin_timeout is called with progress == 0 the screen is cleared.

If timeout is bigger than 1000 seconds, show_pin_timeout is called with progress == 0 multiple times, each time performing a clear screen.

Not sure what is the easiest solution to this. Quick hack would be that show_pin_timeout remembers last value of progress and this is compared on each call. Clear screen is performed only if progress == 0 and last_progress != progress.

@jpochyla what do you think?

tsusanka commented 5 years ago

Ping @jpochyla . Or have you discussed this in person?

jpochyla commented 5 years ago

Possible fix in 7533409

prusnak commented 5 years ago

Seems like a good fix!

Can we prepare a firmware with the commit and try entering PIN on the device incorrectly 10 times? (essentialy when we need to wait for more than 1000 seconds, ideally at least 8000 seconds)

tsusanka commented 5 years ago

LGTM. The screen does not flicker after 10th try. Branch master c55b6553.

Videos: https://streamable.com/6hy4v http://streamable.com/lwq0e