From 77f9691e13958ae9863db0e8428cc799e33b0fb4 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 7 Mar 2025 00:18:57 +0000 Subject: [PATCH 1/3] Update Rust crate bincode to v2.0.0 --- Cargo.lock | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19dc1e8..b71ecd6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,19 +87,20 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bincode" -version = "2.0.0-rc.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" +checksum = "3ad1fa75f77bbd06f187540aa1d70ca50b80b27ce85e7f41c0ce7ff42b34ed3b" dependencies = [ "bincode_derive", "serde", + "unty", ] [[package]] name = "bincode_derive" -version = "2.0.0-rc.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30759b3b99a1b802a7a3aa21c85c3ded5c28e1c83170d82d70f08bbf7f3e4c" +checksum = "b1cef5dd4a4457dd11529e743d18ba4fabbd5f20b6895f4c865cb257337dcf9f" dependencies = [ "virtue", ] @@ -1381,6 +1382,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unty" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a88342087869553c259588a3ec9ca73ce9b2d538b7051ba5789ff236b6c129" + [[package]] name = "url" version = "2.5.4" @@ -1424,9 +1431,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "virtue" -version = "0.0.13" +version = "0.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" [[package]] name = "want" -- 2.47.2 From 0cfae95d7e1b418a4e58d1a096488ac7601092cc Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 10 Mar 2025 18:23:07 +0000 Subject: [PATCH 2/3] Attempt to fix breaking change of bincode 2.0.0 --- src/crypto_wrapper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto_wrapper.rs b/src/crypto_wrapper.rs index 2343e08..7be9767 100644 --- a/src/crypto_wrapper.rs +++ b/src/crypto_wrapper.rs @@ -26,7 +26,7 @@ impl CryptoWrapper { } /// Encrypt some data, returning the result as a base64-encoded string - pub fn encrypt(&self, data: &T) -> Result> { + pub fn encrypt>(&self, data: &T) -> Result> { let aes_key = Aes256Gcm::new(&self.key); let nonce_bytes = rand::rng().random::<[u8; NONCE_LEN]>(); @@ -41,7 +41,7 @@ impl CryptoWrapper { } /// Decrypt some data previously encrypted using the [`CryptoWrapper::encrypt`] method - pub fn decrypt(&self, input: &str) -> Result> { + pub fn decrypt>(&self, input: &str) -> Result> { let bytes = BASE64_STANDARD.decode(input)?; if bytes.len() < NONCE_LEN { -- 2.47.2 From a82310dbc4f58ac956ee4cae430a1e1810ca747f Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 10 Mar 2025 18:28:03 +0000 Subject: [PATCH 3/3] Update src/crypto_wrapper.rs --- src/crypto_wrapper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto_wrapper.rs b/src/crypto_wrapper.rs index 7be9767..c65d4d6 100644 --- a/src/crypto_wrapper.rs +++ b/src/crypto_wrapper.rs @@ -26,7 +26,7 @@ impl CryptoWrapper { } /// Encrypt some data, returning the result as a base64-encoded string - pub fn encrypt>(&self, data: &T) -> Result> { + pub fn encrypt>(&self, data: &T) -> Result> { let aes_key = Aes256Gcm::new(&self.key); let nonce_bytes = rand::rng().random::<[u8; NONCE_LEN]>(); @@ -41,7 +41,7 @@ impl CryptoWrapper { } /// Decrypt some data previously encrypted using the [`CryptoWrapper::encrypt`] method - pub fn decrypt>(&self, input: &str) -> Result> { + pub fn decrypt>(&self, input: &str) -> Result> { let bytes = BASE64_STANDARD.decode(input)?; if bytes.len() < NONCE_LEN { -- 2.47.2