From 598203b475621c8733eaff9b31625f8060c623d8 Mon Sep 17 00:00:00 2001 From: JohnE Date: Mon, 16 Nov 2026 21:03:10 -0500 Subject: [PATCH] core: add a provider lineage for diversity rules AWS-LC forks BoringSSL, so the two report one lineage and count as one library when suites demand distinct providers. Refs: R3 --- crates/ccc-crypto-awslc/src/provider.rs | 5 +++++ crates/ccc-crypto-boring/src/provider.rs | 5 +++++ crates/ccc-crypto-core/src/provider.rs | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/crates/ccc-crypto-awslc/src/provider.rs b/crates/ccc-crypto-awslc/src/provider.rs index ffff54b..f157824 100644 --- a/crates/ccc-crypto-awslc/src/provider.rs +++ b/crates/ccc-crypto-awslc/src/provider.rs @@ -134,6 +134,11 @@ impl CryptoProvider for AwsLcProvider { PROVIDER_NAME } + fn lineage(&self) -> &'static str { + // AWS-LC is a fork of BoringSSL; they share code and assembly. + "boringssl" + } + /// `true` only for a `fips` build whose AWS-LC-FIPS module reports FIPS /// mode at runtime (D-26). fn fips_mode(&self) -> bool { diff --git a/crates/ccc-crypto-boring/src/provider.rs b/crates/ccc-crypto-boring/src/provider.rs index 97d822a..fd80dcd 100644 --- a/crates/ccc-crypto-boring/src/provider.rs +++ b/crates/ccc-crypto-boring/src/provider.rs @@ -133,6 +133,11 @@ impl CryptoProvider for BoringProvider { PROVIDER_NAME } + fn lineage(&self) -> &'static str { + // AWS-LC is a fork of BoringSSL; they share code and assembly. + "boringssl" + } + /// `true` only for a `fips` build whose BoringCrypto module reports FIPS /// mode at run time (`FIPS_mode()`). A default build is never FIPS. fn fips_mode(&self) -> bool { diff --git a/crates/ccc-crypto-core/src/provider.rs b/crates/ccc-crypto-core/src/provider.rs index ff7c9da..0f7c445 100644 --- a/crates/ccc-crypto-core/src/provider.rs +++ b/crates/ccc-crypto-core/src/provider.rs @@ -172,6 +172,14 @@ pub trait CryptoProvider: /// in `ccc_provider_spec.dart`. fn provider_name(&self) -> &'static str; + /// The code base this provider's implementations come from. Providers + /// built from forks of one library share assembly and bugs, so diversity + /// rules compare lineages, not names: AWS-LC and BoringSSL are both + /// `"boringssl"`. Defaults to [`CryptoProvider::provider_name`]. + fn lineage(&self) -> &'static str { + self.provider_name() + } + /// Whether this provider runs as a FIPS 140-3 validated module in FIPS /// mode. Release policy requires the vetted layer of every suite to come /// from such a provider (D-26). Defaults to `false`.