From b473500b72cf053f7a5616c41752422a02a3d305 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 20 Dec 2024 11:03:53 +0100 Subject: [PATCH] Use trussed-core and remove default features for trussed --- CHANGELOG.md | 1 + Cargo.toml | 15 ++++++++------- src/extension.rs | 2 +- src/extension/reply.rs | 5 +---- src/extension/request.rs | 2 +- src/lib.rs | 6 +++--- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 380f5ab..5b43a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use serde(rename) to save space on on the size of stored credentials ([#38][]) - Remove the `dat` intermediary directory in file storage ([#39][]) +- Use `trussed-core` and remove default features for `trussed` [#38]: https://github.com/trussed-dev/trussed-auth/pull/38 [#39]: https://github.com/trussed-dev/trussed-auth/pull/39 diff --git a/Cargo.toml b/Cargo.toml index 79eb7f4..a85acbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,21 +19,22 @@ serde = { version = "1", default-features = false } serde-byte-array = "0.1.2" sha2 = { version = "0.10.6", default-features = false } subtle = { version = "2.4.1", default-features = false } -trussed = { version = "0.1.0", features = ["serde-extensions"] } +trussed = { version = "0.1.0", default-features = false, features = ["serde-extensions"] } +trussed-core = { version = "0.1.0-rc.1", features = ["serde-extensions"] } littlefs2-core = "0.1.0" [dev-dependencies] quickcheck = { version = "1.0.3", default-features = false } rand_core = { version = "0.6.4", default-features = false, features = ["getrandom"] } serde_test = "1.0.176" -trussed = { version = "0.1.0", features = ["serde-extensions", "virt"] } +trussed = { version = "0.1.0", default-features = false, features = ["crypto-client", "filesystem-client", "hmac-sha256", "serde-extensions", "virt"] } admin-app = { version = "0.1.0", features = ["migration-tests"] } serde_cbor = { version = "0.11.2", features = ["std"] } hex-literal = "0.4.1" [patch.crates-io] -trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "046478b7a4f6e2315acf9112d98308379c2e3eee" } -trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" } -ctaphid-dispatch = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", rev = "57cb3317878a8593847595319aa03ef17c29ec5b" } -admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.18" } -cbor-smol = { git = "https://github.com/Nitrokey/cbor-smol.git", tag = "v0.4.0-nitrokey.2" } +trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "6bba8fde36d05c0227769eb63345744e87d84b2b" } +trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", rev = "9355f700831c1a278c334f76382fbf98d82aedcd" } +ctaphid-app = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", branch = "release-app-v0.1.0-rc.1" } +ctaphid-dispatch = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", branch = "release-app-v0.1.0-rc.1" } +admin-app = { git = "https://github.com/Nitrokey/admin-app.git", branch = "trussed-core" } diff --git a/src/extension.rs b/src/extension.rs index 416a443..b9793cb 100644 --- a/src/extension.rs +++ b/src/extension.rs @@ -7,7 +7,7 @@ pub mod reply; pub mod request; use serde::{Deserialize, Serialize}; -use trussed::{ +use trussed_core::{ serde_extensions::{Extension, ExtensionClient, ExtensionResult}, types::{KeyId, Message}, }; diff --git a/src/extension/reply.rs b/src/extension/reply.rs index e2f878d..e4cd7f3 100644 --- a/src/extension/reply.rs +++ b/src/extension/reply.rs @@ -2,10 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 or MIT use serde::{Deserialize, Serialize}; -use trussed::{ - error::{Error, Result}, - types::KeyId, -}; +use trussed_core::{types::KeyId, Error, Result}; use super::AuthReply; diff --git a/src/extension/request.rs b/src/extension/request.rs index e46d2b7..5b4fdfe 100644 --- a/src/extension/request.rs +++ b/src/extension/request.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 or MIT use serde::{Deserialize, Serialize}; -use trussed::types::{KeyId, Message}; +use trussed_core::types::{KeyId, Message}; use super::AuthRequest; use crate::{Pin, PinId}; diff --git a/src/lib.rs b/src/lib.rs index ff79928..121d707 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,7 @@ //! # Examples //! //! ``` -//! use trussed::{Bytes, syscall}; +//! use trussed_core::{types::Bytes, syscall}; //! use trussed_auth::{AuthClient, PinId}; //! //! #[repr(u8)] @@ -69,7 +69,7 @@ use core::str::FromStr; use littlefs2_core::{path, Path, PathBuf}; use serde::{Deserialize, Serialize}; -use trussed::{config::MAX_SHORT_DATA_LENGTH, types::Bytes}; +use trussed_core::{config::MAX_SHORT_DATA_LENGTH, types::Bytes}; pub use backend::{AuthBackend, AuthContext, FilesystemLayout, MAX_HW_KEY_LEN}; pub use extension::{ @@ -174,7 +174,7 @@ impl FromStr for PinId { #[cfg(test)] mod tests { use super::PinId; - use trussed::types::PathBuf; + use trussed_core::types::PathBuf; #[test] fn pin_id_path() {