Commit graph

10340 commits

Author SHA1 Message Date
bunnie
0a4702d6c3 clean up dialog messages to conform to the latest lexicon 2022-07-19 16:30:00 +08:00
bunnie
9fc74e3291 strip out debug info 2022-07-19 15:56:16 +08:00
bunnie
4a9af7b220 add churn function to the PDDB command list 2022-07-19 15:32:07 +08:00
bunnie
6ea88dedee fix hosted mode 2022-07-19 05:28:32 +08:00
bunnie
7ad418be7c fix bug where RestoreDna backup op fails to be set. 2022-07-19 05:26:48 +08:00
bunnie
4ead1010cd add retry flow to restore; fix salt bug
salt was reading from the wrong location on a device that
previously was initialized but doing a restore to.
2022-07-19 05:07:22 +08:00
bunnie
7b3c928429 whoops, a debug statement is leaking private info. nuke that. 2022-07-19 04:45:07 +08:00
bunnie
d68e3c229d add "gutter" server for status thread so it doesn't block during autoupdates
this properly solves the issue of the keypress machine sending
notifications to a status thread that's not running: it creates
a dummy server that can drain the queue until the status thread
is ready to run properly.
2022-07-19 04:39:00 +08:00
bunnie
5e9e078f8a remove debug info that can leak password data 2022-07-19 04:38:46 +08:00
bunnie
907ac038ff make keyboard observer send messages falliable
this is a partial work around for the status server queue
overflow problem on boot while handling user interactions
in the auto-update flow.
2022-07-19 04:08:39 +08:00
bunnie
93ebdbcc4f Merge branch 'backups' into main 2022-07-19 03:18:31 +08:00
bunnie
645291f8eb add rekey test feature as a comment-option in run 2022-07-19 03:18:01 +08:00
bunnie
8dc9dddfdd modify pdddbg.py to handle swapped up DNA for verifying rekey ops 2022-07-19 03:17:32 +08:00
bunnie
421542d9da add auto-rekey flow to boot 2022-07-19 03:17:21 +08:00
bunnie
fa984845ed add testing commands for rekeying. 2022-07-19 03:17:08 +08:00
bunnie
900df7b223 add testing feature for rekey in hosted mode to LLIO (dna swap) 2022-07-19 03:16:51 +08:00
bunnie
e8188309cf add rekey operation for PDDB migrations to new devices 2022-07-19 03:16:37 +08:00
Gianguido Sorà
23f9717fee chore(vault): use storage more and more 2022-07-18 17:32:54 +02:00
Gianguido Sorà
75b30f723e chore(vault): use new generic storage in vendor commands 2022-07-18 17:32:09 +02:00
Gianguido Sorà
5f7fb22317 chore(vault): provide default for TotpAlgorithm
The default is "None", which will fail any conversion or usage
2022-07-18 17:31:32 +02:00
Gianguido Sorà
222a912603 chore(vault): don't generalize delete on storage, pass ContentKind as
ref
2022-07-18 17:31:08 +02:00
Gianguido Sorà
b1c6690826 chore: forgot to update cargo files after totpbackup rename 2022-07-18 17:30:45 +02:00
bunnie
83eb05273f sync the PDDB before doing a backup 2022-07-18 03:09:07 +08:00
bunnie
2ca51b7d32 peeling that onion...another key verification failure in restore. 2022-07-17 23:51:45 +08:00
bunnie
8f439f8d61 add the beginning of a CI/analysis tool for backups
for now all the tool can do is just make sure that the
header is valid, but it can't decrypt or operate on
the backup itself.
2022-07-17 22:49:03 +08:00
bunnie
8e6728d743 improve error handling in restore script 2022-07-17 22:48:03 +08:00
bunnie
c05e66b32c fix issue where pubkey was being erased before access
verification happens after the private key material is erased,
which incidentally nukes public key material, causing verification
to fail. This caches a copy of the pubkey material before
the erase happens.
2022-07-17 21:15:30 +08:00
bunnie
13e13fdfd6 add some explanation in the restore process 2022-07-17 18:50:28 +08:00
bunnie
a5685c9e62 add debugging around restore verification
for some reason we're getting a bogus failure on restore...
2022-07-17 18:50:10 +08:00
bunnie
15ca22eacf fix hosted mode 2022-07-17 03:46:28 +08:00
bunnie
646a9fc1e5 fix hosted mode 2022-07-17 03:45:50 +08:00
bunnie
0cc2e46b02 fix dangling method invocation
complicated thing is complicated
2022-07-17 03:36:36 +08:00
bunnie
802decb55a initial drafts at the backup and restore helper scripts
very, very rough but i was able to run through an entire
cycle exactly once successfully.

