deps: update base64 requirement from 0.20.0 to 0.21.0

Pull-Request: #3315.
This commit is contained in:
dependabot[bot]
2023-02-24 00:36:59 +00:00
committed by GitHub
parent 19a554965f
commit 6383e1e8bd
8 changed files with 14 additions and 17 deletions

12
Cargo.lock generated
View File

@@ -469,12 +469,6 @@ version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "base64"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5"
[[package]]
name = "base64"
version = "0.21.0"
@@ -2090,7 +2084,7 @@ dependencies = [
name = "keygen"
version = "0.1.0"
dependencies = [
"base64 0.20.0",
"base64 0.21.0",
"clap 4.1.6",
"libp2p-core",
"serde",
@@ -2224,7 +2218,7 @@ version = "0.39.0"
dependencies = [
"asn1_der",
"async-std",
"base64 0.20.0",
"base64 0.21.0",
"bs58",
"criterion",
"ed25519-dalek",
@@ -2347,7 +2341,7 @@ version = "0.44.0"
dependencies = [
"async-std",
"asynchronous-codec",
"base64 0.20.0",
"base64 0.21.0",
"byteorder",
"bytes",
"env_logger 0.10.0",

View File

@@ -45,7 +45,7 @@ ring = { version = "0.16.9", features = ["alloc", "std"], default-features = fal
[dev-dependencies]
async-std = { version = "1.6.2", features = ["attributes"] }
base64 = "0.20.0"
base64 = "0.21.0"
criterion = "0.4"
libp2p-mplex = { path = "../muxers/mplex" }
libp2p-noise = { path = "../transports/noise" }

View File

@@ -331,6 +331,7 @@ impl TryFrom<keys_proto::PublicKey> for PublicKey {
#[cfg(test)]
mod tests {
use super::*;
use base64::prelude::*;
use std::str::FromStr;
#[test]
@@ -353,7 +354,7 @@ mod tests {
let expected_peer_id =
PeerId::from_str("12D3KooWEChVMMMzV8acJ53mJHrw1pQ27UAGkCxWXLJutbeUMvVu").unwrap();
let encoded = base64::decode(base_64_encoded).unwrap();
let encoded = BASE64_STANDARD.decode(base_64_encoded).unwrap();
let keypair = Keypair::from_protobuf_encoding(&encoded).unwrap();
let peer_id = keypair.public().to_peer_id();

View File

@@ -15,4 +15,4 @@ zeroize = "1"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.93"
libp2p-core = { version = "0.39.0", path = "../../core" }
base64 = "0.20.0"
base64 = "0.21.0"

View File

@@ -1,3 +1,4 @@
use base64::prelude::*;
use serde::{Deserialize, Serialize};
use std::error::Error;
use std::path::Path;
@@ -17,7 +18,7 @@ impl Config {
}
pub fn from_key_material(peer_id: PeerId, keypair: &Keypair) -> Result<Self, Box<dyn Error>> {
let priv_key = base64::encode(keypair.to_protobuf_encoding()?);
let priv_key = BASE64_STANDARD.encode(keypair.to_protobuf_encoding()?);
let peer_id = peer_id.to_base58();
Ok(Self {
identity: Identity { peer_id, priv_key },

View File

@@ -1,3 +1,4 @@
use base64::prelude::*;
use std::error::Error;
use std::path::PathBuf;
use std::str::{self, FromStr};
@@ -54,7 +55,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let config = Zeroizing::new(config::Config::from_file(config.as_ref())?);
let keypair = identity::Keypair::from_protobuf_encoding(&Zeroizing::new(
base64::decode(config.identity.priv_key.as_bytes())?,
BASE64_STANDARD.decode(config.identity.priv_key.as_bytes())?,
))?;
let peer_id = keypair.public().into();

View File

@@ -22,7 +22,7 @@ asynchronous-codec = "0.6"
unsigned-varint = { version = "0.7.0", features = ["asynchronous_codec"] }
log = "0.4.11"
sha2 = "0.10.0"
base64 = "0.20.0"
base64 = "0.21.0"
smallvec = "1.6.1"
prost = "0.11"
prost-codec = { version = "0.3", path = "../../misc/prost-codec" }

View File

@@ -19,7 +19,7 @@
// DEALINGS IN THE SOFTWARE.
use crate::rpc_proto;
use base64::encode;
use base64::prelude::*;
use prometheus_client::encoding::EncodeLabelSet;
use prost::Message;
use sha2::{Digest, Sha256};
@@ -56,7 +56,7 @@ impl Hasher for Sha256Hash {
topic_descripter
.encode(&mut bytes)
.expect("buffer is large enough");
let hash = encode(Sha256::digest(&bytes).as_slice());
let hash = BASE64_STANDARD.encode(Sha256::digest(&bytes));
TopicHash { hash }
}
}