1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

fix(legacy): increase minimum auto-lock delay to 1 minute

This commit is contained in:
Martin Milata 2020-11-18 19:06:39 +01:00 committed by Pavol Rusnak
parent 93d45f1aba
commit 480332b803
2 changed files with 7 additions and 1 deletions

View File

@ -962,6 +962,7 @@ uint32_t config_getAutoLockDelayMs() {
if (sectrue != config_get_uint32(KEY_AUTO_LOCK_DELAY_MS, &autoLockDelayMs)) {
autoLockDelayMs = autoLockDelayMsDefault;
}
autoLockDelayMs = MAX(autoLockDelayMs, MIN_AUTOLOCK_DELAY_MS);
autoLockDelayMsCached = sectrue;
return autoLockDelayMs;
}

View File

@ -85,8 +85,13 @@ extern Storage configUpdate;
#define MAX_MNEMONIC_LEN 240
#define HOMESCREEN_SIZE 1024
#define UUID_SIZE 12
#if DEBUG_LINK
#define MIN_AUTOLOCK_DELAY_MS (10 * 1000U) // 10 seconds
#define MAX_AUTOLOCK_DELAY_MS 0x20000000U // ~6 days
#else
#define MIN_AUTOLOCK_DELAY_MS (60 * 1000U) // 1 minute
#endif
#define MAX_AUTOLOCK_DELAY_MS 0x20000000U // ~6 days
void config_init(void);
void session_clear(bool lock);