diff --git a/external/patches/ring/0001-NFC-Address-Clippy-unused-import-warning.patch b/external/patches/ring/0001-NFC-Address-Clippy-unused-import-warning.patch new file mode 100644 index 0000000..1cbda32 --- /dev/null +++ b/external/patches/ring/0001-NFC-Address-Clippy-unused-import-warning.patch @@ -0,0 +1,29 @@ +From c4742e0cae849f08ff410a817c5266af41670b3d Mon Sep 17 00:00:00 2001 +From: Brian Smith +Date: Tue, 9 Jan 2024 10:52:37 -0800 +Subject: [PATCH] NFC: Address Clippy unused import warning. + +See https://github.com/briansmith/ring/issues/1887 about addressing this +messiness long-term. +--- + src/rsa/padding.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/rsa/padding.rs b/src/rsa/padding.rs +index faf2422d9..9b79cd0f6 100644 +--- a/src/rsa/padding.rs ++++ b/src/rsa/padding.rs +@@ -18,8 +18,8 @@ mod pkcs1; + mod pss; + + pub use self::{ +- pkcs1::{PKCS1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512}, +- pss::{PSS, RSA_PSS_SHA256, RSA_PSS_SHA384, RSA_PSS_SHA512}, ++ pkcs1::{RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512}, ++ pss::{RSA_PSS_SHA256, RSA_PSS_SHA384, RSA_PSS_SHA512}, + }; + pub(super) use pkcs1::RSA_PKCS1_SHA1_FOR_LEGACY_USE_ONLY; + +-- +2.34.1 + diff --git a/external/patches/webpki/0001-Appease-Clippy.patch b/external/patches/webpki/0001-Appease-Clippy.patch new file mode 100644 index 0000000..b6d3168 --- /dev/null +++ b/external/patches/webpki/0001-Appease-Clippy.patch @@ -0,0 +1,38 @@ +From 8f81719df5b47bda95f15a7655be811e52e12997 Mon Sep 17 00:00:00 2001 +From: Brian Smith +Date: Sun, 18 Feb 2024 12:55:41 -0800 +Subject: [PATCH] Appease Clippy. + +--- + src/der.rs | 2 +- + src/verify_cert.rs | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/der.rs b/src/der.rs +index 43d0847..9ef4efb 100644 +--- a/src/der.rs ++++ b/src/der.rs +@@ -14,7 +14,7 @@ + + use crate::{calendar, time, Error}; + pub use ring::io::{ +- der::{nested, Tag, CONSTRUCTED}, ++ der::{nested, Tag}, + Positive, + }; + +diff --git a/src/verify_cert.rs b/src/verify_cert.rs +index fe7ef9d..b166ecc 100644 +--- a/src/verify_cert.rs ++++ b/src/verify_cert.rs +@@ -80,6 +80,7 @@ fn build_chain_inner( + + // TODO: revocation. + ++ #[allow(clippy::blocks_in_conditions)] + match loop_while_non_fatal_error(trust_anchors, |trust_anchor: &TrustAnchor| { + let trust_anchor_subject = untrusted::Input::from(trust_anchor.subject); + if !equal(cert.issuer, trust_anchor_subject) { +-- +2.34.1 + diff --git a/sh_script/pre-build.sh b/sh_script/pre-build.sh index c742d1c..9942462 100755 --- a/sh_script/pre-build.sh +++ b/sh_script/pre-build.sh @@ -20,11 +20,6 @@ patch-ring() { pushd external/ring git reset --hard 464d367252354418a2c17feb806876d4d89a8508 git clean -xdf - - # apply the patch to get rid of unused import warning during compilation - # https://github.com/briansmith/ring/commit/c4742e0cae849f08ff410a817c5266af41670b3d - git cherry-pick c4742e0cae849f08ff410a817c5266af41670b3d - case "$TARGET_OPTION" in "x86_64-unknown-none") git apply ../patches/ring/0001-Support-x86_64-unknown-none-target.patch @@ -33,6 +28,7 @@ patch-ring() { echo "Unsupported target for ring, builds may not work!" ;; esac + git apply ../patches/ring/0001-NFC-Address-Clippy-unused-import-warning.patch popd } @@ -41,12 +37,8 @@ patch-webpki() { pushd external/webpki git reset --hard f84a538a5cd281ba1ffc0d54bbe5824cf5969703 git clean -xdf - - # apply the patch to get rid of unused import warning during compilation - # https://github.com/briansmith/webpki/commit/8f81719df5b47bda95f15a7655be811e52e12997 - git cherry-pick 8f81719df5b47bda95f15a7655be811e52e12997 - git apply ../patches/webpki/0001-Add-support-for-verifying-certificate-chain-with-EKU.patch + git apply ../patches/webpki/0001-Appease-Clippy.patch popd }