fix dependabot security issue in base64 dependency

This commit is contained in:
bunnie 2022-09-11 21:48:20 +08:00
parent 57291a47f2
commit b22e3a1b43
3 changed files with 5 additions and 5 deletions

6
Cargo.lock generated
View file

@ -211,9 +211,9 @@ checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa"
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.3.1" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33678aec1839cd59fbb29a90950baa95fc4a5464711a7858f5ba68dbc3d3eab2" checksum = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557"
dependencies = [ dependencies = [
"byteorder", "byteorder",
] ]
@ -4334,7 +4334,7 @@ dependencies = [
"argh", "argh",
"backup", "backup",
"base32", "base32",
"base64 0.3.1", "base64 0.5.2",
"cbor", "cbor",
"clap 3.2.12", "clap 3.2.12",
"ctaphid", "ctaphid",

View file

@ -20,7 +20,7 @@ log = "0.4.17"
env_logger = "0.9.0" env_logger = "0.9.0"
serde_repr = "0.1.9" serde_repr = "0.1.9"
url = "2.2.2" url = "2.2.2"
base64 = "0.3.0" base64 = "0.5.2"
base32 = "0.4.0" base32 = "0.4.0"
protobuf = "3.1.0" protobuf = "3.1.0"

View file

@ -90,7 +90,7 @@ pub fn otpauth_migration_to_entries(uri: &url::Url) -> Result<Vec<backup::TotpEn
for (k, v) in uri.query_pairs() { for (k, v) in uri.query_pairs() {
match k.as_ref() { match k.as_ref() {
"data" => { "data" => {
let data = base64::decode(&v)?; let data = base64::decode(&v.into_owned())?;
let payload = otpauth_migration::MigrationPayload::parse_from_bytes(&data)?; let payload = otpauth_migration::MigrationPayload::parse_from_bytes(&data)?;
for param in payload.otp_parameters { for param in payload.otp_parameters {
entries.push(migration_payload_to_entry(param)?) entries.push(migration_payload_to_entry(param)?)