much more testing needed.
2022-07-17 03:13:42 +08:00
bunnie
9c7b1e3228 update update script verbiage to reflect the latest flow 2022-07-17 03:13:13 +08:00
bunnie
3550cec14a fix double-lock on rootkeys object 2022-07-17 03:12:49 +08:00
bunnie
667470ba05 fix restore bugs
- read order of keys was wrong from staged data
 - make restore a blocking op so the Ux doesn't try to trigger
 other things at boot
 - fix pubkey check to use staged key for backup flow
 - fix some wording and skip redundant messages
2022-07-17 03:10:26 +08:00
bunnie
ef164871a1 move COM link error handling up the stack a bit
this allows us to have better error reporting and handle
the cases where the EC is updating and just generating random
vectors more...palatable.
2022-07-16 23:11:13 +08:00
bunnie
37154f3350 add edge case handling for restore to new device
Just remembered that the PDDB is *locked* to a given device.
To restore to a new device, you have to unlock all the Bases,
and re-encrypt them to the new device's DNA.

This commit adds the facilities to detect this condition, but
the actual code to do this is quite involved...let's handle that
after we've got a "simple" restore to the same device going.

Why do we lock to a device's DNA? the idea is to prevent
attacks where people are taking static blocks of crypto data
and just swapping it between devices to see if they can
get something to decrypt. It also makes it harder for
an adversary to replace the physical device -- e.g., an
evil maid prepared a replacement with implants in advance, and they
image your PDDB onto the replaced device, hoping that you don't
notice. Because the PDDB is device-locked, the "evil maid"
would have to forge the devices DNA to match yours:
possible, but would require kernel mods that patch over the
reported ID; that would trigger the line across the top of the
screen; or, somehow editing the FPGA itself to force
its device ID to report the same as yours. This last attack
vector would be successful, but afaik there is no known way
to modify an FPGA's DNA code. I'm sure there is some proprietary
secret know that Xilinx uses to set it, and if you were
a large government you may be able to coerce Xilinx into giving
you those codes plus some tool that could set the fuses
plus some unfused devices (the fuses are burn-once) but....
2022-07-16 02:31:18 +08:00
bunnie
f6423381e9 update lockfile 2022-07-16 00:40:35 +08:00
bunnie
13b9064517 convert DNA output to something CI can pick up
this is for automation around PDDB readouts -- it is locked to the
device's DNA.
2022-07-16 00:40:04 +08:00
bunnie
e1d946a18d other items for keyboard layout backup/restore 2022-07-16 00:39:34 +08:00
bunnie
13e11b83ae add backup of keyboard layout and language 2022-07-16 00:39:14 +08:00
Gianguido Sorà
6cdf2fa880 feat(vault): finish generic implementation of storage methods 2022-07-15 10:54:44 +02:00
Gianguido Sorà
3edb98431b chore(vault): make the error explicit 2022-07-14 19:21:02 +02:00
Gianguido Sorà
ba2c573ef4 chore(vault): try generalizing Manager operation 2022-07-14 18:39:13 +02:00
bunnie
fded17221f improve autoupdate work flow and error messaging
this is hopefully a work-around for #114 as well, assuming
users actually read the message...
2022-07-14 23:20:26 +08:00
Gianguido Sorà
e3710c3c81 chore(vault): rename totpbackup to vaultbackup 2022-07-14 16:49:04 +02:00
bunnie
a5bcc50007 Merge branch 'backups' into main 2022-07-14 19:27:18 +08:00
bunnie
abade9e1af minor fixes in the autoupdate flow
- do not try to create root keys if we just did an SoC update.
that's just too many things going on, we should definitely force
a clean reboot first.

- add a clean reboot step after a no-key soc update

- try to switch USB debug mode on if a backup was created
2022-07-14 19:26:09 +08:00
bunnie
04f34c6320 Merge branch 'backups' into main 2022-07-14 04:46:21 +08:00