From 1d62388af257aaa6b9cc330006587c0c2c8f88c8 Mon Sep 17 00:00:00 2001 From: Vu Anh Phung Date: Sun, 8 Nov 2026 18:46:22 +0000 Subject: [PATCH] fix(ci): resolve dependency audit failures Signed-off-by: Vu Anh Phung --- .github/workflows/license-check.yml | 7 ++ Cargo.lock | 121 +--------------------------- Cargo.toml | 11 +-- deny.toml | 2 + src/auth/oauth/test_keys.rs | 14 +++- 5 files changed, 23 insertions(+), 132 deletions(-) diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index 478984c0..1835e142 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -38,6 +38,8 @@ on: # changes there must re-trigger this workflow to scan it. - "napi/Cargo.toml" - "napi/Cargo.lock" + - "pyo3/Cargo.toml" + - "pyo3/Cargo.lock" - ".github/workflows/license-check.yml" pull_request: branches: [main] @@ -49,6 +51,8 @@ on: - "deny.toml" - "napi/Cargo.toml" - "napi/Cargo.lock" + - "pyo3/Cargo.toml" + - "pyo3/Cargo.lock" - ".github/workflows/license-check.yml" concurrency: @@ -116,3 +120,6 @@ jobs: # (a relative `--config` would otherwise resolve against the # manifest dir and look for napi/deny.toml). run: cargo deny --manifest-path "$GITHUB_WORKSPACE/napi/Cargo.toml" --config "$GITHUB_WORKSPACE/deny.toml" check + + - name: Check licenses, advisories, bans, sources (PyO3 workspace) + run: cargo deny --manifest-path "$GITHUB_WORKSPACE/pyo3/Cargo.toml" --config "$GITHUB_WORKSPACE/deny.toml" check diff --git a/Cargo.lock b/Cargo.lock index 1a630b36..b22dfe75 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,12 +290,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - [[package]] name = "base64" version = "0.22.1" @@ -599,18 +593,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-common" version = "0.1.7" @@ -687,12 +669,12 @@ dependencies = [ "moka", "oauth2", "open", - "p256", "pbkdf2 0.13.0", "pkcs8", "rand 0.10.2", "rcgen", "reqwest", + "ring", "rsa", "rustls", "rustls-webpki", @@ -818,40 +800,6 @@ dependencies = [ "syn 2.0.118", ] -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pem-rfc7468", - "pkcs8", - "rand_core 0.6.4", - "sec1", - "subtle", - "zeroize", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -894,16 +842,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" -[[package]] -name = "ff" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -1056,7 +994,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", ] [[package]] @@ -1119,17 +1056,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "h2" version = "0.4.15" @@ -1983,18 +1909,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2 0.10.9", -] - [[package]] name = "parking" version = "2.2.1" @@ -2149,15 +2063,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -2417,16 +2322,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac 0.12.1", - "subtle", -] - [[package]] name = "ring" version = "0.17.14" @@ -2592,20 +2487,6 @@ dependencies = [ "sha2 0.10.9", ] -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - [[package]] name = "security-framework" version = "3.7.0" diff --git a/Cargo.toml b/Cargo.toml index 4de130fd..92e43869 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,15 +148,10 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-uti wiremock = "0.6" tempfile = "3" log = "0.4" -# Test-only private-key generation for the JWT auth tests. Keys are -# generated in-process (RSA + P-256, plus a PBES2-encrypted PKCS#8 -# variant) rather than committed as PEM fixtures, so the repo's secret -# scanner has nothing to flag and the tests need no `openssl` CLI (which -# the repo deliberately avoids — not present on Windows). These are the -# RustCrypto siblings of the `pkcs8` runtime dep. dev-only: never linked -# into the shipped crate. +# Generate JWT test keys in-process to avoid PEM fixtures and an external +# `openssl` dependency. `ring` already backs runtime JWT signing. rsa = { version = "0.9", features = ["pem"] } -p256 = { version = "0.13", features = ["pkcs8", "pem"] } +ring = "0.17" # Hermetic mTLS C-ABI tests generate a private CA and client/server identities # at runtime, then serve HTTPS with mandatory client-certificate verification. # This avoids committed credentials, external processes, and live workspaces. diff --git a/deny.toml b/deny.toml index adab1499..95be6715 100644 --- a/deny.toml +++ b/deny.toml @@ -56,6 +56,8 @@ ignore = [ # entry requires PR-description justification. allow = [ "Apache-2.0", + # target-lexicon, used by PyO3's build configuration. + "Apache-2.0 WITH LLVM-exception", "BSD-2-Clause", "BSD-3-Clause", # CC0-1.0 is a public-domain dedication (no attribution or diff --git a/src/auth/oauth/test_keys.rs b/src/auth/oauth/test_keys.rs index 56864c73..8b14ec16 100644 --- a/src/auth/oauth/test_keys.rs +++ b/src/auth/oauth/test_keys.rs @@ -14,7 +14,7 @@ //! Test-only private-key generation for the JWT auth tests. //! -//! Keys are generated **in-process** (via the RustCrypto `rsa` / `p256` +//! Keys are generated **in-process** (via the `rsa` / `ring` //! dev-dependencies) rather than committed as PEM fixtures. Two reasons: //! //! 1. The repo's secret scanner blocks committed `BEGIN PRIVATE KEY` @@ -33,7 +33,7 @@ use std::sync::OnceLock; use pkcs8::{EncodePrivateKey, EncodePublicKey, LineEnding}; // Use the `rand_core` re-exported by `rsa` (v0.6) so keygen matches the -// RNG trait version the RustCrypto keygen APIs expect — and so we don't +// RNG trait version the RSA keygen API expects — and so we don't // pull in a second top-level `rand` that would clash with the kernel's // runtime `rand` (v0.10) in test builds. use rsa::rand_core::OsRng; @@ -84,8 +84,14 @@ pub(crate) fn rsa_encrypted_pkcs8_pem() -> String { /// A fresh P-256 EC private key as PKCS#8 PEM (for `ES256`). pub(crate) fn ec_p256_pkcs8_pem() -> String { - let key = p256::SecretKey::random(&mut OsRng); - key.to_pkcs8_pem(LineEnding::LF) + let key = ring::signature::EcdsaKeyPair::generate_pkcs8( + &ring::signature::ECDSA_P256_SHA256_ASN1_SIGNING, + &ring::rand::SystemRandom::new(), + ) + .expect("generate test EC key"); + pkcs8::SecretDocument::try_from(key.as_ref()) + .expect("parse EC PKCS#8") + .to_pem("PRIVATE KEY", LineEnding::LF) .expect("encode EC PKCS#8 PEM") .to_string() }