diff --git a/Cargo.toml b/Cargo.toml index e2ec682..0240237 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ hmac = "0.12.1" rand_core = "0.6.4" serde = { version = "1", default-features = false } serde-byte-array = "0.1.2" +serde-indexed = "0.1.0" sha2 = { version = "0.10.6", default-features = false } subtle = { version = "2.4.1", default-features = false } trussed = { version = "0.1.0", features = ["serde-extensions"] } @@ -27,5 +28,7 @@ rand_core = { version = "0.6.4", default-features = false, features = ["getrando trussed = { version = "0.1.0", features = ["serde-extensions", "virt"] } [patch.crates-io] -littlefs2 = { git = "https://github.com/Nitrokey/littlefs2", tag = "v0.3.2-nitrokey-2" } -trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "df720980888e3e0d5487250bd14a28db02a5f13b" } +littlefs2 = { git = "https://github.com/trussed-dev/littlefs2", rev = "ebd27e49ca321089d01d8c9b169c4aeb58ceeeca" } +trussed = { git = "https://github.com/Nitrokey/trussed.git", tag = "v0.1.0-nitrokey.17" } +serde-indexed = { git = "https://github.com/nitrokey/serde-indexed.git", rev = "37ba220526961fb8ba067d3fa18ee620337bb73b" } +cbor-smol = { git = "https://github.com/sosthene-nitrokey/cbor-smol.git", rev = "327f723d53263d4ac1da368660de4fe4aa8ebef8" } diff --git a/src/backend/data.rs b/src/backend/data.rs index 5e79feb..2970af4 100644 --- a/src/backend/data.rs +++ b/src/backend/data.rs @@ -106,19 +106,20 @@ pub(crate) type Key = ByteArray; /// to_presistent_storage(salt, wrapped_key); /// } /// ```` -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, serde_indexed::SerializeIndexed)] struct WrappedKeyData { wrapped_key: Key, tag: ChaChaTag, } +// No need for using SerializeIndexed, cbor_smol already does it for enums #[derive(Debug, Deserialize, Serialize)] enum KeyOrHash { Key(WrappedKeyData), Hash(Hash), } -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, serde_indexed::SerializeIndexed)] pub(crate) struct PinData { #[serde(skip)] id: PinId,