From 620e594faa02eabaeb6013488eabc261368a8f5d Mon Sep 17 00:00:00 2001 From: rami3l Date: Sat, 22 Jun 2024 11:08:31 +0800 Subject: [PATCH 01/10] feat(download/rustls): use `aws-lc` instead of `ring` --- Cargo.lock | 174 +++++++++++++++++++++++++++++++++++++++++++- download/Cargo.toml | 2 +- download/src/lib.rs | 4 +- 3 files changed, 176 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cb1cd31c2..ad497e786b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,6 +162,33 @@ dependencies = [ "syn", ] +[[package]] +name = "aws-lc-rs" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7d844e282b4b56750b2d4e893b2205581ded8709fddd2b6aa5418c150ca877" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a2c29203f6bf296d01141cc8bb9dbd5ecd4c27843f2ee0767bcd5985a927da" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "axum" version = "0.6.20" @@ -234,6 +261,29 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.5.0", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -310,6 +360,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "0.1.10" @@ -331,6 +390,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.5.7" @@ -381,6 +451,15 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.1" @@ -708,6 +787,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures-channel" version = "0.3.30" @@ -1191,6 +1276,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.155" @@ -1207,6 +1298,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" +dependencies = [ + "cfg-if 1.0.0", + "windows-targets 0.48.5", +] + [[package]] name = "libm" version = "0.2.8" @@ -1275,6 +1376,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -1295,6 +1402,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "native-tls" version = "0.2.12" @@ -1323,6 +1436,16 @@ dependencies = [ "libc", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -1565,6 +1688,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1627,6 +1756,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -1922,6 +2061,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustix" version = "0.38.34" @@ -1941,9 +2086,9 @@ version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ + "aws-lc-rs", "log", "once_cell", - "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -2012,6 +2157,7 @@ version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -3007,6 +3153,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "winapi" version = "0.3.9" @@ -3287,6 +3445,20 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "zstd" diff --git a/download/Cargo.toml b/download/Cargo.toml index 4d59960770..ed590873f1 100644 --- a/download/Cargo.toml +++ b/download/Cargo.toml @@ -22,7 +22,7 @@ curl = { version = "0.4.44", optional = true } env_proxy = { version = "0.4.1", optional = true } once_cell = { workspace = true, optional = true } reqwest = { version = "0.12", default-features = false, features = ["blocking", "gzip", "socks", "stream"], optional = true } -rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "ring", "tls12"] } +rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "aws_lc_rs", "tls12"] } rustls-platform-verifier = { version = "0.3", optional = true } thiserror.workspace = true tokio = { workspace = true, default-features = false, features = ["sync"] } diff --git a/download/src/lib.rs b/download/src/lib.rs index 5fa4ac34df..381b1b2084 100644 --- a/download/src/lib.rs +++ b/download/src/lib.rs @@ -303,7 +303,7 @@ pub mod reqwest_be { use once_cell::sync::Lazy; use reqwest::{header, Client, ClientBuilder, Proxy, Response}; #[cfg(feature = "reqwest-rustls-tls")] - use rustls::crypto::ring; + use rustls::crypto::aws_lc_rs; use tokio_stream::StreamExt; use url::Url; @@ -359,7 +359,7 @@ pub mod reqwest_be { client_generic() .use_preconfigured_tls( rustls_platform_verifier::tls_config_with_provider(Arc::new( - ring::default_provider(), + aws_lc_rs::default_provider(), )) .expect("failed to initialize pre-configured rustls backend"), ) From 1f964b6703b150e288f390f935ae4480482e2c18 Mon Sep 17 00:00:00 2001 From: rami3l Date: Sat, 22 Jun 2024 11:28:28 +0800 Subject: [PATCH 02/10] ci(windows/msvc): install `nasm` and `ninja` for `aws-lc` --- .github/workflows/ci.yaml | 24 +++++++++++++++++++ .../windows-builds-template.yaml | 8 +++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a1f6593e2a..1758250707 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,6 +58,14 @@ jobs: New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' @@ -200,6 +208,14 @@ jobs: New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' @@ -348,6 +364,14 @@ jobs: New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index e931a1d8b3..1bf430f3ff 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -51,6 +51,14 @@ jobs: # skip-master skip-pr skip-stable New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force shell: powershell + - name: Install NASM + uses: ilammy/setup-nasm@v1 + if: matrix.mingwdir == '' + - name: Install ninja + if: matrix.mingwdir == '' + run: | + choco install ninja -y + ninja.exe --version - name: Install mingw uses: bwoodsend/setup-winlibs-action@v1 if: matrix.mingwdir != '' From 5077c0d444169dadcd5bcbf52a17d564fcf27458 Mon Sep 17 00:00:00 2001 From: rami3l Date: Sat, 22 Jun 2024 17:03:00 +0800 Subject: [PATCH 03/10] ci(linux): install `libclang` for `aws-lc` --- Cargo.lock | 2 +- ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad497e786b..7065d996b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cexpr", "clang-sys", "itertools 0.12.1", diff --git a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile index be14c039c0..a3ce6cf30e 100644 --- a/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile +++ b/ci/docker/armv7-unknown-linux-gnueabihf/Dockerfile @@ -1,4 +1,6 @@ FROM rust-armv7-unknown-linux-gnueabihf +RUN apt-get update && apt-get install -qy build-essential libclang-dev libc6-armhf-cross + ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \ - CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc + CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=armv7-unknown-linux-gnueabihf-gcc From f1cc01e6fcf693aff2dbe88dcc924a750b825f34 Mon Sep 17 00:00:00 2001 From: rami3l Date: Mon, 24 Jun 2024 20:09:31 +0800 Subject: [PATCH 04/10] build(download): enable the `bindgen` feature for `aws-lc-rs` --- Cargo.lock | 27 +++++++++++++++++++++++++-- download/Cargo.toml | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7065d996b7..fcba5ebbcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,15 +162,31 @@ dependencies = [ "syn", ] +[[package]] +name = "aws-lc-fips-sys" +version = "0.12.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5cc4286676d121ca5a2ce89e0d4ddbc2d660ac24bb17bc49607d700f49f993" +dependencies = [ + "bindgen", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] + [[package]] name = "aws-lc-rs" version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7d844e282b4b56750b2d4e893b2205581ded8709fddd2b6aa5418c150ca877" dependencies = [ + "aws-lc-fips-sys", "aws-lc-sys", "mirai-annotations", "paste", + "untrusted 0.7.1", "zeroize", ] @@ -628,6 +644,7 @@ name = "download" version = "1.27.1" dependencies = [ "anyhow", + "aws-lc-rs", "curl", "env_proxy", "http-body-util", @@ -2041,7 +2058,7 @@ dependencies = [ "getrandom", "libc", "spin", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -2160,7 +2177,7 @@ dependencies = [ "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -2970,6 +2987,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" diff --git a/download/Cargo.toml b/download/Cargo.toml index ed590873f1..d45eed3957 100644 --- a/download/Cargo.toml +++ b/download/Cargo.toml @@ -18,6 +18,7 @@ reqwest-rustls-tls = [ [dependencies] anyhow.workspace = true +aws-lc-rs = { version = "1.7", features = ["bindgen"] } curl = { version = "0.4.44", optional = true } env_proxy = { version = "0.4.1", optional = true } once_cell = { workspace = true, optional = true } From e8b5a773b68875aa9cb9325f7784915b4654bcdb Mon Sep 17 00:00:00 2001 From: rami3l Date: Fri, 28 Jun 2024 13:52:03 +0800 Subject: [PATCH 05/10] Revert "feat(download/rustls): use `rustls-platform-verifier`" This reverts commit fb662c560924f96623af5d0738e3ce4520b9bb3f. --- Cargo.lock | 144 ++++++++++++++++---------------------------- download/Cargo.toml | 8 +-- download/src/lib.rs | 10 +-- 3 files changed, 54 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcba5ebbcc..dbf9b40cee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -370,12 +370,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cexpr" version = "0.6.0" @@ -482,16 +476,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "content_inspector" version = "0.2.4" @@ -653,7 +637,6 @@ dependencies = [ "once_cell", "reqwest", "rustls", - "rustls-platform-verifier", "tempfile", "thiserror", "tokio", @@ -1129,6 +1112,7 @@ dependencies = [ "hyper 1.3.1", "hyper-util", "rustls", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -1249,26 +1233,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - [[package]] name = "jobserver" version = "0.1.31" @@ -1488,31 +1452,12 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-bigint" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1852,6 +1797,53 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -2017,7 +2009,9 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn", "rustls", + "rustls-native-certs", "rustls-pemfile", "rustls-pki-types", "serde", @@ -2106,6 +2100,7 @@ dependencies = [ "aws-lc-rs", "log", "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -2141,33 +2136,6 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" -[[package]] -name = "rustls-platform-verifier" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" -dependencies = [ - "core-foundation", - "core-foundation-sys", - "jni", - "log", - "once_cell", - "rustls", - "rustls-native-certs", - "rustls-platform-verifier-android", - "rustls-webpki", - "security-framework", - "security-framework-sys", - "webpki-roots", - "winapi", -] - -[[package]] -name = "rustls-platform-verifier-android" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" - [[package]] name = "rustls-webpki" version = "0.102.4" @@ -2300,7 +2268,6 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -3167,15 +3134,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "which" version = "4.4.2" diff --git a/download/Cargo.toml b/download/Cargo.toml index d45eed3957..1e3803f33d 100644 --- a/download/Cargo.toml +++ b/download/Cargo.toml @@ -9,12 +9,7 @@ default = ["reqwest-backend", "reqwest-rustls-tls", "reqwest-native-tls"] curl-backend = ["curl"] reqwest-backend = ["reqwest", "env_proxy"] reqwest-native-tls = ["reqwest/native-tls", "dep:once_cell"] -reqwest-rustls-tls = [ - "reqwest/rustls-tls-manual-roots-no-provider", - "dep:rustls", - "dep:rustls-platform-verifier", - "dep:once_cell", -] +reqwest-rustls-tls = ["reqwest/rustls-tls-native-roots", "dep:rustls", "dep:once_cell"] [dependencies] anyhow.workspace = true @@ -24,7 +19,6 @@ env_proxy = { version = "0.4.1", optional = true } once_cell = { workspace = true, optional = true } reqwest = { version = "0.12", default-features = false, features = ["blocking", "gzip", "socks", "stream"], optional = true } rustls = { version = "0.23", optional = true, default-features = false, features = ["logging", "aws_lc_rs", "tls12"] } -rustls-platform-verifier = { version = "0.3", optional = true } thiserror.workspace = true tokio = { workspace = true, default-features = false, features = ["sync"] } tokio-stream.workspace = true diff --git a/download/src/lib.rs b/download/src/lib.rs index 381b1b2084..d9ce924c76 100644 --- a/download/src/lib.rs +++ b/download/src/lib.rs @@ -294,8 +294,6 @@ pub mod reqwest_be { compile_error!("Must select a reqwest TLS backend"); use std::io; - #[cfg(feature = "reqwest-rustls-tls")] - use std::sync::Arc; use std::time::Duration; use anyhow::{anyhow, Context, Result}; @@ -356,13 +354,9 @@ pub mod reqwest_be { #[cfg(feature = "reqwest-rustls-tls")] static CLIENT_RUSTLS_TLS: Lazy = Lazy::new(|| { let catcher = || { + let _ = aws_lc_rs::default_provider().install_default(); client_generic() - .use_preconfigured_tls( - rustls_platform_verifier::tls_config_with_provider(Arc::new( - aws_lc_rs::default_provider(), - )) - .expect("failed to initialize pre-configured rustls backend"), - ) + .use_rustls_tls() .user_agent(super::REQWEST_RUSTLS_TLS_USER_AGENT) .build() }; From 3e7b23a4b0a2162c3271e10d2bd0365b3fd13755 Mon Sep 17 00:00:00 2001 From: rami3l Date: Sat, 29 Jun 2024 08:44:49 +0800 Subject: [PATCH 06/10] Apply Cargo patch --- Cargo.lock | 17 +++++++---------- Cargo.toml | 3 +++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbf9b40cee..6077950052 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -164,9 +164,8 @@ dependencies = [ [[package]] name = "aws-lc-fips-sys" -version = "0.12.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5cc4286676d121ca5a2ce89e0d4ddbc2d660ac24bb17bc49607d700f49f993" +version = "0.12.10" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#fef6a89ff97782e0ed098fc317a4c7c493629060" dependencies = [ "bindgen", "cmake", @@ -178,9 +177,8 @@ dependencies = [ [[package]] name = "aws-lc-rs" -version = "1.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7d844e282b4b56750b2d4e893b2205581ded8709fddd2b6aa5418c150ca877" +version = "1.8.0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#fef6a89ff97782e0ed098fc317a4c7c493629060" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", @@ -192,9 +190,8 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a2c29203f6bf296d01141cc8bb9dbd5ecd4c27843f2ee0767bcd5985a927da" +version = "0.19.0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#fef6a89ff97782e0ed098fc317a4c7c493629060" dependencies = [ "bindgen", "cc", @@ -1286,7 +1283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8c992eb2d5..248b700bfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,6 +152,9 @@ tracing-subscriber = "0.3.16" url = "2.4" walkdir = "2" +[patch.crates-io] +aws-lc-rs = { git = "https://github.com/justsmth/aws-lc-rs.git", branch = "more-windows-tests" } + [lib] name = "rustup" path = "src/lib.rs" From c37e568fdca85b90c068c99c9ee066bfda5032c4 Mon Sep 17 00:00:00 2001 From: rami3l Date: Mon, 1 Jul 2024 21:49:37 +0800 Subject: [PATCH 07/10] Update cargo patch --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6077950052..090d9a66c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ dependencies = [ [[package]] name = "aws-lc-fips-sys" version = "0.12.10" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#fef6a89ff97782e0ed098fc317a4c7c493629060" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#be7bc67c52c58e6b40de3d057589ab19e6ade4af" dependencies = [ "bindgen", "cmake", @@ -178,7 +178,7 @@ dependencies = [ [[package]] name = "aws-lc-rs" version = "1.8.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#fef6a89ff97782e0ed098fc317a4c7c493629060" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#be7bc67c52c58e6b40de3d057589ab19e6ade4af" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", @@ -191,7 +191,7 @@ dependencies = [ [[package]] name = "aws-lc-sys" version = "0.19.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#fef6a89ff97782e0ed098fc317a4c7c493629060" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#be7bc67c52c58e6b40de3d057589ab19e6ade4af" dependencies = [ "bindgen", "cc", @@ -1283,7 +1283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] From f2260a73e084826cb427eadfb4be6f26cfeb079c Mon Sep 17 00:00:00 2001 From: rami3l Date: Mon, 1 Jul 2024 21:49:37 +0800 Subject: [PATCH 08/10] Update cargo patch --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 090d9a66c1..4fce25a2d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ dependencies = [ [[package]] name = "aws-lc-fips-sys" version = "0.12.10" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#be7bc67c52c58e6b40de3d057589ab19e6ade4af" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#3c235d9ae22f0a2df1e15b02bf5852845321f494" dependencies = [ "bindgen", "cmake", @@ -178,7 +178,7 @@ dependencies = [ [[package]] name = "aws-lc-rs" version = "1.8.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#be7bc67c52c58e6b40de3d057589ab19e6ade4af" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#3c235d9ae22f0a2df1e15b02bf5852845321f494" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", @@ -191,7 +191,7 @@ dependencies = [ [[package]] name = "aws-lc-sys" version = "0.19.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#be7bc67c52c58e6b40de3d057589ab19e6ade4af" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#3c235d9ae22f0a2df1e15b02bf5852845321f494" dependencies = [ "bindgen", "cc", @@ -1283,7 +1283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] From 3870237b18a064e8dd878cdf3a7120f5200c1adb Mon Sep 17 00:00:00 2001 From: rami3l Date: Tue, 2 Jul 2024 10:16:54 +0800 Subject: [PATCH 09/10] fixup! Update cargo patch --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fce25a2d5..52244e2500 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ dependencies = [ [[package]] name = "aws-lc-fips-sys" version = "0.12.10" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#3c235d9ae22f0a2df1e15b02bf5852845321f494" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#63bd01b9c7a486aa4c81d26d4d9e8cc5f20a55e0" dependencies = [ "bindgen", "cmake", @@ -178,7 +178,7 @@ dependencies = [ [[package]] name = "aws-lc-rs" version = "1.8.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#3c235d9ae22f0a2df1e15b02bf5852845321f494" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#63bd01b9c7a486aa4c81d26d4d9e8cc5f20a55e0" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", @@ -191,7 +191,7 @@ dependencies = [ [[package]] name = "aws-lc-sys" version = "0.19.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#3c235d9ae22f0a2df1e15b02bf5852845321f494" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#63bd01b9c7a486aa4c81d26d4d9e8cc5f20a55e0" dependencies = [ "bindgen", "cc", @@ -1283,7 +1283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] From aef78cceede8fb725008e66be19744d772c44277 Mon Sep 17 00:00:00 2001 From: rami3l Date: Tue, 2 Jul 2024 10:50:20 +0800 Subject: [PATCH 10/10] fixup! fixup! Update cargo patch --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52244e2500..cc3d9799e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,7 +165,7 @@ dependencies = [ [[package]] name = "aws-lc-fips-sys" version = "0.12.10" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#63bd01b9c7a486aa4c81d26d4d9e8cc5f20a55e0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#815f887c8e265f74eedd9dc8cbebcc308aaf1c15" dependencies = [ "bindgen", "cmake", @@ -178,7 +178,7 @@ dependencies = [ [[package]] name = "aws-lc-rs" version = "1.8.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#63bd01b9c7a486aa4c81d26d4d9e8cc5f20a55e0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#815f887c8e265f74eedd9dc8cbebcc308aaf1c15" dependencies = [ "aws-lc-fips-sys", "aws-lc-sys", @@ -191,7 +191,7 @@ dependencies = [ [[package]] name = "aws-lc-sys" version = "0.19.0" -source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#63bd01b9c7a486aa4c81d26d4d9e8cc5f20a55e0" +source = "git+https://github.com/justsmth/aws-lc-rs.git?branch=more-windows-tests#815f887c8e265f74eedd9dc8cbebcc308aaf1c15" dependencies = [ "bindgen", "cc",