Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-') }}
Expand Down
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 }
Expand All @@ -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"] }

Expand Down
4 changes: 2 additions & 2 deletions derive/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn get_attr<'a>(attrs: &'a [Attribute], name: &'a str) -> Result<Option<&'a
if let Some(next) = attrs.next() {
Err(Error::new_spanned(
next,
format!("multiple {} attributes are not supported", name),
format!("multiple {name} attributes are not supported"),
))
} else {
Ok(first)
Expand All @@ -24,7 +24,7 @@ pub fn require_attr<'a>(
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 {
Expand Down
60 changes: 30 additions & 30 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand All @@ -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);
}

Expand Down Expand Up @@ -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)
Expand All @@ -301,7 +301,7 @@ fn sign_ed255() {
.expect("no client error post err");
let reply: Result<api::reply::Sign, _> = 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)
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
Loading