Skip to content

Commit bd87a91

Browse files
roypatJonathanWoollett-Light
authored andcommitted
chore: update base64 dependency from 0.13.0 to 0.21.0
It seems that dependabot is not monitoring our library crate .toml files, as our top-level Cargo.toml only specifies the binary crates as workspace members. Signed-off-by: Patrick Roy <[email protected]>
1 parent 4d66562 commit bd87a91

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/vmm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ vm-superio = "0.7.0"
3434
vm-memory = { version = "0.13.1", features = ["backend-mmap", "backend-bitmap"] }
3535
log = { version = "0.4.17", features = ["std", "serde"] }
3636
aes-gcm = { version = "0.10.1", default-features = false, features = ["aes"] }
37-
base64 = "0.13.0"
37+
base64 = "0.21.0"
3838
bincode = "1.2.1"
3939
micro_http = { git = "https://github.com/firecracker-microvm/micro-http" }
4040
log-instrument = { path = "../log-instrument", optional = true }

src/vmm/src/mmds/token.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::path::Path;
99
use std::{fmt, io};
1010

1111
use aes_gcm::{AeadInPlace, Aes256Gcm, Key, KeyInit, Nonce};
12+
use base64::Engine;
1213
use bincode::{DefaultOptions, Error as BincodeError, Options};
1314
use serde::{Deserialize, Serialize};
1415
use utils::time::{get_time_ms, ClockType};
@@ -289,12 +290,13 @@ impl Token {
289290
let token_bytes: Vec<u8> = bincode::serialize(self)?;
290291

291292
// Encode token structure bytes into base64.
292-
Ok(base64::encode_config(token_bytes, base64::STANDARD))
293+
Ok(base64::engine::general_purpose::STANDARD.encode(token_bytes))
293294
}
294295

295296
/// Decode token structure from base64 string.
296297
fn base64_decode(encoded_token: &str) -> Result<Self, Error> {
297-
let token_bytes = base64::decode_config(encoded_token, base64::STANDARD)
298+
let token_bytes = base64::engine::general_purpose::STANDARD
299+
.decode(encoded_token)
298300
.map_err(|_| Error::ExpiryExtraction)?;
299301

300302
let token: Token = DefaultOptions::new()

0 commit comments

Comments
 (0)