Commit graph

10340 commits

Author SHA1 Message Date
nworbnhoj
956eef4d69 remove heap monitoring from shellchat net image 2022-07-27 11:41:45 +10:00
nworbnhoj
1357d39255 reconfigure shellchat net image to use decode_png 2022-07-27 11:37:31 +10:00
nworbnhoj
7cd5ee82ce Implement decode_png adaptor iterator
This incomplete PNG decoder presents as an Iterator reading u8 bytes directly from a Reader.

Aproaching a png decoder as an Iterator requires significantly less Heap than
the traditional batch aproach.

On Precursor, this enables PNG bytes to be intercepted at the network interface
and processed into the much smaller gam::Bitmap format without ever having to
store the original PNG file.
2022-07-27 09:18:19 +10:00
bunnie
e2f7a75f87 improve help message 2022-07-26 03:43:31 +08:00
bunnie
6266101727 backalyzer now works with PDDB in hosted mode.
Specify file as `-f pddb-images/hosted.bin` and use `--hosted`
2022-07-26 03:42:11 +08:00
bunnie
e943b35512 fix key wrapping in hosted mode
this will require you to regenerate your hosted mode PDDB
image, no migration was written for this mode.
2022-07-26 03:24:37 +08:00
bunnie
c889f5576f cleanup backalyzer. i think it's basically ready to go now 2022-07-26 03:09:09 +08:00
bunnie
22a85ba022 working draft of backalyzer 2022-07-26 02:53:19 +08:00
bunnie
ba7532a4fe fix backup length
we were accidentally also backing up the WF200 firmware as well,
chop that off so that the analysis scripts & restore works correctly.
2022-07-26 02:52:40 +08:00
bunnie
ef29e6e504 re-org the python pddb analysis scripts
allow for elements of pddbdbg.py to be shared with the backalyzer.py
2022-07-26 00:06:16 +08:00
bunnie
494ec7c2b3 improve the basis name validator - ':' is an illegal character in a basis name. 2022-07-26 00:05:45 +08:00
Gianguido Sorà
de4c164c7b Merge branch 'main' into feat/vault-usb-totp-loading 2022-07-25 11:44:01 +02:00
Gianguido Sorà
b21ef727bc chore(vault): clean up
Remove unused funcs, types and replace them with the storage crate
analogous.
2022-07-25 11:31:44 +02:00
bunnie
ec5cc29ccd hotfix for incorrect AES-KWP implementation
The crate we originally grabbed for AES-KWP seems to be non-compliant
(or I'm an idiot and I can't figure out how to call it in a way
that is compliant).

See https://github.com/jedisct1/rust-aes-keywrap/issues/9

Turns out that `aes_kw` *is* compliant, but unfortunately, it didn't
exist back when the PDDB was being written. The PDDB started in October
2021, and `aes_kw` was pushed in Jan 2022. *just* barely missed it.

Anyways, caught this error while trying to implement some CI for
backups. Hurray for testing!

This patch removes the encryption path using the incorrect version
of the algorithm, but leaves the decryption path in place. The
system will try to decrypt initially with the correct version,
but if that fails, it will fall back and try the incorrect version.
If that succeeds, it returns an error code with the correct key and
an updated wrapped key, which the caller can store so that future
calls do not fail. Thus, we have a seamless migration from the
incorrect version to the correct version.

Have verified that the aes_kw version *does* work with the CI
script, insofar as it has been written (we just got to that point
and got stuck). So, full speed ahead. Users shouldn't notice this
change.

Also, fwiw, I did take a look at the "incorrect" implementation,
and it doesn't look obviously insecure. Printing out the various
rounds of the wrapping function looks like the first couple rounds
match, but it diverges somewhere probably due to an off-by-one
in a counter or something like that. I didn't chase it out -- just
wanted to make sure that nothing looked like a huge data compromise.

