diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 71a3f0734b4..913afe671ba 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,6 +5,19 @@ on: types: [published] jobs: + publish-trussed: + runs-on: ubuntu-latest + if: ${{ startsWith(github.event.release.tag_name, 'v') }} + environment: crates.io + permissions: + id-token: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3 + id: auth + - run: cargo publish --package trussed + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} publish-trussed-core: runs-on: ubuntu-latest if: ${{ startsWith(github.event.release.tag_name, 'core-') }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 462d92a0359..945800db11b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -[Unreleased]: https://github.com/trussed-dev/trussed/compare/v0.2.0-rc.1...HEAD +[Unreleased]: https://github.com/trussed-dev/trussed/compare/v0.2.0...HEAD - -## [0.2.0-rc.1] - 2026-06-05 +## [0.2.0] - 2026-06-18 -[0.2.0-rc.1]: https://github.com/trussed-dev/trussed/releases/tag/v0.2.0-rc.1 +[0.2.0]: https://github.com/trussed-dev/trussed/releases/tag/v0.2.0 ### Added @@ -80,8 +80,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `flexiber` 0.2 - `heapless` 0.9 - `heapless-bytes` 0.5 - - `littlefs2` 0.7 - + - `littlefs2` 0.8 + ### Fixed - Fixed off-by-one error in `RandomBytes` request. @@ -101,6 +101,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Removed `TrussedInterchange` and `TRUSSED_INTERCHANGE` from `pipe`. - Removed the `clients-?` features. - Removed the `store!` macro. Embedded runners should provide their own implementation. Software runners can use `virt::StoreConfig` to create a `virt::Store`. +- Removed unconditional `Send` implementation for `Service`. [#64]: https://github.com/trussed-dev/trussed/issues/64 [#65]: https://github.com/trussed-dev/trussed/issues/65 diff --git a/Cargo.toml b/Cargo.toml index 74c2c397489..e635150a792 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ serde = { version = "1.0", default-features = false, features = ["derive"] } [package] name = "trussed" -version = "0.2.0-rc.1" +version = "0.2.0" description = "Modern Cryptographic Firmware" readme = "README.md" @@ -60,7 +60,7 @@ delog = "0.1.0" flexiber = { version = "0.2.0", features = ["derive", "heapless"], optional = true } heapless-bytes = { workspace = true, features = ["heapless-0.9"] } interchange = "0.3.0" -littlefs2 = "0.7.0" +littlefs2 = "0.8" littlefs2-core = { workspace = true, features = ["heapless-bytes05"] } p256-cortex-m4 = { version = "0.1.0-alpha.6", features = ["prehash", "sec1-signatures"], optional = true } salty = { version = "0.3", optional = true } @@ -79,7 +79,7 @@ once_cell = "1.13.0" serde_test = "1" sha2 = { version = "0.10", default-features = false } trussed-derive = { path = "derive" } -littlefs2 = "0.7" +littlefs2 = "0.8" # Somehow, this is causing a regression. # rand_core = { version = "0.5", features = ["getrandom"] } diff --git a/derive/src/util.rs b/derive/src/util.rs index 24ba5963b6c..c4bd27ac7ad 100644 --- a/derive/src/util.rs +++ b/derive/src/util.rs @@ -11,7 +11,7 @@ pub fn get_attr<'a>(attrs: &'a [Attribute], name: &'a str) -> Result( name: &'a str, ) -> Result<&'a Attribute> { get_attr(attrs, name)? - .ok_or_else(|| Error::new_spanned(span, format!("missing #[{}(...)] attribute", name))) + .ok_or_else(|| Error::new_spanned(span, format!("missing #[{name}(...)] attribute"))) } pub fn to_camelcase(ident: &Ident) -> Ident { diff --git a/src/tests.rs b/src/tests.rs index f6a79150290..719ad6c377c 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -60,7 +60,7 @@ impl crate::platform::UserInterface for UserInterface { } fn set_status(&mut self, status: ui::Status) { - println!("Set status: {:?}", status); + println!("Set status: {status:?}"); } fn refresh(&mut self) {} @@ -70,7 +70,7 @@ impl crate::platform::UserInterface for UserInterface { } fn reboot(&mut self, to: reboot::To) -> ! { - println!("Restart! ({:?})", to); + println!("Restart! ({to:?})"); std::process::exit(25); } @@ -277,14 +277,14 @@ fn sign_ed255() { println!("submitted gen ed255"); let reply = block!(future); let private_key = reply.expect("no errors, never").key; - println!("got a private key {:?}", &private_key); + println!("got a private key {private_key:?}"); let public_key = block!(client .derive_ed255_public_key(private_key, Location::Volatile) .expect("no client error")) .expect("no issues") .key; - println!("got a public key {:?}", &public_key); + println!("got a public key {public_key:?}"); assert!(block!(client .derive_ed255_public_key(private_key, Location::Volatile) @@ -301,7 +301,7 @@ fn sign_ed255() { .expect("no client error post err"); let reply: Result = block!(future); let signature = reply.expect("good signature").signature; - println!("got a signature: {:?}", &signature); + println!("got a signature: {signature:?}"); let future = client .verify_ed255(public_key, &message, &signature) @@ -329,13 +329,13 @@ fn sign_p256() { .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &private_key); + println!("got a public key {private_key:?}"); let public_key = block!(client .derive_p256_public_key(private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &public_key); + println!("got a public key {public_key:?}"); let message = [1u8, 2u8, 3u8]; let signature = block!(client @@ -350,7 +350,7 @@ fn sign_p256() { let future = future.expect("no client error"); let result = block!(future); if result.is_err() { - println!("error: {:?}", result); + println!("error: {result:?}"); } let reply = result.expect("valid signature"); let valid = reply.valid; @@ -369,26 +369,26 @@ fn agree_p256() { .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &plat_private_key); + println!("got a public key {plat_private_key:?}"); let plat_public_key = block!(client .derive_p256_public_key(plat_private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &plat_public_key); + println!("got a public key {plat_public_key:?}"); let auth_private_key = block!(client .generate_p256_private_key(Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &auth_private_key); + println!("got a public key {auth_private_key:?}"); let auth_public_key = block!(client .derive_p256_public_key(auth_private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &auth_public_key); + println!("got a public key {auth_public_key:?}"); let shared_secret = block!(client .agree( @@ -452,13 +452,13 @@ fn sign_p384() { .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &private_key); + println!("got a public key {private_key:?}"); let public_key = block!(client .derive_p384_public_key(private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &public_key); + println!("got a public key {public_key:?}"); let message = [1u8, 2u8, 3u8]; let signature = block!(client @@ -473,7 +473,7 @@ fn sign_p384() { let future = future.expect("no client error"); let result = block!(future); if result.is_err() { - println!("error: {:?}", result); + println!("error: {result:?}"); } let reply = result.expect("valid signature"); let valid = reply.valid; @@ -492,26 +492,26 @@ fn agree_p384() { .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &plat_private_key); + println!("got a public key {plat_private_key:?}"); let plat_public_key = block!(client .derive_p384_public_key(plat_private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &plat_public_key); + println!("got a public key {plat_public_key:?}"); let auth_private_key = block!(client .generate_p384_private_key(Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &auth_private_key); + println!("got a public key {auth_private_key:?}"); let auth_public_key = block!(client .derive_p384_public_key(auth_private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &auth_public_key); + println!("got a public key {auth_public_key:?}"); let shared_secret = block!(client .agree( @@ -575,13 +575,13 @@ fn sign_p521() { .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &private_key); + println!("got a public key {private_key:?}"); let public_key = block!(client .derive_p521_public_key(private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &public_key); + println!("got a public key {public_key:?}"); let message = [1u8, 2u8, 3u8]; let signature = block!(client @@ -596,7 +596,7 @@ fn sign_p521() { let future = future.expect("no client error"); let result = block!(future); if result.is_err() { - println!("error: {:?}", result); + println!("error: {result:?}"); } let reply = result.expect("valid signature"); let valid = reply.valid; @@ -615,26 +615,26 @@ fn agree_p521() { .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &plat_private_key); + println!("got a public key {plat_private_key:?}"); let plat_public_key = block!(client .derive_p521_public_key(plat_private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &plat_public_key); + println!("got a public key {plat_public_key:?}"); let auth_private_key = block!(client .generate_p521_private_key(Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &auth_private_key); + println!("got a public key {auth_private_key:?}"); let auth_public_key = block!(client .derive_p521_public_key(auth_private_key, Location::Volatile) .expect("no client error")) .expect("no errors") .key; - println!("got a public key {:?}", &auth_public_key); + println!("got a public key {auth_public_key:?}"); let shared_secret = block!(client .agree( @@ -706,7 +706,7 @@ fn aead_rng_nonce() { .expect("no errors") .key; - println!("got a key {:?}", &secret_key); + println!("got a key {secret_key:?}"); let message = b"test message"; let associated_data = b"solokeys.com"; @@ -751,7 +751,7 @@ fn aead_given_nonce() { .expect("no errors") .key; - println!("got a key {:?}", &secret_key); + println!("got a key {secret_key:?}"); let message = b"test message"; let associated_data = b"solokeys.com"; @@ -807,7 +807,7 @@ fn aead_given_nonce_2() { .expect("no errors") .key; - println!("got a key {:?}", &secret_key); + println!("got a key {secret_key:?}"); let message = b"test message"; let associated_data = b"solokeys.com"; @@ -862,7 +862,7 @@ fn aead() { .expect("no errors") .key; - println!("got a key {:?}", &secret_key); + println!("got a key {secret_key:?}"); let message = b"test message"; let associated_data = b"solokeys.com";