aboutsummaryrefslogtreecommitdiff
path: root/examples/std/src/bin
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2023-01-12 20:43:24 +0000
committerGitHub <[email protected]>2023-01-12 20:43:24 +0000
commitb0c8c688c7458785826c60a3afb05c3338d70427 (patch)
tree5e2b5bb6b96f79a858b1654c0210b90cc02c2972 /examples/std/src/bin
parent88fd521b016be18230b5b3d4b3bf96c29f10e202 (diff)
parentb0529bc943c9da0eb5f43335d06779d6064b765a (diff)
Merge #1147
1147: Support codesigning in the firmware updater r=lulf a=huntc This PR provides a method to verify that firmware has been SHA-512 hashed and signed with a private key given its public key. The implementation provides both [`ed25519-dalek`](https://github.com/dalek-cryptography/ed25519-dalek/blob/main/Cargo.toml) and [`salty`](https://github.com/ycrypto/salty) as the signature verifiers. Either of the `ed25519-dalek` and `ed25519-salty` features is required to enable the functionality from `embassy-boot`. The `verify_and_mark_updated` method is used in place of `mark_updated` when signing is used via its feature. This avoids the accidental omission of validation where it has been declared as required at compile time. It also keeps the parity of calls at the same number to the previous situation. The PR permits other types of signature verifiers in the future on the proviso that the [Signature trait](https://github.com/RustCrypto/traits/tree/master/signature) is supported. Finally, I've updated the CI to include testing `embassy-boot`, which it was doing before. In addition, I've included a unit test for verification based on a `ed25519-dalek` documentation example. This tests both the `dalek` and `salty` implementations. In terms of code size comparisons, `dalek` adds about 68KiB and `salty` adds about 20KiB. I'm using `salty` myself. I've also tested this out by signing my code with the OpenBSD `signify` utility and then verify it during firmware upload using `salty`. Co-authored-by: huntc <[email protected]>
Diffstat (limited to 'examples/std/src/bin')
0 files changed, 0 insertions, 0 deletions