Good news is this comes right on the heels of v0.9.9 release, so
this will be pushed as a hotfix right away.
2022-07-25 02:56:20 +08:00
bunnie
c0bd7f7f8a add note about faulty keywrap implementation 2022-07-25 01:22:04 +08:00
bunnie
edfbc1e4f0 update some text on the USB command to be more accurate 2022-07-23 17:32:13 +08:00
bunnie
a0a51cab5c emphasize that you must reboot by using the paperclip 2022-07-23 16:23:05 +08:00
bunnie
97b13e7df3 move the OG signing tool to legacy status 2022-07-23 16:08:47 +08:00
bunnie
b4a784391d clean up the tools directory 2022-07-23 16:07:33 +08:00
bunnie
a19e11e5d3 fix an instance of "root keys" -> "setup passwords" in the vault app 2022-07-23 00:33:07 +08:00
bunnie
a45d210b0b ignore python build files 2022-07-23 00:13:05 +08:00
bunnie
c43aa7f77e remove egg and dist from the index as it is dynamically generated 2022-07-23 00:11:32 +08:00
bunnie
a43e0640f9 i'm not sure if these typically end up in repos, but they're there... 2022-07-22 22:29:32 +08:00
bunnie
5bce709d3c some cosmetic improvements and release notes acknowledgements 2022-07-22 22:28:46 +08:00
bunnie
d3840ea342
Merge pull request #204 from neutralinsomniac/fix_python_updater_setup
small fixes to make the precursor updater python package work through pip
2022-07-22 22:18:04 +08:00
Jeremy O'Brien
b47fccde6a precursorupdater python package improvements
move precursorupdater's main into its own namespace and handle both
running from the repo directly and from pip
2022-07-22 09:53:04 -04:00
Jeremy O'Brien
52bcaa58b2 small fixes to make the precursor updater python package work through pip 2022-07-22 09:41:43 -04:00
bunnie
bc758749fb try to explicitly name the package.
this still did not work.
2022-07-22 20:11:57 +08:00
bunnie
11402ec5e6 reorg again 2022-07-22 19:54:06 +08:00
bunnie
80a8bba268 try to re-org again to get this to run as a script 2022-07-22 19:53:46 +08:00
bunnie
237ed14d28 finalize renaming so we don't have to deal with _ vs - ambiguities 2022-07-22 19:06:13 +08:00
bunnie
ee9f815fd6 restructure project 2022-07-22 19:05:26 +08:00
bunnie
4fa1236ce6 remove the _. i don't know the rules for how this transforms to - and when. 2022-07-22 18:54:56 +08:00
bunnie
aed8c89373 more restructer attemptings 2022-07-22 18:54:40 +08:00
bunnie
4e1a3beb3c try to restructure repo to work with...idk why i am even trying. 2022-07-22 18:54:21 +08:00
bunnie
ee4e2e5d65 fix metadata on packaging for precursor_updater
still not sure how to make this actually work as i want it to,
but at least there's a thing you can run to like...get dependencies,
I guess.

lame.
2022-07-22 18:10:32 +08:00
bunnie
8f6fa5f53d add a first draft of precursor_updater.py
this should be an "all in one" updater.
2022-07-22 03:46:31 +08:00
nworbnhoj
b769b26a57 recast Image Modal to accept gam::Bitmap directly 2022-07-22 05:27:42 +10:00
bunnie
bad4865ea3 shift restore.py to look at the tagged releases for artifacts 2022-07-21 01:10:52 +08:00
bunnie
14dacd9941 handle WFXerror case more gracefully 2022-07-20 21:07:52 +08:00
bunnie
95c4144bba update release notes 2022-07-20 01:03:53 +08:00
bunnie
b5f45ec9ec improve the wording of the menu option to setup passwords 2022-07-19 23:59:50 +08:00
bunnie
6f10061653 reset "don't ask again" flag for password creation during factory test
this facility is necessary in case a worker accidentally picks
the wrong setting, disabling the feature for the device. When
the factory test completes, a call is made to reset the parameter.

This was a slightly complicated affair because the the don't ask
flag is contained within the rootkeys enclave itself, and we can't
just give access to rootkeys willy-nilly. So the flag is passed
through the PDDB and then to the rootkeys enclave. It's not harmful
to have it reset by an unauthorized actor; the pop-up will not
happen if passwords are, in fact, already set.
2022-07-19 23:57:25 +08:00
Gianguido Sorà
63fc8539c4 chore(vault): cargo lock updates 2022-07-19 16:48:05 +02:00
Gianguido Sorà
31cb7c9ae1 chore(vault): support backup/restore of passwords 2022-07-19 16:47:28 +02:00
Gianguido Sorà
8c0564bc22 feat(vault): handle passwords, support new CLI objects
Mostly needed to not duplicate backup/restore routines/commands, hence
wrapping an enum around it.
2022-07-19 16:45:58 +02:00
Gianguido Sorà
dfd11ba5df feat(vault): better cli experience, provide backup/restore of passwords
as well
2022-07-19 16:45:39 +02:00
bunnie
593928bd75 remove testing menu from vault for release 2022-07-19 17:58:12 +08:00
bunnie
e15969050c bump precursors to latest tag 2022-07-19 17:40:50 +08:00
bunnie
e40a109f6c add UX flow dedicated to the 'churn' operation 2022-07-19 16:57:47 +08:00