Skip to content

Commit

Permalink
Update littlefs2 to v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Oct 22, 2024
1 parent afbf6b8 commit 312a08d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ heapless = "0.7"
heapless-bytes = "0.3"
hex-literal = "0.3"
iso7816 = "0.1.3"
littlefs2 = "0.5"
serde = { version = "1", default-features = false }
trussed = { version = "0.1", features = ["clients-3"] }
encrypted_container = { path = "components/encrypted_container" }
Expand Down Expand Up @@ -53,6 +54,7 @@ log-error = []
[patch.crates-io]
ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch", tag = "v0.1.1-nitrokey.2" }
flexiber = { git = "https://github.com/Nitrokey/flexiber", tag = "0.1.1.nitrokey" }
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "ebd27e49ca321089d01d8c9b169c4aeb58ceeeca" }
trussed = { git = "https://github.com/Nitrokey/trussed", tag = "v0.1.0-nitrokey.18" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", tag = "v0.3.0" }
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", branch = "release-0.5.0" }
littlefs2-core = { git = "https://github.com/trussed-dev/littlefs2.git", branch = "release-0.5.0" }
trussed = { git = "https://github.com/trussed-dev/trussed", branch = "littlefs2" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", branch = "littlefs2" }
5 changes: 3 additions & 2 deletions src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use core::time::Duration;
use flexiber::EncodableHeapless;
use heapless_bytes::Bytes;
use iso7816::{Data, Status};
use littlefs2::path;
use trussed::types::Location;
use trussed::types::{KeyId, Message};
use trussed::{self, client, syscall, try_syscall};
Expand Down Expand Up @@ -212,7 +213,7 @@ where
+ trussed_auth::AuthClient,
{
fn credential_directory() -> trussed::types::PathBuf {
trussed::types::PathBuf::from("cred")
trussed::types::PathBuf::from(path!("cred"))
}

/// Create new Authenticator instance
Expand Down Expand Up @@ -680,7 +681,7 @@ where
hex_filename[2 * i + 1] = LOOKUP[(value & 0xF) as usize];
}

let filename = trussed::types::PathBuf::from(hex_filename.as_ref());
let filename = trussed::types::PathBuf::try_from(hex_filename.as_ref()).unwrap();
let mut path = Self::credential_directory();
path.push(&filename);
info_now!("filename: {}", path.as_str_ref_with_trailing_nul());
Expand Down
5 changes: 3 additions & 2 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use core::convert::TryInto;
use core::time::Duration;

use iso7816::Status;
use littlefs2::path;
use serde::de::DeserializeOwned;
use serde::Serialize;

Expand All @@ -17,7 +18,7 @@ use trussed::client::FilesystemClient;
use trussed::types::Message;
use trussed::{
syscall, try_syscall,
types::{KeyId, Location, PathBuf},
types::{KeyId, Location, Path, PathBuf},
};

#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -75,7 +76,7 @@ impl Runtime {
impl Persistent {}

impl State {
const FILENAME: &'static str = "state.bin";
const FILENAME: &'static Path = path!("state.bin");

pub fn new(location: Location) -> Self {
Self {
Expand Down

0 comments on commit 312a08d

Please sign in to comment.