diff --git a/src/agent/Cargo.lock b/src/agent/Cargo.lock index ca24e461fd..5b5ea2f11b 100644 --- a/src/agent/Cargo.lock +++ b/src/agent/Cargo.lock @@ -302,9 +302,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" @@ -1472,7 +1472,7 @@ checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" dependencies = [ "anyhow", "async-channel", - "base64 0.13.0", + "base64 0.13.1", "futures-lite", "http", "infer", @@ -2211,7 +2211,7 @@ dependencies = [ "anyhow", "async-trait", "backoff", - "base64 0.13.0", + "base64 0.21.0", "bytes", "clap", "cpp_demangle", @@ -2929,7 +2929,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" dependencies = [ - "base64 0.13.0", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -3403,7 +3403,7 @@ dependencies = [ "anyhow", "async-trait", "backoff", - "base64 0.13.0", + "base64 0.21.0", "bincode", "bytes", "derivative", diff --git a/src/agent/onefuzz/Cargo.toml b/src/agent/onefuzz/Cargo.toml index 506cfb84ae..7d3ce68062 100644 --- a/src/agent/onefuzz/Cargo.toml +++ b/src/agent/onefuzz/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" [dependencies] anyhow = "1.0" async-trait = "0.1" -base64 = "0.13" +base64 = "0.21" bytes = "1.4" dunce = "1.0" dynamic-library = { path = "../dynamic-library" } diff --git a/src/agent/storage-queue/Cargo.toml b/src/agent/storage-queue/Cargo.toml index 5a00a60366..d5c1c09d08 100644 --- a/src/agent/storage-queue/Cargo.toml +++ b/src/agent/storage-queue/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" anyhow = "1.0" async-trait = "0.1" backoff = { version = "0.4", features = ["tokio"] } -base64 = "0.13" +base64 = "0.21" bytes = { version = "1.4", features = ["serde"] } derivative = "2.2" flume = "0.10" diff --git a/src/agent/storage-queue/src/azure_queue.rs b/src/agent/storage-queue/src/azure_queue.rs index 1ad24f4d01..9679f3e519 100644 --- a/src/agent/storage-queue/src/azure_queue.rs +++ b/src/agent/storage-queue/src/azure_queue.rs @@ -2,6 +2,7 @@ // Licensed under the MIT License. use anyhow::{Context, Result}; +use base64::Engine; use bytes::Buf; use reqwest::{Client, Url}; use reqwest_retry::SendRetry; @@ -11,6 +12,8 @@ use uuid::Uuid; pub const EMPTY_QUEUE_DELAY: Duration = Duration::from_secs(10); +const BASE64: base64::engine::GeneralPurpose = base64::engine::general_purpose::STANDARD; + // // // 7d35e47d-f58e-42da-ba4a-9e6ac7e1214d @@ -49,7 +52,7 @@ pub struct AzureQueueMessageSend { impl AzureQueueMessage { pub fn parse(&self, parser: impl FnOnce(&[u8]) -> Result) -> Result { - let decoded = base64::decode(&self.message_text)?; + let decoded = BASE64.decode(&self.message_text)?; parser(&decoded) } @@ -70,7 +73,7 @@ impl AzureQueueMessage { .error_for_status() .context("AzureQueueMessage.claim status body")?; } - let decoded = base64::decode(self.message_text)?; + let decoded = BASE64.decode(self.message_text)?; let value: T = serde_json::from_slice(&decoded)?; Ok(value) } @@ -96,7 +99,7 @@ impl AzureQueueMessage { } pub fn get(&self) -> Result { - let decoded = base64::decode(&self.message_text)?; + let decoded = BASE64.decode(&self.message_text)?; let value = serde_json::from_slice(&decoded)?; Ok(value) } @@ -132,7 +135,7 @@ impl AzureQueueClient { pub async fn enqueue(&self, data: impl Serialize) -> Result<()> { let serialized = serde_json::to_string(&data).unwrap(); let body = quick_xml::se::to_string(&AzureQueueMessageSend { - message_text: base64::encode(&serialized), + message_text: BASE64.encode(&serialized), }) .context("serializing queue message")?; diff --git a/src/proxy-manager/Cargo.lock b/src/proxy-manager/Cargo.lock index a5205a47ba..0abe8bc52c 100644 --- a/src/proxy-manager/Cargo.lock +++ b/src/proxy-manager/Cargo.lock @@ -150,12 +150,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - [[package]] name = "base64" version = "0.21.0" @@ -1174,7 +1168,7 @@ version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ - "base64 0.21.0", + "base64", "bytes", "encoding_rs", "futures-core", @@ -1430,7 +1424,7 @@ dependencies = [ "anyhow", "async-trait", "backoff", - "base64 0.13.0", + "base64", "bincode", "bytes", "derivative",