From 48a72771ca986187361d8235c779dded5d394bb7 Mon Sep 17 00:00:00 2001 From: Peter Michael Green Date: Thu, 15 Jun 2023 02:27:41 +0100 Subject: [PATCH] Bump base64 dependency to 0.21 and fix code to build with it Make debian dependency on base64 match the versioning in Cargo.toml. Signed-off-by: Ian Jackson --- Cargo.toml | 2 +- client/client.rs | 2 +- debian/control | 2 +- server/sweb.rs | 2 +- src/prelude.rs | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 16f9cd7..ebb5c77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ hippotat-macros = { version = "1.1.3", path = "macros" } # versions specified here are mostly just guesses at what is needed # (or currently available): backtrace = "0.3" -base64 = "0.13" # 0.20 has substantially incompatible API (there's no 0.14) +base64 = "0.21" # 0.20 has substantially incompatible API (there's no 0.14) clap = { version = "3", features = ["derive"] } easy-ext = "1" educe = "0.4" diff --git a/client/client.rs b/client/client.rs index 77a8164..0f03a6a 100644 --- a/client/client.rs +++ b/client/client.rs @@ -71,7 +71,7 @@ fn submit_request<'r, 'c:'r, C:Hcc>( //dbg!(DumpHex(&hmac)); let mut token = time_t; write!(token, " ").unwrap(); - base64::encode_config_buf(hmac, BASE64_CONFIG, &mut token); + BASE64_CONFIG.encode_string(hmac, &mut token); let req_num = { *req_num += 1; *req_num }; diff --git a/debian/control b/debian/control index be235c3..07fdcda 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 12), cargo, rustc, python3-sphinx, moreutils, libssl-dev (>= 1.1), pkg-config, # debian/update-build-deps manages these: librust-backtrace-dev , - librust-base64-dev , + librust-base64-0.21-dev , librust-clap-3+derive-dev , librust-easy-ext-dev , librust-educe-dev , diff --git a/server/sweb.rs b/server/sweb.rs index 3d0c29e..dc962c1 100644 --- a/server/sweb.rs +++ b/server/sweb.rs @@ -121,7 +121,7 @@ pub async fn handle( let time_t = u64::from_str_radix(time_t, 16).context("parse time_t")?; let l = io::copy( &mut base64::read::DecoderReader::new(&mut hmac_b64.as_bytes(), - BASE64_CONFIG), + &BASE64_CONFIG), &mut &mut hmac_got[..] ).context("parse b64 token")?; let l = l.try_into()?; diff --git a/src/prelude.rs b/src/prelude.rs index 1057345..799c27c 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -83,6 +83,7 @@ pub const SLIP_MIME_ESC: u8 = b'-'; // 2d pub const MAX_OVERHEAD: usize = 2_000; -pub use base64::STANDARD as BASE64_CONFIG; +pub use base64::engine::Engine; +pub use base64::engine::general_purpose::STANDARD as BASE64_CONFIG; pub fn default() -> T { Default::default() } -- 2.30.2