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:
parent
d0111ac521
commit
598203b475
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
|
|
|||
Loading…
Reference in New Issue