From f05664fdf30239f1715bb081e14c2f30d7a10ee7 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Sat, 23 Feb 2019 03:20:34 +0100 Subject: [PATCH] config: Avoid unlocking storage after wipe. --- firmware/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/firmware/config.c b/firmware/config.c index b3b6df500a..f631b8e24e 100644 --- a/firmware/config.c +++ b/firmware/config.c @@ -908,7 +908,9 @@ void config_setAutoLockDelayMs(uint32_t auto_lock_delay_ms) void config_wipe(void) { storage_wipe(); - storage_unlock(PIN_EMPTY); + if (storage_is_unlocked() != sectrue) { + storage_unlock(PIN_EMPTY); + } random_buffer((uint8_t *)config_uuid, sizeof(config_uuid)); data2hex(config_uuid, sizeof(config_uuid), config_uuid_str); autoLockDelayMsCached = secfalse;