diff --git a/Cargo.toml b/Cargo.toml index 3d3f760..3efc459 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,6 @@ tss-esapi = { version = "7.2", features = ["generate-bindings"] } serde = "1.0" josekit = "0.7.4" serde_json = "1.0" -base64 = "0.12.1" +base64 = "0.22.0" atty = "0.2.14" tpm2-policy = "0.6.0" diff --git a/src/utils.rs b/src/utils.rs index a411140..23c8813 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -3,6 +3,7 @@ use std::fs; use std::str::FromStr; use anyhow::{Context as anyhow_context, Result}; +use base64::Engine; use serde::Deserialize; use tpm2_policy::{PublicKey, SignedPolicyList, TPMPolicyStep}; use tss_esapi::{ @@ -68,7 +69,7 @@ pub(crate) fn serialize_as_base64_url_no_pad( where S: serde::Serializer, { - serializer.serialize_str(&base64::encode_config(bytes, base64::URL_SAFE_NO_PAD)) + serializer.serialize_str(&base64::engine::general_purpose::URL_SAFE_NO_PAD.encode(bytes)) } pub(crate) fn deserialize_as_base64_url_no_pad<'de, D>(deserializer: D) -> Result, D::Error> @@ -76,7 +77,9 @@ where D: serde::Deserializer<'de>, { String::deserialize(deserializer).and_then(|string| { - base64::decode_config(&string, base64::URL_SAFE_NO_PAD).map_err(serde::de::Error::custom) + base64::engine::general_purpose::URL_SAFE_NO_PAD + .decode(string) + .map_err(serde::de::Error::custom) }) }