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 2ceed58 commit ac9af7e
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 62 deletions.
115 changes: 68 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ delog = { version = "0.1.6", features = ["std-log"] }
cbor-smol = "0.5.0"
heapless-bytes = { version = "0.3.0" }
heapless = "0.7"
littlefs2 = "0.5"
serde = { version = "1.0", default-features = false }
serde-indexed = "0.1.0"
serde_bytes = { version = "0.11.10", default-features = false, features=["alloc"] }
Expand Down Expand Up @@ -50,7 +51,7 @@ admin-app = { version = "0.1", features = ["log-all"] }

# extensions
trussed-rsa-alloc = { version = "0.2.0", features = ["virt"] }
trussed-auth = "0.2.2"
trussed-auth = "0.3"


[features]
Expand Down Expand Up @@ -100,23 +101,24 @@ ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch", tag =
#apdu-dispatch = { git = "https://github.com/Nitrokey/apdu-dispatch.git", branch="sz-multiple-apps" }

# forked
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.16" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.21" }
admin-app = { git = "https://github.com/Nitrokey/admin-app.git", branch = "littlefs2" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", branch = "littlefs2" }
cbor-smol = { git = "https://github.com/trussed-dev/cbor-smol.git", rev = "d499e527f1214b2998b844720f0d41a9d05be7e1" }

# unreleased upstream changes
littlefs2 = { git = "https://github.com/sosthene-nitrokey/littlefs2.git", rev = "2b45a7559ff44260c6dd693e4cb61f54ae5efc53" }
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "b548d379dcbd67d29453d94847b7bc33ae92e673" }
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.git", branch = "littlefs2" }
usbd-ctaphid = { git = "https://github.com/Nitrokey/usbd-ctaphid", tag = "v0.1.0-nitrokey.1" }

# unreleased crates
trussed-fs-info = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "fs-info-v0.1.0" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", rev = "62235294bd63977bbb88eb01e7ac44b8010eb450" }
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", branch = "littlefs2" }
trussed-chunked = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "chunked-v0.1.0" }
trussed-hkdf = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "hkdf-v0.2.0" }
trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" }
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.2.0" }
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "v0.3.1" }
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", branch = "littlefs2" }
trussed-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner", tag = "v0.0.1-nitrokey.1" }

# Local development
Expand Down
3 changes: 2 additions & 1 deletion src/lib/commands.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use cbor_smol::cbor_deserialize;
use littlefs2::path;
use heapless::Vec;

use heapless_bytes::{Bytes, Bytes32};
Expand Down Expand Up @@ -1017,7 +1018,7 @@ where
syscall!(w.trussed.delete_all(w.options.location));
syscall!(w
.trussed
.remove_dir_all(w.options.location, PathBuf::from("wcrk"),));
.remove_dir_all(w.options.location, PathBuf::from(path!("wcrk")),));

#[cfg(feature = "transparent-encryption")]
{
Expand Down
7 changes: 4 additions & 3 deletions src/lib/rk_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Imported from the https://github.com/solokeys/fido-authenticator/ project

use heapless_bytes::Bytes;
use littlefs2::path;
use trussed::types::PathBuf;

#[inline(never)]
Expand All @@ -22,8 +23,8 @@ pub fn rp_rk_dir(rp_id_hash: &Bytes<32>) -> PathBuf {
let mut hex = [b'0'; 16];
format_hex(&rp_id_hash[..8], &mut hex);

let mut dir = PathBuf::from(b"wcrk");
dir.push(&PathBuf::from(&hex));
let mut dir = PathBuf::from(path!("wcrk"));
dir.push(&PathBuf::try_from(&hex).unwrap());

dir
}
Expand All @@ -34,7 +35,7 @@ pub fn rk_path(rp_id_hash: &Bytes<32>, credential_id_hash: &Bytes<32>) -> PathBu

let mut hex = [0u8; 16];
format_hex(&credential_id_hash[..8], &mut hex);
path.push(&PathBuf::from(&hex));
path.push(&PathBuf::try_from(&hex).unwrap());

path
}
Loading

0 comments on commit ac9af7e

Please sign in to comment.