Commit graph

9438 commits

Author SHA1 Message Date
bunnie
f3ff944c63 add bao1x targets for gh ci 2025-11-17 17:33:23 +08:00
bunnie
22fce8bae0 add hosted mode target for bao1x 2025-11-17 17:33:04 +08:00
bunnie
0a2c57686c
Merge pull request #728 from betrusted-io/alpha1
Alpha1 release tag
2025-11-16 23:05:25 +08:00
bunnie
ce168cad74 make signing flow orthogonal across targets 2025-11-14 19:32:58 +08:00
bunnie
ff5cfa7b12 remove panic/resets on errors during secret erase
at the moment this runs a risk of boot-loops depending on the
configuration of the device.
2025-11-14 19:14:35 +08:00
bunnie
5e805196e6 fix typo 2025-11-14 19:14:25 +08:00
bunnie
99d10d09a6 cleanup baremetal target signing 2025-11-14 18:46:00 +08:00
bunnie
ed1f19984f
loosen restriction on zero keys seen during wiping
this is to handle an edge case where an improperly set ACL
on the alpha0 boards would cause a set of keys to be inaccessible
to the boot routine
2025-11-14 16:16:46 +08:00
bunnie
c79a891553 add api to determine current speed 2025-11-14 16:16:30 +08:00
bunnie
c5fb3f282d fix handlers to adjust max packet size to enumeration speed
this seems to make enumeration more reliable with weird cables
2025-11-14 16:15:56 +08:00
bunnie
78f0fcac1a add more differentiation of alt-boot/boot configs
also clear the baosec flag when dabao is forced
2025-11-13 22:20:10 +08:00
bunnie
1e085a6548 don't make unknown flash a hard panic
this allows an accidental baosec recognition on a dabao board
to not brick the board
2025-11-13 22:19:13 +08:00
bunnie
6f65959adb add more signing targets 2025-11-13 22:19:01 +08:00
bunnie
22cfaafce4 add force-dabao to alt-boot1 image generation
at least for now, with dabao being the only board in the field,
this makes sense.
2025-11-13 22:18:37 +08:00
bunnie
fd0f684ee3 fix stale api in repl 2025-11-13 21:57:41 +08:00
bunnie
52c5400fca
cleanup debug 2025-11-13 18:36:03 +08:00
bunnie
9213755a6b
move keystore init to userspace
This moves the key store initialization to the key manager
process itself.

It has been tested to work with signed images, and to also
protect the system in case of another process trying to access
the key data as well as in the case of developer keys being
used.
2025-11-13 18:32:04 +08:00
bunnie
9f8c2deeda
add more granular signing targets
helps with debug
2025-11-13 18:31:15 +08:00
bunnie
faecc1cf27 pin RRAM data onto heap
this prevents optimization that move it around and can cause
troubles for `std` mode operations
2025-11-13 18:29:06 +08:00
bunnie
a7477ec53b
Remove key slot implementation; migrate keys to data slots
The -A1 stepping is going to tie the IFR access control
bits for data and key slots together. This is due to an RTL
bug where the key slot maps were typo'd and they ended
up mapping to the same IFR ACL.

We "could" continue to use key slots with a rule that
key and data slots would have to coordinate with each
other and not use the same slot number.

However, because of this linkage, and because there are
other bugs suspected in the keyslot implementation, an
executive decision was made to disregard the key slot
feature in the chip.

The main downsides of this are:

- fewer slots (2048 vs 4096)
- no key access linkage to HMAC auth on SCE

I *think* that's it.

Fewer slots - 2048 slots is still a lot of slots, about half are
used now, I think this is plenty.

Key access linkage to HMAC auth on SCE - I have reasons to
suspect this feature is broken anyways for subtle reasons
related to malleability of the HMAC round constants. Even
without that brokenness, it's hard to use HMAC auth to manage
the system because it requires per-device unique keys: so,
we're using a PKI scheme and no symmetric secrets to handle
access controls.

Removing the key slots also greatly simplifies the code
base analytically. This culling removes the key slot
abstraction the "simple" way, but without the weirdness
of the keyslots (in particular the key ID chaining which
makes them different from data slots) I could remove even
more abstractions and simplify the code.

One upside is now all elements can enjoy the write mode
behavior which can force the slot to be only 0->1 writeable,
which could be useful for other things down the road.

