Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Jul 24, 2024
1 parent e016b25 commit c5371af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ log-warn = []
log-error = []

[patch.crates-io]
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "45ed62ba97d994aa6e05e2b61cea013ef131caa4" }
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "ebd27e49ca321089d01d8c9b169c4aeb58ceeeca" }
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "a055e4f79a10122c8c0c882161442e6e02f0c5c6" }
littlefs2 = { git = "https://github.com/trussed-dev/littlefs2.git", rev = "960e57d9fc0d209308c8e15dc26252bbe1ff6ba8" }

trussed-chunked = { path = "extensions/chunked" }
trussed-hkdf = { path = "extensions/hkdf" }
Expand Down
2 changes: 1 addition & 1 deletion src/wrap_key_to_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn unwrap_key_from_file(
let nonce = (&*nonce).try_into().unwrap();
let tag = (&*tag).try_into().unwrap();

let key = keystore.load_key(key::Secrecy::Secret, Some(KIND), &request.key)?;
let key = keystore.load_key(Secrecy::Secret, Some(KIND), &request.key)?;
let chachakey: [u8; KEY_LEN] = (&*key.material).try_into().unwrap();
let mut aead = ChaCha8Poly1305::new(&GenericArray::clone_from_slice(&chachakey));
if aead
Expand Down
8 changes: 6 additions & 2 deletions tests/wrap_key_to_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,28 @@ fn chacha_wrapkey() {
let key2 = syscall!(client.generate_secret_key(32, Volatile)).key;

let wrapped =
syscall!(client.wrap_key(Mechanism::Chacha8Poly1305, key, key2, &[])).wrapped_key;
syscall!(client.wrap_key(Mechanism::Chacha8Poly1305, key, key2, &[], None)).wrapped_key;
let unwrapped = syscall!(client.unwrap_key(
Mechanism::Chacha8Poly1305,
key,
wrapped,
&[],
&[],
StorageAttributes::new()
))
.key
.unwrap();
assert_key_eq(key2, unwrapped, client);

let wrapped_ad =
syscall!(client.wrap_key(Mechanism::Chacha8Poly1305, key, key2, b"abc")).wrapped_key;
syscall!(client.wrap_key(Mechanism::Chacha8Poly1305, key, key2, b"abc", None))
.wrapped_key;
assert!(syscall!(client.unwrap_key(
Mechanism::Chacha8Poly1305,
key,
wrapped_ad.clone(),
&[],
&[],
StorageAttributes::new()
))
.key
Expand All @@ -76,6 +79,7 @@ fn chacha_wrapkey() {
key,
wrapped_ad,
b"abc",
&[],
StorageAttributes::new()
))
.key
Expand Down

0 comments on commit c5371af

Please sign in to comment.