Commit graph

465 commits

Author SHA1 Message Date
bunnie
f17b67c16d put the test key into the devkey slot
i feel a little more comfortable with this because there are
checks that *any* key in that slot would be treated as a devkey
and would lead to key erasure. so just in case i messed up
something in the other checks, this would trigger a key erasure.

I think there is no way around signing at least a beta image
containing the third party keys if i truly want to check all
the paths, so trying to isolate what it can do is important.
2026-02-04 03:14:29 +08:00
bunnie
cf267f096c generate actual private keys instead of using random data
by doing this we make this safer by ensuring that the public
keys are valid public keys, allowing us to sign these images
with production keys and not accidentally signing a weak
public key.
2026-02-04 03:07:38 +08:00
bunnie
f0fb76dca1 add ability to generate and install testing keys for third party images 2026-02-04 02:50:08 +08:00
bunnie
0e345b8a48 fix argument name 2026-02-03 23:50:36 +08:00
bunnie
602cc44ff8 add the ability to create a fake public key block
This just populates a pubkey block with random data, simulating
a third party firmware. A fake pubkey block can't boot anything
else because we can't sign a firmware that matches that. But,
it's also good enough to be able to test collateral key states.
2026-02-03 22:05:55 +08:00
bunnie
7a55d6a669 add command line arguments to override antirollback settings
this argument is primarily intended for use in CI testing to create
a synthetic image that has an advanced antirollback code.
2026-02-03 03:24:06 +08:00
bunnie
f08a04308d bump version for xous-tools
publishing the antirollback feature
2026-01-30 20:28:26 +08:00
bunnie
d01615ff6e add handling for anti-rollback code in signed images
for out of tree builds, we'll just stick with the default code
of '1': if you're doing a build out of tree, it's assumed that
you don't care about security (not tying your application to
a given OS version opens up an attack surface; presumably if
you're doing something security-critical, the extra hundred
megabytes to clone the xous-core repo isn't a big deal? but
if you're just trying to blink some LEDs you really don't care
about the anti-rollback feature).
2026-01-30 20:25:51 +08:00
bunnie
6d6f41f426 bump minor rev on xous-tools
this forces the semver to nil so that we don't get errors in
a signing routine that lacks access to versioning.

The upshot is that out of tree apps have no version assigned
to them, and they can't be checked for version compatibility.
2026-01-30 19:42:24 +08:00
bunnie
47e0899f1b prune the previous feature added to resolve versions via web interface
The problem is that this feature, while neat, pulls in a huge
amount of code into the SBOM, a lot of which looks pretty scary,
and we're also including the ability to hit the network in the
build system which is also scary and potentially full of software
supply chain exploits.

So, while it would be "neat" to have the system be "smart enough"
to guess a semver based on a git rev of xous-core without having
to pull down tags or clone the full repo, the cost is a huge amount
of tooling and code and trusting a very large attack surface to
also not use the same mechanism to exfiltrate your keys, hack
your computer, or otherwise cause abuse.

For such a minor feature, I think this risk is not worth it.
2026-01-30 19:40:05 +08:00
bunnie
e41195e349 attempt to resolve version from URL automatically
this might be a bit too heavy-weight for a lightweight tool but
let's give it a try
2026-01-30 19:30:28 +08:00
bunnie
de881ff70f commit deprecation of xous-make-renode-boot 2026-01-30 04:32:57 +08:00
bunnie
8ca4199960 remove deprecated program
this is complicating the publication process
2026-01-30 04:32:34 +08:00
bunnie
a09075f08e deprecate xous-make-renode-boot
this is no longer used and its reliance on blobs breaks publication
2026-01-30 04:30:57 +08:00
bunnie
de7c1c0f49 fix tools toml file for publication 2026-01-30 04:26:32 +08:00
bunnie
e59752f68b add the tool to the bin list 2026-01-30 04:00:27 +08:00
bunnie
21aed270fb add a tool for building UF2 files out of tree 2026-01-30 04:00:12 +08:00
bunnie
fc6a4179bd modify tools to xous-tools
also add `xous-` prefix to binaries like copy-object

