From 1c006830d2ea92108e39f24901a247099cc77b1d Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 1 Mar 2024 17:10:31 +0100 Subject: [PATCH] Update trussed --- Cargo.lock | 5 ++--- Cargo.toml | 3 ++- src/lib/commands.rs | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcbee34..a46072f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -830,8 +830,7 @@ checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "littlefs2" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95c72bdf63e7ad35f391e60c48e4c32560038f1d3a0dd97f90a2891ce09160bf" +source = "git+https://github.com/trussed-dev/littlefs2.git?rev=ebd27e49ca321089d01d8c9b169c4aeb58ceeeca#ebd27e49ca321089d01d8c9b169c4aeb58ceeeca" dependencies = [ "bitflags 1.3.2", "cstr_core", @@ -1674,7 +1673,7 @@ dependencies = [ [[package]] name = "trussed" version = "0.1.0" -source = "git+https://github.com/trussed-dev/trussed.git?rev=b1781805a2e33615d2d00b8bec80c0b1f5870ca1#b1781805a2e33615d2d00b8bec80c0b1f5870ca1" +source = "git+https://github.com/trussed-dev/trussed.git?rev=cff2e663841b6a68d3a8ce12647d57b2b6fbc36c#cff2e663841b6a68d3a8ce12647d57b2b6fbc36c" dependencies = [ "aes", "bitflags 2.4.1", diff --git a/Cargo.toml b/Cargo.toml index e34016b..3269af9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,7 +99,8 @@ serde-indexed = { git = "https://github.com/sosthene-nitrokey/serde-indexed.git" apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" } ctap-types = { git = "https://github.com/trussed-dev/ctap-types.git", rev = "7d4ad69e64ad308944c012aef5b9cfd7654d9be8" } iso7816 = { git = "https://github.com/Nitrokey/iso7816.git", tag = "v0.1.1-nitrokey.1" } -trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "b1781805a2e33615d2d00b8bec80c0b1f5870ca1" } +littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "ebd27e49ca321089d01d8c9b169c4aeb58ceeeca" } +trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "cff2e663841b6a68d3a8ce12647d57b2b6fbc36c" } usbd-ctaphid = { git = "https://github.com/Nitrokey/usbd-ctaphid", tag = "v0.1.0-nitrokey.1" } # unreleased crates diff --git a/src/lib/commands.rs b/src/lib/commands.rs index 2c2795f..c9ee0b2 100644 --- a/src/lib/commands.rs +++ b/src/lib/commands.rs @@ -177,7 +177,7 @@ where let wrapped_key = syscall!(w .trussed - .wrap_key_chacha8poly1305(wrapping_key, private_key, &appid)) + .wrap_key_chacha8poly1305(wrapping_key, private_key, &appid, None)) .wrapped_key; let nonce_2 = syscall!(w.trussed.random_bytes(12)); @@ -771,13 +771,15 @@ where .ok_or(Error::FailedLoadingData)?; // decrypt with shared secret - let decrypted = try_syscall!(w.trussed.decrypt_aes256cbc(serialized_reimported, req.data)) - .map_err(|_e| { - error!("Decryption error: {:?}", _e); - Error::FailedLoadingData - })? - .plaintext - .ok_or(Error::InternalError)?; + let decrypted = try_syscall!(w + .trussed + .decrypt_aes256cbc(serialized_reimported, req.data, &[])) + .map_err(|_e| { + error!("Decryption error: {:?}", _e); + Error::FailedLoadingData + })? + .plaintext + .ok_or(Error::InternalError)?; syscall!(w.trussed.delete(shared_secret)); syscall!(w.trussed.delete(serialized_reimported));