mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-03 12:00:59 +00:00
Do not lock after wipe. Fix protectPinUiCallback() to correctly display '0 seconds' when wait is 0.
This commit is contained in:
parent
d433401311
commit
247337c63d
@ -342,6 +342,7 @@ void config_init(void)
|
|||||||
// TODO Add salt.
|
// TODO Add salt.
|
||||||
storage_init(&protectPinUiCallback, (const uint8_t*)"", 0);
|
storage_init(&protectPinUiCallback, (const uint8_t*)"", 0);
|
||||||
|
|
||||||
|
// TODO Remove
|
||||||
storage_unlock(1);
|
storage_unlock(1);
|
||||||
|
|
||||||
uint16_t len = 0;
|
uint16_t len = 0;
|
||||||
@ -851,5 +852,5 @@ void config_wipe(void)
|
|||||||
data2hex(config_uuid, sizeof(config_uuid), config_uuid_str);
|
data2hex(config_uuid, sizeof(config_uuid), config_uuid_str);
|
||||||
storage_set(KEY_UUID, config_uuid, sizeof(config_uuid));
|
storage_set(KEY_UUID, config_uuid, sizeof(config_uuid));
|
||||||
storage_set(KEY_VERSION, &CONFIG_VERSION, sizeof(CONFIG_VERSION));
|
storage_set(KEY_VERSION, &CONFIG_VERSION, sizeof(CONFIG_VERSION));
|
||||||
session_clear(true);
|
session_clear(false);
|
||||||
}
|
}
|
||||||
|
@ -155,11 +155,11 @@ void protectPinUiCallback(uint32_t wait, uint32_t progress)
|
|||||||
char secstrbuf[] = _("________0 seconds");
|
char secstrbuf[] = _("________0 seconds");
|
||||||
char *secstr = secstrbuf + 9;
|
char *secstr = secstrbuf + 9;
|
||||||
uint32_t secs = wait;
|
uint32_t secs = wait;
|
||||||
while (secs > 0 && secstr >= secstrbuf) {
|
do {
|
||||||
secstr--;
|
secstr--;
|
||||||
*secstr = (secs % 10) + '0';
|
*secstr = (secs % 10) + '0';
|
||||||
secs /= 10;
|
secs /= 10;
|
||||||
}
|
} while (secs > 0 && secstr >= secstrbuf);
|
||||||
if (wait == 1) {
|
if (wait == 1) {
|
||||||
// Change "seconds" to "second".
|
// Change "seconds" to "second".
|
||||||
secstrbuf[16] = 0;
|
secstrbuf[16] = 0;
|
||||||
|
@ -153,7 +153,7 @@ static void recovery_request(void) {
|
|||||||
* Check mnemonic and send success/failure.
|
* Check mnemonic and send success/failure.
|
||||||
*/
|
*/
|
||||||
static void recovery_done(void) {
|
static void recovery_done(void) {
|
||||||
char new_mnemonic[241] = {0}; // TODO: remove constant
|
char new_mnemonic[MAX_MNEMONIC_LEN + 1] = {0};
|
||||||
|
|
||||||
strlcpy(new_mnemonic, words[0], sizeof(new_mnemonic));
|
strlcpy(new_mnemonic, words[0], sizeof(new_mnemonic));
|
||||||
for (uint32_t i = 1; i < word_count; i++) {
|
for (uint32_t i = 1; i < word_count; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user