embassy/examples
bors[bot] b0c8c688c7
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 <huntchr@gmail.com>
2023-01-12 20:43:24 +00:00
..
boot Support codesigning in the firmware updater 2023-01-12 13:30:58 +11:00
nrf5340 Reduce amount of samples for nrf5340 2023-01-09 22:57:40 +01:00
nrf52840 Rename examples/nrf to examples/nrf52840 2023-01-09 22:30:02 +01:00
nrf-rtos-trace all Cargo.toml: Add license to all crate Cargo.toml files 2022-10-07 12:41:56 +02:00
rp rp2040: add {tx,rx}-only constructors to UART 2023-01-04 21:11:19 +01:00
std net: split driver trait to a separate crate. 2022-12-26 04:49:08 +01:00
stm32f0 enabled interrupt feature 2022-12-21 11:56:30 +05:30
stm32f1 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32f2 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32f3 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32f4 stm32 otg: add examples. 2023-01-11 17:58:15 +01:00
stm32f7 stm32 otg: add examples. 2023-01-11 17:58:15 +01:00
stm32g0 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32g4 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32h7 stm32 otg: add examples. 2023-01-11 17:58:15 +01:00
stm32l0 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32l1 Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32l4 stm32 otg: add examples. 2023-01-11 17:58:15 +01:00
stm32l5 net: split driver trait to a separate crate. 2022-12-26 04:49:08 +01:00
stm32u5 stm32 otg: add examples. 2023-01-11 17:58:15 +01:00
stm32wb Bump defmt-rtt to 0.4 2022-11-29 21:15:24 +01:00
stm32wl Add random example 2022-12-04 09:38:57 +01:00
wasm all Cargo.toml: Add license to all crate Cargo.toml files 2022-10-07 12:41:56 +02:00