This was tested to not interfere with Dabao-Alpha 0
bootloaders.
2025-11-13 18:21:52 +08:00
bunnie
6af2001810
fix write protect bits
Each write protect bit in the IFR array covers *8* key slots.
This scopes the write protect down to just the 8 slots we care about.
2025-11-13 18:20:12 +08:00
bunnie
f88c801e01
update key ACL to r/w
this allows the OS to initialize the keys

note that including write access only gives it to the fw0 user,
which is the OS's secure user. thus any write primitive created
by this expansion of access should transitively also be a read
primitive (which is actually what the adversary desires).

In exchange the OS is allowed to initialize the keys, which
I think is the right place to do it given that it's too hard
at this point to nail down the exact key layout, etc.

Note that it is impossible for the OS to change ACLs - that is
a feature that can only be updated by the boot user - which
is why the boot user can change the ACL to gain access to
erase keys, but the OS user can't modify its own ACL.
2025-11-13 11:06:16 +08:00
bunnie
bd37ffde5c
Move in-system keying to system code
Since in-system keying has to happen in the factory, it doesn't
add anything to burn it into the bootloader. Furthermore, the
access controls are already set up so that the keys can only
be accessed by the OS code.
2025-11-13 10:57:04 +08:00
bunnie
d8c2ffe2b1 fix/update baosign.ps1
added a boot signer that signs the various boot configs
2025-11-12 23:02:52 +08:00
bunnie
47e8f96ccb update release description 2025-11-12 22:08:28 +08:00
bunnie
10bd1502d0 fix ACL to match actual usage of data slots 2025-11-12 22:08:12 +08:00
bunnie
c3c86e857b improve pddb init 2025-11-12 22:08:01 +08:00
bunnie
63e78b202b
Merge pull request #652 from betrusted-io/vault2
WIP: Vault2
2025-11-12 18:49:38 +08:00
bunnie
d50963cd5b update lockfile 2025-11-12 18:24:37 +08:00
bunnie
5f859e57fb cleanup warnings 2025-11-12 18:24:23 +08:00
bunnie
94964f12a2 reduce debug noise 2025-11-12 17:46:38 +08:00
bunnie
fc43efb7f6 layer in password browsing 2025-11-12 17:46:21 +08:00
bunnie
0d1105fb25 fix index selection in menus 2025-11-12 16:26:35 +08:00
bunnie
c650b0fb94 hook the totp rendering list to the internal database 2025-11-12 16:25:59 +08:00
bunnie
59325e0571 fix warnings in placeholders in bao1x-emu 2025-11-12 15:28:42 +08:00
bunnie
a3c3fa15d9 update deps 2025-11-12 15:28:28 +08:00
bunnie
564374dfd3 cleanup menu implementation warnings and shallow bugs 2025-11-12 15:28:11 +08:00
bunnie
93547fa2cd add ephemeral api 2025-11-12 15:27:55 +08:00
bunnie
24425f9f90 fix typo 2025-11-12 15:27:44 +08:00
bunnie
c44c63a72b add vault2 to the app list default 2025-11-12 15:27:26 +08:00
bunnie
f4b88ce964 fix deps in other build modes 2025-11-12 15:27:00 +08:00
bunnie
315bee22dc add placeholders for ephemeral/volatile data in keystore 2025-11-12 15:26:35 +08:00
bunnie
c168c7d720 update ui to use builder pattern 2025-11-12 15:26:17 +08:00
bunnie
fe68753779 layer in new items that can be activated
now that more APIs are implemented, more of the "real meat"
of the vault app can be turned on
2025-11-12 15:25:30 +08:00
bunnie
785293a440 add menu widget implementation 2025-11-12 13:15:07 +08:00
bunnie
46ecaea680
Merge branch 'main' into vault2 2025-11-12 12:35:27 +08:00
bunnie
e6f999ff4c
Merge pull request #721 from rowr111/tools-bao_monitor-fixing
tools-bao:  fixing the serial monitor
2025-11-12 12:35:02 +08:00
Jeanie
35a68392ea Merge remote-tracking branch 'upstream/main' into tools-bao_monitor-fixing 2025-11-11 22:04:10 +09:00
bunnie
8c421c6050
Merge branch 'main' into vault2 2025-11-11 08:47:10 +08:00
bunnie
2b566a3d2e
Merge pull request #726 from betrusted-io/pddb
pddb rework to use the finalized keystore
2025-11-11 08:46:07 +08:00