Skip to content

Commit 22807a8

Browse files
committed
Merge branch 'fixes'
2 parents 75eb13a + 099d531 commit 22807a8

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/reset.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222

2323
void reset_reset(void)
2424
{
25-
if (!memory_reset_hww()) {
26-
Abort("Could not reset memory.");
27-
}
2825
#ifndef TESTING
2926
if (!securechip_update_keys()) {
3027
Abort("Could not reset secure chip.");
3128
}
3229
#endif
30+
if (!memory_reset_hww()) {
31+
Abort("Could not reset memory.");
32+
}
3333
}

src/workflow/unlock.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,16 @@ static void _enter(void)
106106
static void _workflow_unlock(void)
107107
{
108108
// "Enter password"
109+
ui_screen_stack_pop_all();
109110
ui_screen_stack_push(entry_screen_create("Enter password", _enter));
110111
}
111112

113+
static void _start(void)
114+
{
115+
_done = true;
116+
workflow_start();
117+
}
118+
112119
void workflow_unlock_enter_done(const char* password)
113120
{
114121
uint8_t remaining_attempts = 0;
@@ -134,8 +141,7 @@ void workflow_unlock_enter_done(const char* password)
134141
}
135142
case KEYSTORE_ERR_MAX_ATTEMPTS_EXCEEDED:
136143
reset_reset();
137-
ui_screen_stack_switch(
138-
status_create("Device reset", false, STATUS_DEFAULT_DELAY, workflow_start));
144+
ui_screen_stack_switch(status_create("Device reset", false, STATUS_DEFAULT_DELAY, _start));
139145
break;
140146
default:
141147
Abort("keystore unlock failed");
@@ -149,7 +155,6 @@ void workflow_unlock(void)
149155
return;
150156
}
151157
_done = false;
152-
ui_screen_stack_pop_all();
153158
_workflow_unlock();
154159
ui_screen_process(_is_done);
155160
ui_screen_stack_pop();

0 commit comments

Comments
 (0)