From 825c52cb66236fc31a77ce5db238b895a9634d34 Mon Sep 17 00:00:00 2001 From: Zbigniew Lukwinski Date: Tue, 14 Jan 2025 09:53:12 +0100 Subject: [PATCH 1/4] Revert "Fix compilation warning in ring library" This reverts commit fac56649a2817b4c3bab3680e31f968e82be2674. Signed-off-by: Zbigniew Lukwinski --- sh_script/pre-build.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sh_script/pre-build.sh b/sh_script/pre-build.sh index c742d1c..21f37db 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 From 7899e258627ddcf12e087d24c934958b929ec718 Mon Sep 17 00:00:00 2001 From: Zbigniew Lukwinski Date: Tue, 14 Jan 2025 09:53:21 +0100 Subject: [PATCH 2/4] Revert "Fix compilation warning in webpki library" This reverts commit db2b7ca5605a9b2b6ec91c239d29c78c99239be0. Signed-off-by: Zbigniew Lukwinski --- sh_script/pre-build.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sh_script/pre-build.sh b/sh_script/pre-build.sh index 21f37db..d861495 100755 --- a/sh_script/pre-build.sh +++ b/sh_script/pre-build.sh @@ -36,11 +36,6 @@ 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 popd } From 9fba58d1ff2c24b388bdfdd56064c04b86b1d0ef Mon Sep 17 00:00:00 2001 From: Zbigniew Lukwinski Date: Tue, 14 Jan 2025 09:56:37 +0100 Subject: [PATCH 3/4] Fix compilation warning in webpki library The following warning is being fixed: warning: unused import: `CONSTRUCTED` --> deps/spdm-rs/external/webpki/src/der.rs:17:24 | 17 | der::{nested, Tag, CONSTRUCTED}, That warning was already fixed with this patch: https://github.com/briansmith/webpki/commit/8f81719df5b47bda95f15a7655be811e52e12997 Once webpki library version will be bumped up, this patch could be dropped. Signed-off-by: Zbigniew Lukwinski --- .../patches/webpki/0001-Appease-Clippy.patch | 38 +++++++++++++++++++ sh_script/pre-build.sh | 1 + 2 files changed, 39 insertions(+) create mode 100644 external/patches/webpki/0001-Appease-Clippy.patch 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 d861495..7da5b1d 100755 --- a/sh_script/pre-build.sh +++ b/sh_script/pre-build.sh @@ -37,6 +37,7 @@ patch-webpki() { git reset --hard f84a538a5cd281ba1ffc0d54bbe5824cf5969703 git clean -xdf git apply ../patches/webpki/0001-Add-support-for-verifying-certificate-chain-with-EKU.patch + git apply ../patches/webpki/0001-Appease-Clippy.patch popd } From deccdd035474185a3893be50066d7e859db05c81 Mon Sep 17 00:00:00 2001 From: Zbigniew Lukwinski Date: Tue, 14 Jan 2025 09:58:28 +0100 Subject: [PATCH 4/4] Fix compilation warning in ring library The following warning is being fixed: warning: unused imports: `PKCS1`, `PSS` --> ring/src/rsa/padding.rs:21:13 | 21 | pkcs1::{PKCS1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512}, | ^^^^^ 22 | pss::{PSS, RSA_PSS_SHA256, RSA_PSS_SHA384, RSA_PSS_SHA512}, | ^^^ | = note: `#[warn(unused_imports)]` on by default That warning was already fixed with this patch: https://github.com/briansmith/ring/commit/c4742e0cae849f08ff410a817c5266af41670b3d Once ring library version will be bumped up, this patch could be dropped. Signed-off-by: Zbigniew Lukwinski --- ...Address-Clippy-unused-import-warning.patch | 29 +++++++++++++++++++ sh_script/pre-build.sh | 1 + 2 files changed, 30 insertions(+) create mode 100644 external/patches/ring/0001-NFC-Address-Clippy-unused-import-warning.patch 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/sh_script/pre-build.sh b/sh_script/pre-build.sh index 7da5b1d..9942462 100755 --- a/sh_script/pre-build.sh +++ b/sh_script/pre-build.sh @@ -28,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 }