Commit 51d7cd1
committed
test(reset): gate the dice tests on Features.supports_dice_modes; fix the driver
Findings from an adversarial review of the unit, all confirmed against the
firmware's own font tables and message pump:
- The full 32-byte digest wraps to two constant-power subpages, and under
DEBUG_LINK each subpage after a debug decision raises its own ButtonRequest.
The driver acked once and asserted EntropyRequest, so both verifiability
tests would have failed before proving anything. It now holds through every
digest page, as the backup-word loop already did.
- _inject_rolls diverged from dice_input_collect() once the target was reached:
the device stops consuming a chunk at that point, undo included, and leaves
the roll screen, so a later chunk would arrive at the digest confirm as a
"no" decision. The host simulation now mirrors that exactly and stops
sending.
- The dice tests were gated on a version. Firmware without the unit skips the
unknown dice_only field and runs the older ceremony, so a version gate fails
red on such a build -- and a host on the same signal would derive a
different wallet without complaint. A Features.supports_dice_modes
capability now gates both (requires_dice_modes(), after requires_taproot).
Adds tests for the two refusals the review asked for -- dice with no_backup,
and Cancel at the consent screen leaving nothing armed -- and catalogues all
six dice tests in the report atlas in place of the renamed original, with
screen lists matching what each captures.
Bindings regenerated inside kktech/firmware:v8 from device-protocol
feat/dice-only-field @ fbaf8ec (adds Features.supports_dice_modes = 28).1 parent c0e9bd8 commit 51d7cd1
5 files changed
Lines changed: 269 additions & 159 deletions
File tree
- keepkeylib
- scripts
- tests
Submodule device-protocol updated 1 file
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
835 | 866 | | |
836 | 867 | | |
837 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
177 | 190 | | |
178 | 191 | | |
179 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
211 | 215 | | |
| 216 | + | |
| 217 | + | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
215 | | - | |
| 221 | + | |
216 | 222 | | |
217 | 223 | | |
218 | 224 | | |
| 225 | + | |
| 226 | + | |
219 | 227 | | |
220 | 228 | | |
221 | 229 | | |
| |||
279 | 287 | | |
280 | 288 | | |
281 | 289 | | |
282 | | - | |
283 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
284 | 299 | | |
285 | 300 | | |
286 | 301 | | |
| |||
306 | 321 | | |
307 | 322 | | |
308 | 323 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 324 | + | |
312 | 325 | | |
313 | 326 | | |
314 | 327 | | |
| |||
332 | 345 | | |
333 | 346 | | |
334 | 347 | | |
335 | | - | |
| 348 | + | |
336 | 349 | | |
337 | 350 | | |
338 | 351 | | |
| |||
351 | 364 | | |
352 | 365 | | |
353 | 366 | | |
354 | | - | |
| 367 | + | |
355 | 368 | | |
356 | 369 | | |
357 | 370 | | |
| |||
382 | 395 | | |
383 | 396 | | |
384 | 397 | | |
385 | | - | |
| 398 | + | |
386 | 399 | | |
387 | 400 | | |
388 | 401 | | |
| |||
398 | 411 | | |
399 | 412 | | |
400 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
401 | 460 | | |
402 | 461 | | |
403 | 462 | | |
| |||
0 commit comments