Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump trussed to 0.2.0 #23

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
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