Repository navigation
Commit 6a4c40f
committed
Reboot on the way out of a wallet session
Leaving the wallet viewer unwound back to the main menu, wiping the three
buffers show_wallet_data owns and leaving everything between there and Home
holding whatever it last held - wiped only where someone had remembered to
wipe it. The stated safety boundary is that every screen holding seed material
clears its buffers, and that boundary was being kept by a hundred-odd
individual calls and the discipline to add the next one.
Both ways out now reboot: the row, and the timeout that means the reader
walked away from a device with a seed on it. A restart re-runs C startup,
which zeroes .bss - where the address cache and the review rows live - and
leaves nothing on a stack about to be reused from the top. It is the same
seedtool_platform_restart() the main-menu timeout, a failed assertion and
__wrap_abort already use; ending a session was the one exit that did not.
The explicit wipes still run first. The reboot is the belt and they are the
braces, and the braces are what protect the buffers while a session is still
running, which the reboot cannot do at all.
The row is "Erase and restart" now, because that is what it does. It arrived
last commit as "Erase and exit" for the good reason that "Shutdown" promised a
power state the device did not enter - the same objection applies to any name
that overstates, so the name moves with the behaviour rather than ahead of it.
What this costs: brightness and orientation live only in RAM, by design, so
they return to their defaults at the end of every session. That is the trade,
stated plainly - a display preference is recoverable in two presses and a seed
is not.
Three comments describing the old unwinding are corrected rather than left to
misinform: the review-rows wipe, and the two either side of create_seed's
return value, which now only reaches its caller when the viewer never opened.
Verified with the host self-test, 49 Python tests, and a firmware build the
audit passes at 300560 bytes. Not yet walked on hardware.1 parent f9266f3 commit 6a4c40f
4 files changed
Lines changed: 42 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1266 | 1266 | | |
1267 | 1267 | | |
1268 | 1268 | | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1272 | 1274 | | |
1273 | 1275 | | |
1274 | 1276 | | |
| |||
2149 | 2151 | | |
2150 | 2152 | | |
2151 | 2153 | | |
2152 | | - | |
| 2154 | + | |
2153 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
2154 | 2169 | | |
2155 | | - | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
2156 | 2174 | | |
2157 | 2175 | | |
2158 | 2176 | | |
| |||
2538 | 2556 | | |
2539 | 2557 | | |
2540 | 2558 | | |
2541 | | - | |
2542 | | - | |
2543 | | - | |
| 2559 | + | |
| 2560 | + | |
2544 | 2561 | | |
2545 | | - | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
2546 | 2568 | | |
2547 | 2569 | | |
2548 | 2570 | | |
| |||
2643 | 2665 | | |
2644 | 2666 | | |
2645 | 2667 | | |
2646 | | - | |
2647 | | - | |
2648 | | - | |
2649 | | - | |
2650 | | - | |
2651 | | - | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
2652 | 2676 | | |
2653 | 2677 | | |
2654 | 2678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
| 489 | + | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| |||
0 commit comments