forked from nihalpasham/rustBoot-book
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e4a9f9
commit 86d4d01
Showing
8 changed files
with
555 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# Signing Utilities | ||
|
||
As rustBoot supports 2 types of firmware image formats, depending on the underlying device i.e. either an | ||
- [`mcu-image:`](./images.md#mcu-image-format) a simple 256-byte firmware image format for microcontrollers or a | ||
- [`fit-image:`](./images.md#fit-image-format) the flattened-image-tree format for systems capable of booting linux. | ||
|
||
rustBoot `rbsigner` utility can produce 2 different types signed images. | ||
### Signed mcu-image: | ||
[TODO ..] | ||
### Signed fit-image: | ||
To sign a fit-image, rustBoot's [image signing utility](https://github.com/nihalpasham/rustBoot/tree/main/rbsigner) takes 3 inputs | ||
- an unsigned fit-image in the above format | ||
- a raw signing-key or ecdsa private key | ||
- the ecdsa curve-type - (nistp256 only for now). | ||
|
||
Here's an example for how to sign a fit-image: | ||
- `../boards/bootloaders/rpi4/apertis/rpi4-test-apertis.itb` is the path to my fit-image | ||
- `../boards/rbSigner/keygen/ecc256.der` is the path to my `test` signing-key | ||
- `nistp256` is the type ecdsa curve I'd like to use. Its the only one supported for now. | ||
|
||
Simply run the following command from root directory of the rustBoot project. | ||
``` | ||
cargo run ../boards/bootloaders/rpi4/apertis/rpi4-test-apertis.itb ../boards/rbSigner/keygen/ecc256.der nistp256 | ||
Output: | ||
Finished dev [unoptimized + debuginfo] target(s) in 0.04s | ||
Running `/Users/nihal.pasham/devspace/rust/projects/prod/rustBoot/target/debug/rbsigner ../boards/bootloaders/rpi4/apertis/rpi4-test-apertis.itb ../boards/rbSigner/keygen/ecc256.der nistp256` | ||
signature: ecdsa::Signature<NistP256>([64, 147, 93, 99, 241, 5, 118, 167, 156, 150, 203, 234, 74, 207, 182, 243, 129, 143, 38, 2, 107, 85, 114, 145, 178, 163, 33, 153, 2, 100, 0, 114, 135, 18, 174, 183, 194, 110, 24, 186, 33, 36, 39, 105, 116, 74, 8, 118, 171, 237, 30, 108, 64, 205, 206, 14, 110, 226, 43, 143, 180, 193, 19, 33]) | ||
bytes_written: 62202019 | ||
``` | ||
In this case, the `signed fit-image` will be stored at the following path - `../boards/bootloaders/rpi4/apertis/signed-rpi4-apertis.itb` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.