From 03169adf142e00c08cf1d3ea0e175e98551e035a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 7 Jan 2023 10:37:55 +0100 Subject: [PATCH] chore: Update oo7 dependency --- Cargo.lock | 160 +++++++++++++++----------------------------------- Cargo.toml | 2 +- src/secret.rs | 10 +++- 3 files changed, 56 insertions(+), 116 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d10b185f..e8391d3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,7 @@ dependencies = [ "cfg-if 1.0.0", "cipher 0.4.3", "cpufeatures", + "zeroize", ] [[package]] @@ -128,7 +129,7 @@ dependencies = [ "tokio", "tracing", "url", - "zbus 3.6.2", + "zbus", ] [[package]] @@ -209,17 +210,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72faff1fdc615a0199d7bf71e6f389af54d46a66e9beb5d76c39e48eda93ecce" -[[package]] -name = "async-recursion" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7d78656ba01f1b93024b7c3a0467f1608e4be67d725749fdcd7d2c7678fd7a2" -dependencies = [ - "proc-macro2 1.0.49", - "quote 1.0.23", - "syn 1.0.107", -] - [[package]] name = "async-recursion" version = "1.0.0" @@ -563,6 +553,7 @@ checksum = "d1873270f8f7942c191139cb8a40fd228da6c3fd2fc376d7e92d47aa14aeb59e" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] @@ -1112,7 +1103,7 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin", + "spin 0.9.4", ] [[package]] @@ -2037,7 +2028,7 @@ dependencies = [ "http", "httpdate", "mime", - "sha1 0.10.5", + "sha1", ] [[package]] @@ -2409,6 +2400,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "lazycell" @@ -2473,6 +2467,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" + [[package]] name = "libshumate" version = "0.2.0" @@ -2978,19 +2978,6 @@ dependencies = [ "void", ] -[[package]] -name = "nix" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nix" version = "0.25.1" @@ -3050,6 +3037,24 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2399c9463abc5f909349d8aa9ba080e0b88b3ce2885389b60b993f39b1a56905" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "serde", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.4.2" @@ -3180,9 +3185,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "oo7" -version = "0.1.0-alpha.5" +version = "0.1.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e614140b3625a16ddde5880e5c6429d4ef901883256edf496cceb62af1c7b6f8" +checksum = "e4f5c1adb228ec32be41e9589f8383713592a65097ae3530ecaa15b4fbf0595c" dependencies = [ "aes", "byteorder", @@ -3190,10 +3195,11 @@ dependencies = [ "cipher 0.4.3", "digest 0.10.6", "dirs", - "futures", + "futures-util", "hkdf", "hmac", "num", + "num-bigint-dig", "once_cell", "pbkdf2", "rand 0.8.5", @@ -3201,7 +3207,7 @@ dependencies = [ "sha2 0.10.6", "tokio", "tracing", - "zbus 2.3.2", + "zbus", "zeroize", ] @@ -3265,16 +3271,6 @@ dependencies = [ "paste", ] -[[package]] -name = "ordered-stream" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44630c059eacfd6e08bdaa51b1db2ce33119caa4ddc1235e923109aa5f25ccb1" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "ordered-stream" version = "0.1.2" @@ -4258,15 +4254,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1" version = "0.10.5" @@ -4278,12 +4265,6 @@ dependencies = [ "digest 0.10.6", ] -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "sha2" version = "0.9.9" @@ -4422,6 +4403,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.4" @@ -5323,46 +5310,6 @@ dependencies = [ "markup5ever 0.11.0", ] -[[package]] -name = "zbus" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8f1a037b2c4a67d9654dc7bdfa8ff2e80555bbefdd3c1833c1d1b27c963a6b" -dependencies = [ - "async-broadcast", - "async-channel", - "async-executor", - "async-io", - "async-lock", - "async-recursion 0.3.2", - "async-task", - "async-trait", - "byteorder", - "derivative", - "dirs", - "enumflags2", - "event-listener", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "lazy_static", - "nix 0.23.2", - "once_cell", - "ordered-stream 0.0.1", - "rand 0.8.5", - "serde", - "serde_repr", - "sha1 0.6.1", - "static_assertions", - "tracing", - "uds_windows", - "winapi", - "zbus_macros 2.3.2", - "zbus_names", - "zvariant", -] - [[package]] name = "zbus" version = "3.6.2" @@ -5374,7 +5321,7 @@ dependencies = [ "async-executor", "async-io", "async-lock", - "async-recursion 1.0.0", + "async-recursion", "async-task", "async-trait", "byteorder", @@ -5389,34 +5336,21 @@ dependencies = [ "lazy_static", "nix 0.25.1", "once_cell", - "ordered-stream 0.1.2", + "ordered-stream", "rand 0.8.5", "serde", "serde_repr", - "sha1 0.10.5", + "sha1", "static_assertions", "tokio", "tracing", "uds_windows", "winapi", - "zbus_macros 3.6.2", + "zbus_macros", "zbus_names", "zvariant", ] -[[package]] -name = "zbus_macros" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8fb5186d1c87ae88cf234974c240671238b4a679158ad3b94ec465237349a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2 1.0.49", - "quote 1.0.23", - "regex", - "syn 1.0.107", -] - [[package]] name = "zbus_macros" version = "3.6.2" diff --git a/Cargo.toml b/Cargo.toml index 842c2752..60940d6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ serde = "1.0.130" serde_json = "1.0" tokio = { version = "1.15", features = ["rt", "rt-multi-thread", "sync"] } url = "2.2" -oo7 = { version = "=0.1.0-alpha.5", default-features = false, features = [ +oo7 = { version = "0.1.0-beta.2", default-features = false, features = [ "tokio", "tracing", ] } diff --git a/src/secret.rs b/src/secret.rs index 0a19f9d7..20dcca5a 100644 --- a/src/secret.rs +++ b/src/secret.rs @@ -52,7 +52,8 @@ impl UserFacingError for oo7::portal::Error { oo7::portal::Error::NoData | oo7::portal::Error::MacError | oo7::portal::Error::HashedAttributeMac(_) | - oo7::portal::Error::GVariantDeserialization(_) => gettext( + oo7::portal::Error::GVariantDeserialization(_) | + oo7::portal::Error::SaltSizeMismatch(_, _) => gettext( "The secret storage file is corrupted.", ), oo7::portal::Error::NoParentDir(_) | @@ -66,7 +67,7 @@ impl UserFacingError for oo7::portal::Error { "The secret storage file has been changed by another process.", ), oo7::portal::Error::PortalBus(_) => gettext( - "An unknown error occurred when interacting with the D-Bus Secret Service.", + "An unknown error occurred when interacting with the D-Bus Secret Portal backend.", ), oo7::portal::Error::CancelledPortalRequest => gettext( "The request to the Flatpak Secret Portal was cancelled. Make sure to accept any prompt asking to access it.", @@ -74,6 +75,11 @@ impl UserFacingError for oo7::portal::Error { oo7::portal::Error::PortalNotAvailable => gettext( "The Flatpak Secret Portal is not available. Make sure xdg-desktop-portal is installed, and it is at least at version 1.5.0.", ), + oo7::portal::Error::WeakKey(_) => gettext( + "The Flatpak Secret Portal provided a key that is too weak to be secure.", + ), + // Can only occur when using the `replace_item_index` or `delete_item_index` methods. + oo7::portal::Error::InvalidItemIndex(_) => unreachable!(), } } }