From c964ff702d64dd834d20c607756fbe0995a4a7e5 Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 8 Jul 2020 11:17:57 +0200 Subject: [PATCH] python: disallow setting auto-lock without PIN --- python/CHANGELOG.md | 5 +++++ python/src/trezorlib/cli/settings.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/python/CHANGELOG.md b/python/CHANGELOG.md index 6112f77ad..8f53aefa7 100644 --- a/python/CHANGELOG.md +++ b/python/CHANGELOG.md @@ -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] diff --git a/python/src/trezorlib/cli/settings.py b/python/src/trezorlib/cli/settings.py index 8e31e88d6..9f0e0237a 100644 --- a/python/src/trezorlib/cli/settings.py +++ b/python/src/trezorlib/cli/settings.py @@ -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: