Do not lock after wipe. Fix protectPinUiCallback() to correctly display '0 seconds' when wait is 0.

pull/25/head
andrew 5 years ago committed by Pavol Rusnak
parent d433401311
commit 247337c63d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -342,6 +342,7 @@ void config_init(void)
// TODO Add salt.
storage_init(&protectPinUiCallback, (const uint8_t*)"", 0);
// TODO Remove
storage_unlock(1);
uint16_t len = 0;
@ -851,5 +852,5 @@ void config_wipe(void)
data2hex(config_uuid, sizeof(config_uuid), config_uuid_str);
storage_set(KEY_UUID, config_uuid, sizeof(config_uuid));
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 *secstr = secstrbuf + 9;
uint32_t secs = wait;
while (secs > 0 && secstr >= secstrbuf) {
do {
secstr--;
*secstr = (secs % 10) + '0';
secs /= 10;
}
} while (secs > 0 && secstr >= secstrbuf);
if (wait == 1) {
// Change "seconds" to "second".
secstrbuf[16] = 0;

@ -153,7 +153,7 @@ static void recovery_request(void) {
* Check mnemonic and send success/failure.
*/
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));
for (uint32_t i = 1; i < word_count; i++) {

Loading…
Cancel
Save