Commit 30e47f1
committed
api: add Unlock call w/ support for entering passphrase on the host
Previously, the host would unlock before the noise channel was
established using `OP_UNLOCK`, using a raw unencrypted call that is using
protobufs.
To support entering a passphrase on the host, we add a `UnlockRequest`
protobuf message. This needs to happen after the noise channel was
established because:
- we want the passphrase to be encrypted in flight
- we want to make use of protobuf and `next_request()` to query the
host
`UnlockRequest` has a flag `supports_host_passphrase`, so
wallets (especially third party apps) that do not support this yet
still work seamlessly, as without support the passphrase is simply
entered on the device.
If the host app supports it, then the device will ask the user if they
want to enter on the device or on the host.
The query to the host uses `UnlockRequestHostInfoResponse`. It
contains the `type` enum for future compatbilitiy in case we want to
add more unlock options in the future (e.g. fingerprints).
The `workflow::unlock` calls now get a callback to pick the method of
entering the passphrase, so the old `OP_UNLOCK` can use the previous
way, while `UnlockRequest` provides a callback to ask the user where
to enter and proceeds accordingly.1 parent b51b95c commit 30e47f1
File tree
20 files changed
+421
-48
lines changed- messages
- py
- bitbox02/bitbox02/communication
- generated
- src/rust
- bitbox02-rust-c/src
- bitbox02-rust/src
- hww
- api
- workflow
- bitbox02/src/ui
20 files changed
+421
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
| 94 | + | |
92 | 95 | | |
93 | 96 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
Lines changed: 59 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
265 | 267 | | |
266 | 268 | | |
267 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
268 | 279 | | |
269 | 280 | | |
270 | 281 | | |
| |||
525 | 536 | | |
526 | 537 | | |
527 | 538 | | |
528 | | - | |
| 539 | + | |
529 | 540 | | |
530 | 541 | | |
531 | 542 | | |
532 | 543 | | |
533 | 544 | | |
| 545 | + | |
534 | 546 | | |
535 | 547 | | |
536 | 548 | | |
| |||
577 | 589 | | |
578 | 590 | | |
579 | 591 | | |
580 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
581 | 595 | | |
582 | 596 | | |
| 597 | + | |
| 598 | + | |
583 | 599 | | |
584 | 600 | | |
585 | 601 | | |
| |||
658 | 674 | | |
659 | 675 | | |
660 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
661 | 718 | | |
662 | 719 | | |
663 | 720 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments