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

Fix compilations warnings in libraries #164

Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From c4742e0cae849f08ff410a817c5266af41670b3d Mon Sep 17 00:00:00 2001
From: Brian Smith <[email protected]>
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

38 changes: 38 additions & 0 deletions external/patches/webpki/0001-Appease-Clippy.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 8f81719df5b47bda95f15a7655be811e52e12997 Mon Sep 17 00:00:00 2001
From: Brian Smith <[email protected]>
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

12 changes: 2 additions & 10 deletions sh_script/pre-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand All @@ -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
}

Expand Down
Loading