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
This commit is contained in:
JohnE 2026-11-16 21:03:10 -05:00
parent d0111ac521
commit 598203b475
3 changed files with 18 additions and 0 deletions

View File

@ -134,6 +134,11 @@ impl CryptoProvider for AwsLcProvider {
PROVIDER_NAME 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 /// `true` only for a `fips` build whose AWS-LC-FIPS module reports FIPS
/// mode at runtime (D-26). /// mode at runtime (D-26).
fn fips_mode(&self) -> bool { fn fips_mode(&self) -> bool {

View File

@ -133,6 +133,11 @@ impl CryptoProvider for BoringProvider {
PROVIDER_NAME 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 /// `true` only for a `fips` build whose BoringCrypto module reports FIPS
/// mode at run time (`FIPS_mode()`). A default build is never FIPS. /// mode at run time (`FIPS_mode()`). A default build is never FIPS.
fn fips_mode(&self) -> bool { fn fips_mode(&self) -> bool {

View File

@ -172,6 +172,14 @@ pub trait CryptoProvider:
/// in `ccc_provider_spec.dart`. /// in `ccc_provider_spec.dart`.
fn provider_name(&self) -> &'static str; 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 /// 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 /// mode. Release policy requires the vetted layer of every suite to come
/// from such a provider (D-26). Defaults to `false`. /// from such a provider (D-26). Defaults to `false`.