Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rust] bump crates to base64 0.22 #28225

Merged
merged 3 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/brave_shields/adblock/rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license = "MPL-2.0"

[dependencies]
adblock = { version = "0.9.5-brave-core", default-features = false, features = ["full-regex-handling", "regex-debug-info", "css-validation"] }
adblock = { version = "0.9.6-brave-core", default-features = false, features = ["full-regex-handling", "regex-debug-info", "css-validation"] }
cxx = "1.0"
serde_json = "1.0"
thiserror = "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
license = "MPL-2.0"

[dependencies]
challenge-bypass-ristretto = { version = "2.0.0", features = ["base64"] }
challenge-bypass-ristretto = { version = "2.0.2", features = ["base64"] }
cxx = { version = "1.0" }
derive_more = "0.99"
hmac = "0.12"
Expand Down
2 changes: 1 addition & 1 deletion components/filecoin/rs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ rust_static_library("rust_lib") {
cxx_bindings = [ "src/lib.rs" ]

deps = [
"//brave/third_party/rust/base64/v0_13:lib",
"//brave/third_party/rust/blake2b_simd/v1:lib",
"//brave/third_party/rust/bls_signatures/v0_15:lib",
"//brave/third_party/rust/cid/v0_11:lib",
Expand All @@ -27,6 +26,7 @@ rust_static_library("rust_lib") {
"//brave/third_party/rust/libsecp256k1/v0_7:lib",
"//brave/third_party/rust/multihash_codetable/v0_1:lib",
"//brave/third_party/rust/thiserror/v1:lib",
"//third_party/rust/base64/v0_22:lib",
"//third_party/rust/serde/v1:lib",
"//third_party/rust/serde_json/v1:lib",
]
Expand Down
4 changes: 2 additions & 2 deletions components/filecoin/rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ edition = "2018"
license = "MPL-2.0"

[dependencies]
base64 = "0.13.0"
base64 = "0.22"
bls-signatures = { version = "0.15", default-features = false, features = ["pairing"] }
cxx = "1"
fvm_shared = { version = "4.5.1" }
libsecp256k1 = "0.7"
libsecp256k1 = "0.7.2"
num_bigint_chainsafe = { package = "forest_bigint", version = "0.1.2"}
serde = { version = "^1.0.117", features = ["derive"] }
serde_json = "^1.0.59"
Expand Down
6 changes: 3 additions & 3 deletions components/filecoin/rs/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ pub mod tokenamount {
}

pub mod rawbytes {
use base64::{decode, encode};
use base64::prelude::*;
use fvm_ipld_encoding::RawBytes;
use serde::{de, Deserialize, Deserializer, Serializer};

pub fn serialize<S>(raw: &RawBytes, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
let s = encode(raw.bytes());
let s = BASE64_STANDARD.encode(raw.bytes());
serializer.serialize_str(&s)
}

Expand All @@ -78,7 +78,7 @@ pub mod rawbytes {
D: Deserializer<'de>,
{
let s = String::deserialize(deserializer)?;
let raw = decode(s).map_err(de::Error::custom)?;
let raw = BASE64_STANDARD.decode(s).map_err(de::Error::custom)?;
Ok(RawBytes::new(raw))
}
}
Expand Down
3 changes: 2 additions & 1 deletion components/filecoin/rs/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// You can obtain one at https://mozilla.org/MPL/2.0/.

use crate::message::MessageAPI;
use base64::prelude::*;
use blake2b_simd::Params;
use bls_signatures::Serialize;
use core::{array::TryFromSliceError, num::ParseIntError};
Expand Down Expand Up @@ -138,7 +139,7 @@ pub fn transaction_sign(is_mainnet: bool, transaction: &str, private_key: &[u8])
if let Ok(message_user_api) = message_user_api {
let raw_signature = transaction_sign_raw(&message_user_api, &sk);
if let Ok(raw_signature) = raw_signature {
return base64::encode(raw_signature.bytes());
return BASE64_STANDARD.encode(raw_signature.bytes());
}
}
// Empty string is returned as an error cause this code is executed from cxx
Expand Down
2 changes: 1 addition & 1 deletion components/p3a/constellation/rs/cxx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
license = "MPL-2.0"

[dependencies]
star-constellation = "0.2.3"
star-constellation = "0.2.5"
cxx = "1"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion components/skus/browser/rs/lib/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ rust_static_library("rust_lib") {

deps = [
"//brave/third_party/rust/async_trait/v0_1:lib",
"//brave/third_party/rust/base64/v0_13:lib",
"//brave/third_party/rust/bigdecimal/v0_1:lib",
"//brave/third_party/rust/challenge_bypass_ristretto/v2:lib",
"//brave/third_party/rust/chrono/v0_4:lib",
Expand All @@ -37,6 +36,7 @@ rust_static_library("rust_lib") {
"//brave/third_party/rust/tracing/v0_1:lib",
"//brave/third_party/rust/urlencoding/v1:lib",
"//brave/third_party/rust/uuid/v1:lib",
"//third_party/rust/base64/v0_22:lib",
"//third_party/rust/rand/v0_8:lib",
"//third_party/rust/serde/v1:lib",
"//third_party/rust/serde_json/v1:lib",
Expand Down
4 changes: 2 additions & 2 deletions components/skus/browser/rs/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ bigdecimal = { version = "0.1", features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }
chrono = { version = "0.4", default-features = false, features = ["now", "serde"] }
uuid = { version = "1", features = ["v4"] }
challenge-bypass-ristretto = { version = "2.0.0", features = ["serde_base64"] }
challenge-bypass-ristretto = { version = "2.0.2", features = ["serde_base64"] }
futures-retry = "0.5.0"
urlencoding = "1.1.1"
hmac = "0.12"
base64 = "0.13.0"
base64 = "0.22"
git-version = { version = "0.3.5", optional = true }

[dev-dependencies]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use base64::prelude::*;
use chrono::{NaiveDateTime, Utc};
use hmac::Hmac;
use http::uri;
Expand Down Expand Up @@ -113,7 +114,7 @@ where
"{}",
tlv2_cred.valid_to.format("%a, %d %b %Y %H:%M:%S GMT")
)),
base64::encode(&serde_json::to_vec(&redemption)?),
BASE64_STANDARD.encode(&serde_json::to_vec(&redemption)?),
)
}
CredentialType::SingleUse => {
Expand Down Expand Up @@ -145,7 +146,7 @@ where
"t": cred.unblinded_cred.t,
"signature": signature,
});
let presentation = base64::encode(&redemption.to_string());
let presentation = BASE64_STANDARD.encode(&redemption.to_string());

self.client.spend_single_use_item_cred(&item.id, i).await?;

Expand All @@ -172,7 +173,7 @@ where
"{}",
cred.expires_at.format("%a, %d %b %Y %H:%M:%S GMT")
)),
base64::encode(&serde_json::to_vec(&presentation)?),
BASE64_STANDARD.encode(&serde_json::to_vec(&presentation)?),
)
}
};
Expand All @@ -183,7 +184,7 @@ where
CredentialType::SingleUse => ("single-use", 1),
};

