1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 05:03:07 +00:00

python: disallow setting auto-lock without PIN

This commit is contained in:
matejcik 2020-07-08 11:17:57 +02:00 committed by matejcik
parent 051763575d
commit c964ff702d
2 changed files with 9 additions and 0 deletions

View File

@ -9,6 +9,11 @@ _At the moment, the project does **not** adhere to [Semantic Versioning](https:/
## [0.12.1] - unreleased
[0.12.1]: https://github.com/trezor/trezor-firmware/compare/python/v0.12.0...master
### Changed
- do not allow setting auto-lock delay unless PIN is configured
### Fixed
- correctly calculate hashes for very small firmwares [f#1082]

View File

@ -75,6 +75,10 @@ def display_rotation(client, rotation):
@with_client
def auto_lock_delay(client, delay):
"""Set auto-lock delay (in seconds)."""
if not client.features.pin_protection:
raise click.ClickException("Set up a PIN first")
value, unit = delay[:-1], delay[-1:]
units = {"s": 1, "m": 60, "h": 3600}
if unit in units: