Skip to main content

assert_admitted_approved

Function assert_admitted_approved 

Source
pub fn assert_admitted_approved(
    a: &Admitted,
    families: &[Family],
) -> Result<(), CryptoError>
Expand description

Checks the families the caller uses from a. Refuses with CryptoError::NotFips unless the module is in FIPS mode; then with CryptoError::FamilyNotAdmitted for the first family in families that is not walked here (every TLS family, which assert_module_approves checks instead, and any family this backend does not walk); then, when families names Family::Kdf, with CryptoError::KdfInfoMayBeEmpty if a’s profile admits KDFs and an empty info, which the module does not approve (unrestricted); then unless every algorithm a admits in each named family is Approved for the running module, walking Family::Mac, Family::Kdf, Family::KeyAgreement, Family::Aead, Family::Hash, then Family::Signature, and failing on the first that is not. Asserting nothing approves nothing: an empty families, or a named family a admits nothing in, is not a refusal. Independent of assert_module_approves.