let payload = urlencoding::encode(&base64::encode(&serde_json::to_vec(
let payload = urlencoding::encode(&BASE64_STANDARD.encode(&serde_json::to_vec(
&VerifyCredentialRequest {
credential_type: item.credential_type,
version,
Expand Down
52 changes: 26 additions & 26 deletions third_party/rust/adblock/v0_9/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,37 @@ cargo_crate("lib") {
crate_name = "adblock"
epoch = "0.9"
crate_type = "rlib"
crate_root = "//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/lib.rs"
crate_root = "//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/lib.rs"
sources = [
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/blocker.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/content_blocking.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/cosmetic_filter_cache.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/data_format/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/data_format/utils.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/data_format/v0.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/engine.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/filters/cosmetic.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/filters/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/filters/network.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/lib.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/lists.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/optimizer.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/regex_manager.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/request.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/resources/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/resources/resource_assembler.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/resources/resource_storage.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/url_parser/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/url_parser/parser.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/url_parser/parser_full.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/url_parser/parser_regex.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/src/utils.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/blocker.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/content_blocking.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/cosmetic_filter_cache.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/data_format/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/data_format/utils.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/data_format/v0.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/engine.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/filters/cosmetic.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/filters/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/filters/network.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/lib.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/lists.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/optimizer.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/regex_manager.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/request.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/resources/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/resources/resource_assembler.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/resources/resource_storage.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/url_parser/mod.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/url_parser/parser.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/url_parser/parser_full.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/url_parser/parser_regex.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/src/utils.rs",
]
inputs = []

build_native_rust_unit_tests = false
edition = "2021"
cargo_pkg_version = "0.9.5-brave-core"
cargo_pkg_version = "0.9.6-brave-core"
cargo_pkg_authors = "Anton Lazarev <[email protected]>, Andrius Aucinas"
cargo_pkg_name = "adblock"
cargo_pkg_description = "Native Rust module for Adblock Plus syntax (e.g. EasyList, EasyPrivacy) filter parsing and matching."
Expand All @@ -54,7 +54,7 @@ cargo_crate("lib") {
proc_macro_configs -= [ "//build/config/compiler:chromium_code" ]
proc_macro_configs += [ "//build/config/compiler:no_chromium_code" ]
deps = [
"//brave/third_party/rust/base64/v0_13:lib",
"//brave/third_party/rust/base64/v0_22:lib",
"//brave/third_party/rust/bitflags/v1:lib",
"//brave/third_party/rust/cssparser/v0_29:lib",
"//brave/third_party/rust/idna/v0_2:lib",
Expand Down
6 changes: 3 additions & 3 deletions third_party/rust/adblock/v0_9/README.chromium
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Name: adblock
URL: https://crates.io/crates/adblock
Version: 0.9.5-brave-core
Revision: c0dc258dd1fddbc24a049914b53a440d961ec189
Version: 0.9.6-brave-core
Revision: fd820a4d55d17ef2f7446adf2e5285687c4f5787
License: Mozilla-Public-License-2.0
License File: //brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.5-brave-core/LICENSE
License File: //brave/third_party/rust/chromium_crates_io/vendor/adblock-0.9.6-brave-core/LICENSE
Shipped: yes
Security Critical: yes

Expand Down
10 changes: 5 additions & 5 deletions third_party/rust/adss/v0_2/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ cargo_crate("lib") {
epoch = "0.2"
crate_type = "rlib"
crate_root =
"//brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.2/src/lib.rs"
"//brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.3/src/lib.rs"
sources = [
"//brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.2/src/lib.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.2/src/strobe_rng.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.3/src/lib.rs",
"//brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.3/src/strobe_rng.rs",
]
inputs = []

build_native_rust_unit_tests = false
edition = "2018"
cargo_pkg_version = "0.2.2"
cargo_pkg_version = "0.2.3"
cargo_pkg_authors = "eV <[email protected]>, Alex Davidson <[email protected]>"
cargo_pkg_name = "adss"
cargo_pkg_description = "Adept Secret Sharing framework"
Expand All @@ -37,7 +37,7 @@ cargo_crate("lib") {
"//brave/third_party/rust/rand/v0_8:lib",
"//brave/third_party/rust/rand_core/v0_6:lib",
"//brave/third_party/rust/star_sharks/v0_6:lib",
"//brave/third_party/rust/strobe_rs/v0_8:lib",
"//brave/third_party/rust/strobe_rs/v0_10:lib",
"//brave/third_party/rust/zeroize/v1:lib",
]
rustflags = [
Expand Down
6 changes: 3 additions & 3 deletions third_party/rust/adss/v0_2/README.chromium
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Name: adss
URL: https://crates.io/crates/adss
Version: 0.2.2
Revision: 1d8e088e9042d1183309d795d3259c99551e0cfa
Version: 0.2.3
Revision: 4b5267d1faad0cb8c6e656c3547a306ea8d1b89f
License: Mozilla-Public-License-2.0
License File: //brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.2/LICENSE
License File: //brave/third_party/rust/chromium_crates_io/vendor/adss-0.2.3/LICENSE
Shipped: yes
Security Critical: yes

Expand Down
52 changes: 0 additions & 52 deletions third_party/rust/base64/v0_13/BUILD.gn

This file was deleted.

3 changes: 3 additions & 0 deletions third_party/rust/base64/v0_22/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
group("lib") {
public_deps = [ "//third_party/rust/base64/v0_22:lib" ]
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Name: base64
URL: https://crates.io/crates/base64
Version: 0.13.1
Revision: efb0b531c79581978aec5c410d0ae866b21f8aac
Version: 0.22.1
License: Apache-2.0
License File: //brave/third_party/rust/chromium_crates_io/vendor/base64-0.13.1/LICENSE-APACHE
License File:
Shipped: yes
Security Critical: yes

Expand Down
2 changes: 2 additions & 0 deletions third_party/rust/bitvec/v1/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,14 @@ cargo_crate("lib") {
deps = [
"//brave/third_party/rust/funty/v2:lib",
"//brave/third_party/rust/radium/v0_7:lib",
"//brave/third_party/rust/serde/v1:lib",
"//brave/third_party/rust/tap/v1:lib",
"//brave/third_party/rust/wyz/v0_5:lib",
]
features = [
"alloc",
"atomic",
"serde",
"std",
]
rustflags = [
Expand Down
Loading
Loading