diff --git a/tests/conformance/Cargo.toml b/tests/conformance/Cargo.toml index 22cf11b..2b7153f 100644 --- a/tests/conformance/Cargo.toml +++ b/tests/conformance/Cargo.toml @@ -8,16 +8,22 @@ publish = false # Test binary — never published to crates.io. [[bin]] name = "conformance" path = "src/main.rs" +required-features = ["wolfssl"] [dependencies] ccc-crypto-core = { path = "../../crates/ccc-crypto-core" } -ccc-crypto-wolfssl = { path = "../../crates/ccc-crypto-wolfssl" } +ccc-crypto-wolfssl = { path = "../../crates/ccc-crypto-wolfssl", optional = true } anyhow = { workspace = true } hex = "0.4" log = { workspace = true } env_logger = { workspace = true } +[features] +# wolfSSL is GPLv3 (or commercial) and off by default; turn it on to +# cross-check it and to regenerate the vectors with every provider. +wolfssl = ["dep:ccc-crypto-wolfssl"] + [dev-dependencies] ccc-crypto-rustcrypto = { workspace = true } ccc-crypto-boring = { path = "../../crates/ccc-crypto-boring" } diff --git a/tests/conformance/tests/cascade_awslc.rs b/tests/conformance/tests/cascade_awslc.rs index 541bba6..f316fc1 100644 --- a/tests/conformance/tests/cascade_awslc.rs +++ b/tests/conformance/tests/cascade_awslc.rs @@ -24,7 +24,6 @@ fn providers() -> &'static ProviderSet { static SET: OnceLock = OnceLock::new(); SET.get_or_init(|| { let mut p = ProviderSet::new(); - p.add(Arc::new(ccc_crypto_wolfssl::WolfSslProvider::new())); p.add(Arc::new(ccc_crypto_rustcrypto::RustCryptoProvider::new())); p.add(Arc::new(AwsLcProvider::new())); p diff --git a/tests/conformance/tests/cross_provider.rs b/tests/conformance/tests/cross_provider.rs index 853cfbb..2c95558 100644 --- a/tests/conformance/tests/cross_provider.rs +++ b/tests/conformance/tests/cross_provider.rs @@ -18,14 +18,15 @@ use std::path::PathBuf; use serde::{Deserialize, Serialize}; +use ccc_crypto_awslc::AwsLcProvider; +use ccc_crypto_boring::BoringProvider; use ccc_crypto_core::{ algorithms::{AeadAlgorithm, HashAlgorithm, KdfAlgorithm, KemAlgorithm, MacAlgorithm}, error::CryptoError, provider::{CryptoProvider, KemProvider}, }; -use ccc_crypto_boring::BoringProvider; -use ccc_crypto_awslc::AwsLcProvider; use ccc_crypto_rustcrypto::RustCryptoProvider; +#[cfg(feature = "wolfssl")] use ccc_crypto_wolfssl::WolfSslProvider; // ── Providers ──────────────────────────────────────────────────────────────── @@ -35,6 +36,7 @@ impl Provider for T {} fn providers() -> Vec> { vec![ + #[cfg(feature = "wolfssl")] Box::new(WolfSslProvider::new()), Box::new(RustCryptoProvider::new()), Box::new(BoringProvider::new()), @@ -335,6 +337,9 @@ fn generate() -> Vectors { #[test] #[ignore = "writes vectors/conformance_v1.json; run only to regenerate"] fn regenerate() { + if !cfg!(feature = "wolfssl") { + panic!("regenerate with --features wolfssl so every provider is listed"); + } let json = serde_json::to_string_pretty(&generate()).unwrap() + "\n"; std::fs::write(vectors_path(), json).unwrap(); } @@ -541,6 +546,10 @@ fn kem_encapsulation_interoperates() { } #[test] +#[cfg_attr( + not(feature = "wolfssl"), + ignore = "the pinned file lists wolfSSL too; run with --features wolfssl" +)] fn pinned_file_is_current() { // Catches edits to the inputs above that were not regenerated. assert_eq!(