diff --git a/Cargo.toml b/Cargo.toml index 0dcb81a..ac0898d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,5 +18,6 @@ trussed-core = { version = "0.1.0-rc.1", features = ["serde-extensions"] } [patch.crates-io] trussed-auth = { path = "extension" } -trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "6bba8fde36d05c0227769eb63345744e87d84b2b" } -admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.19" } +# trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "6bba8fde36d05c0227769eb63345744e87d84b2b" } +trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "refs/pull/207/head" } +admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.20" } diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 20fcd60..0813f42 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -32,4 +32,4 @@ quickcheck = { version = "1.0.3", default-features = false } rand_core = { version = "0.6.4", default-features = false, features = ["getrandom"] } serde_cbor = { version = "0.11.2", features = ["std"] } serde_test = "1.0.176" -trussed = { version = "0.1.0", default-features = false, features = ["clients-1", "crypto-client", "filesystem-client", "hmac-sha256", "serde-extensions", "virt"] } +trussed = { version = "0.1.0", default-features = false, features = ["crypto-client", "filesystem-client", "hmac-sha256", "serde-extensions", "virt"] } diff --git a/backend/src/lib.rs b/backend/src/lib.rs index 7b59adc..cfccec1 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -366,7 +366,9 @@ impl ExtensionImpl for AuthBackend { let app_key = self.get_app_key(client_id, global_fs, ctx, rng)?; let key_to_wrap = keystore.load_key(Secrecy::Secret, Some(Kind::Symmetric(32)), &request.key)?; - let key_to_wrap = (&*key_to_wrap.material) + let key_to_wrap = key_to_wrap + .material + .as_slice() .try_into() .map_err(|_| Error::ReadFailed)?; PinData::reset_with_key( diff --git a/backend/tests/backend.rs b/backend/tests/backend.rs index b788f59..daa4b2b 100644 --- a/backend/tests/backend.rs +++ b/backend/tests/backend.rs @@ -134,19 +134,17 @@ use littlefs2_core::path; use rand_core::{OsRng, RngCore as _}; use trussed::{ backend::BackendId, - client::{ClientImplementation, FilesystemClient, HmacSha256}, - service::Service, + client::{FilesystemClient, HmacSha256}, syscall, try_syscall, types::{Bytes, Location, Message, PathBuf}, - virt::{self, Ram}, + virt::{self, StoreConfig}, }; use trussed_auth::{AuthClient as _, PinId}; use trussed_auth_backend::MAX_HW_KEY_LEN; use dispatch::{Backend, Dispatch, BACKENDS}; -type Platform = virt::Platform; -type Client = ClientImplementation, Dispatch>; +type Client<'a> = virt::Client<'a, Dispatch>; enum Pin { User, @@ -170,20 +168,20 @@ impl From for PinId { } } -fn run(backends: &'static [BackendId], f: F) { - virt::with_platform(Ram::default(), |platform| { +fn run)>(backends: &'static [BackendId], f: F) { + virt::with_platform(StoreConfig::ram(), |platform| { platform.run_client_with_backends("test", Dispatch::new(), backends, |mut client| { f(&mut client) }) }) } -fn run_with_hw_key( +fn run_with_hw_key)>( backends: &'static [BackendId], hw_key: Bytes<{ MAX_HW_KEY_LEN }>, f: F, ) { - virt::with_platform(Ram::default(), |platform| { + virt::with_platform(StoreConfig::ram(), |platform| { platform.run_client_with_backends( "test", Dispatch::with_hw_key(hw_key), @@ -193,8 +191,11 @@ fn run_with_hw_key( }) } -fn run_with_missing_hw_key(backends: &'static [BackendId], f: F) { - virt::with_platform(Ram::default(), |platform| { +fn run_with_missing_hw_key)>( + backends: &'static [BackendId], + f: F, +) { + virt::with_platform(StoreConfig::ram(), |platform| { platform.run_client_with_backends( "test", Dispatch::with_missing_hw_key(),