Skip to content

Commit

Permalink
Bump trussed to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Apr 23, 2023
1 parent d3e1753 commit 9dc0485
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ctap-types = "0.1.0"
delog = "0.1.0"
heapless = "0.7"
interchange = "0.2.0"
littlefs2 = "0.3.1"
serde = { version = "1.0", default-features = false }
serde_cbor = { version = "0.11.0", default-features = false }
serde-indexed = "0.1.0"
Expand Down Expand Up @@ -44,3 +43,6 @@ rand = "0.8.4"

[package.metadata.docs.rs]
features = ["dispatch"]

[patch.crates-io]
trussed = { git = "https://github.com/trussed-dev/trussed", rev = "55ea391367fce4bf5093ff2d3c79041d7aef0485" }
3 changes: 2 additions & 1 deletion src/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ impl Credential {
let nonce: [u8; 12] = self.nonce.as_slice().try_into().unwrap();
let encrypted_serialized_credential = EncryptedSerializedCredential(syscall!(trussed
.encrypt_chacha8poly1305(key_encryption_key, message, associated_data, Some(&nonce))));
let credential_id: CredentialId = encrypted_serialized_credential.try_into()
let credential_id: CredentialId = encrypted_serialized_credential
.try_into()
.map_err(|_| Error::RequestTooLarge)?;

Ok(credential_id)
Expand Down
4 changes: 1 addition & 3 deletions src/ctap2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ use ctap_types::{
sizes, Error,
};

use littlefs2::path::Path;

use trussed::{
syscall, try_syscall,
types::{
KeyId, KeySerialization, Location, Mechanism, MediumData, Message, PathBuf,
KeyId, KeySerialization, Location, Mechanism, MediumData, Message, Path, PathBuf,
SignatureSerialization,
},
};
Expand Down
4 changes: 1 addition & 3 deletions src/ctap2/credential_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::convert::TryFrom;

use trussed::{
syscall,
types::{DirEntry, Location},
types::{DirEntry, Location, Path, PathBuf},
};

use ctap_types::{
Expand All @@ -15,8 +15,6 @@ use ctap_types::{
Error,
};

use littlefs2::path::{Path, PathBuf};

use crate::{
credential::Credential,
state::{CredentialManagementEnumerateCredentials, CredentialManagementEnumerateRps},
Expand Down
4 changes: 1 addition & 3 deletions src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ where

// Goal of these nested scopes is to keep stack small.
let ctap_response = {
let ctap_request = {
ctap1::Request::try_from(command)?
};
let ctap_request = { ctap1::Request::try_from(command)? };
ctap1::Authenticator::call_ctap1(authenticator, &ctap_request)?
};
// debug!("1b SP: {:X}", msp());
Expand Down
3 changes: 1 addition & 2 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ use ctap_types::{
};
use trussed::{
client, syscall, try_syscall,
types::{self, KeyId, Location, Mechanism},
types::{self, KeyId, Location, Mechanism, PathBuf},
Client as TrussedClient,
};

use heapless::binary_heap::{BinaryHeap, Max};
use littlefs2::path::PathBuf;

use crate::{cbor_serialize_message, credential::Credential, Result};

Expand Down

0 comments on commit 9dc0485

Please sign in to comment.