diff --git a/Cargo.lock b/Cargo.lock index a9dbb5c483..7bf2a6c00e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4369,7 +4369,7 @@ name = "nym-cli" version = "1.1.40" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.22.1", "bip39", "bs58 0.5.1", "clap 4.5.16", @@ -4394,7 +4394,7 @@ name = "nym-cli-commands" version = "1.0.0" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.22.1", "bip39", "bs58 0.5.1", "cfg-if", @@ -4485,7 +4485,7 @@ name = "nym-client-core" version = "1.1.15" dependencies = [ "async-trait", - "base64 0.21.7", + "base64 0.22.1", "bs58 0.5.1", "cfg-if", "clap 4.5.16", @@ -5487,7 +5487,7 @@ version = "0.1.0" dependencies = [ "axum 0.7.5", "axum-extra", - "base64 0.21.7", + "base64 0.22.1", "colored", "dashmap", "fastrand 2.1.1", @@ -5520,7 +5520,7 @@ name = "nym-node-requests" version = "0.1.0" dependencies = [ "async-trait", - "base64 0.21.7", + "base64 0.22.1", "celes", "humantime 2.1.0", "humantime-serde", @@ -5690,7 +5690,7 @@ dependencies = [ name = "nym-serde-helpers" version = "0.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bs58 0.5.1", "serde", ] @@ -6056,7 +6056,7 @@ dependencies = [ name = "nym-types" version = "1.0.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "cosmrs 0.17.0-pre", "cosmwasm-std", "eyre", @@ -6086,7 +6086,7 @@ name = "nym-validator-client" version = "0.1.0" dependencies = [ "async-trait", - "base64 0.13.1", + "base64 0.22.1", "bip32", "bip39", "colored", @@ -6204,7 +6204,7 @@ dependencies = [ name = "nym-wireguard" version = "0.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bincode", "chrono", "dashmap", @@ -6226,7 +6226,7 @@ dependencies = [ name = "nym-wireguard-types" version = "0.1.0" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "hmac", "log", "nym-config", diff --git a/Cargo.toml b/Cargo.toml index 15352251d5..2be451eb47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -171,7 +171,7 @@ argon2 = "0.5.0" async-trait = "0.1.81" axum = "0.7.5" axum-extra = "0.9.3" -base64 = "0.21.4" +base64 = "0.22.1" bincode = "1.3.3" bip39 = { version = "2.0.0", features = ["zeroize"] } diff --git a/common/client-libs/validator-client/Cargo.toml b/common/client-libs/validator-client/Cargo.toml index 2bf66895c0..dee9577516 100644 --- a/common/client-libs/validator-client/Cargo.toml +++ b/common/client-libs/validator-client/Cargo.toml @@ -9,7 +9,7 @@ license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -base64 = "0.13" +base64 = "0.22" colored = { workspace = true } nym-coconut-dkg-common = { path = "../../cosmwasm-smart-contracts/coconut-dkg" } diff --git a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs index c437125b16..b60b4982cd 100644 --- a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs +++ b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/helpers.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use crate::nyxd::error::NyxdError; +use base64::Engine; use cosmrs::abci::TxMsgData; use cosmrs::cosmwasm::MsgExecuteContractResponse; use cosmrs::proto::cosmos::base::query::v1beta1::{PageRequest, PageResponse}; @@ -16,7 +17,7 @@ pub fn parse_msg_responses(data: Bytes) -> Vec { // it seems that currently, on wasmd 0.43 + tendermint-rs 0.37 + cosmrs 0.17.0-pre // the data is left in undecoded base64 form, but I'd imagine this might change so if the decoding fails, // use the bytes directly instead - let data = if let Ok(decoded) = base64::decode(&data) { + let data = if let Ok(decoded) = base64::prelude::BASE64_STANDARD.decode(&data) { decoded } else { error!("failed to base64-decode the 'data' field of the TxResponse - has the chain been upgraded and introduced some breaking changes?"); diff --git a/common/client-libs/validator-client/src/rpc/reqwest.rs b/common/client-libs/validator-client/src/rpc/reqwest.rs index 973fb63376..e20764d162 100644 --- a/common/client-libs/validator-client/src/rpc/reqwest.rs +++ b/common/client-libs/validator-client/src/rpc/reqwest.rs @@ -3,6 +3,7 @@ use crate::rpc::TendermintRpcClient; use async_trait::async_trait; +use base64::Engine; use cosmrs::tendermint::{block::Height, evidence::Evidence, Hash}; use reqwest::header::HeaderMap; use reqwest::{header, RequestBuilder}; @@ -13,7 +14,6 @@ use tendermint_rpc::{ query::Query, Error, Order, Response, SimpleRequest, }; - use url::Url; // copied macro from tendermint-rpc crate because that's exactly what we have to do here too @@ -206,7 +206,7 @@ pub fn extract_authorization(url: &Url) -> Option { let authority = url.authority(); if let Some((userpass, _)) = authority.split_once('@') { - Some(base64::encode(userpass)) + Some(base64::prelude::BASE64_STANDARD.encode(userpass)) } else { None } diff --git a/common/commands/Cargo.toml b/common/commands/Cargo.toml index 2045cf0d2a..bab9b86a6e 100644 --- a/common/commands/Cargo.toml +++ b/common/commands/Cargo.toml @@ -7,7 +7,7 @@ license.workspace = true [dependencies] anyhow = { workspace = true } -base64 = "0.13.0" +base64 = "0.22.1" bip39 = { workspace = true } bs58 = { workspace = true } comfy-table = { workspace = true } diff --git a/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs b/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs index 21b026c85e..54d00010af 100644 --- a/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs +++ b/common/commands/src/validator/mixnet/operators/mixnode/keys/decode_mixnode_key.rs @@ -1,6 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 +use base64::Engine; use clap::Parser; #[derive(Debug, Parser)] @@ -10,7 +11,9 @@ pub struct Args { } pub fn decode_mixnode_key(args: Args) { - let b64_decoded = base64::decode(args.key).expect("failed to decode base64 string"); + let b64_decoded = base64::prelude::BASE64_STANDARD + .decode(args.key) + .expect("failed to decode base64 string"); let b58_encoded = bs58::encode(&b64_decoded).into_string(); println!("{b58_encoded}") diff --git a/tools/nym-cli/Cargo.toml b/tools/nym-cli/Cargo.toml index e590e45141..dc8e8990f9 100644 --- a/tools/nym-cli/Cargo.toml +++ b/tools/nym-cli/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license.workspace = true [dependencies] -base64 = "0.13.0" +base64 = "0.22.1" bs58 = { workspace = true } clap = { workspace = true, features = ["derive"] } clap_complete = { workspace = true }