this allows us to publish the tools as a package and allow
people to `cargo install` them with less chance of name space
conflicts.
2026-01-30 02:16:17 +08:00
bunnie
3f869ca389 bump utralib version for publication 2026-01-29 19:12:00 +08:00
bunnie
3050fead41 add anti-rollback to image creation tool 2026-01-22 19:40:38 +08:00
bunnie
c297ca5f2e add free space computation on kernel image generation 2025-12-22 16:16:21 +08:00
bunnie
36b103ef6c
remove the developer function from the function code list
The developer function was decided to be overly-broad: the
issue is you could slot that in to *any* boot position and
it'd be accepted, and we already have a mechanism to deal
with developer mode (developer-signed images). Thus eliminate
the extra case and simplify the code base to reduce
potential bugs.
2025-12-19 01:09:44 +08:00
bunnie
c4ef7baabb add image size checking in image generator
flags when the kernel is too big now
2025-12-06 18:21:57 +08:00
bunnie
e9d8ec8f1d add better debug output from the image generator
this helps to see when address ranges are truncated or missing
2025-11-25 19:05:32 +08:00
Yuval Adam
f297c3b2a5 Remove python cache and build artifacts, update .gitignore
Signed-off-by: Yuval Adam <_@yuv.al>
2025-10-17 22:04:14 +02:00
bunnie
0efcd0af90 clean up a debug print 2025-10-16 23:26:30 +08:00
bunnie
ea8927fc55
Fixup sign_image to generate records with the new auth_data format 2025-10-06 23:34:30 +08:00
bunnie
54ee8ffd83 update sign_image to work with the new public key records 2025-10-06 15:19:52 +08:00
bunnie
3c68eea714
Merge branch 'main' into signing 2025-10-06 13:45:29 +08:00
bunnie
dbb0a75118 bump versions
have to absorb a version change due to xous-semver change

might as well also update the utra/svd generator dependencies
since that's been held off for a long time now.
2025-10-06 13:23:18 +08:00
bunnie
6d4f8004d3 fix breakage associated with changes to xous-semver 2025-10-06 13:17:21 +08:00
bunnie
4413b95162 place the public key in the correct location 2025-10-06 03:50:09 +08:00
bunnie
12e6292325 extend the image building tools to handle detached apps 2025-10-05 17:11:30 +08:00
bunnie
afd64aa2b2 add a helper program to create "detached apps"
detached apps are ROM-loaded apps that are detached from the
main xous.img.
2025-10-05 17:05:49 +08:00
bunnie
d21e99a3f3 implement swap header length reference 2025-10-04 18:52:50 +08:00
bunnie
2175ea60f1 improve the tools for creating images
- use more structural templating to place data, instead of
just hand-coded writes to a buffer

- add private key signature generation to the swap image
2025-10-04 00:49:56 +08:00
bunnie
f8c92c4c23 fix loader function code mapping 2025-10-01 14:55:19 +08:00
bunnie
f04a856037 allow .bin as uf2 conversion target 2025-10-01 02:56:53 +08:00
bunnie
76f6f1fda5 pack offsets into a u16-sized pointer
the data section is generally pretty small, a few k, and there
are cases where we need more initialization entries. This keeps
the structure from growing beyond 256 bytes.
2025-09-30 21:50:17 +08:00
bunnie
d9347e46fb update tools to generate a uf2 image 2025-09-29 16:17:45 +08:00
bunnie
a9112a743a add mapping for loader in image signing (synonymous with baremetal) 2025-09-29 13:51:58 +08:00
bunnie
d502aed5af refactor image creation to be cleaner
use struct-based API and bytemuck instead of manual byte serialization.
this is for the bao1x target, precursor still uses the legacy code.
2025-09-26 22:55:39 +08:00
bunnie
198e584369 add adjustable signature sector sizes
can be smaller than 4k now because on baochip the erase sector
size is just 32 bytes.
2025-09-24 23:50:13 +08:00
bunnie
024c8131bc extend image builder to handle baking in statics 2025-09-21 21:50:31 +08:00
bunnie
1255bf12d9 FLAG DAY: fix all names to harmonize around 'bao1x'
The code base had evolved through several code names, interim
names, company names and chip names that alternatively did or did
not exist.

Baochip is the definitive name of the company, and the Baochip1x
(full part number BAO1X2S4F-WA) is the definitivey part number of
the SoC. For convenience, the part number is shortened to 'bao1x'
in most feature flags and variable references.

This commit fixes all of the odd names and removes some unmaintained
early targets.
2025-09-18 21:25:51 +08:00
bunnie
74218bcded cleanup some cruft 2025-09-14 13:26:33 +08:00
bunnie
05a7a1fc06 fix naming of trng cases 2025-09-14 02:10:32 +08:00
bunnie
6908d9293e add a tool for recovering and analyzing trng traces from NTO 2025-09-13 23:28:42 +08:00
bunnie
c61a521c7d add size on disk reporting 2025-09-10 09:16:53 +08:00
bunnie
7d89deacb4 auto-generate code snippet for baremetal to bootstrap its .data region 2025-08-10 15:48:48 +08:00