Skip to main content

check_index

Function check_index 

Source
pub fn check_index<'a, P: AsnDigest<'a>>(
    index: &HashIndex<'_>,
    message: &SignedData<'_>,
    signer: &SignerInfo<'_>,
    provider: &'a P,
    parent: &Reader<'_>,
) -> CoverageResult<P::Error>
Expand description

Matches every entry of index against the original elements it may name.

Each certificate and revocation choice of the root message is hashed over its whole original encoding, and each unsigned attribute value of signer over its attrType encoding followed by the value’s encoding (§5.5.2). Nothing is re-encoded: an entry computed over another encoding of the same value does not match, and an OtherCertificateFormat, which §5.5.2 has its producer write in DER, is hashed as written. Only the root SignedData fields count; an element carried elsewhere, such as in a revocation-values attribute, names no entry. The index algorithm is resolved through provider; an algorithm it does not know or that is malformed is answered as such, before anything is hashed.

§Errors

A zero-sized provider, a message or index from another parser than parent’s, a signer that is not one of message’s, a spent work ceiling, a provider failure, or a provider output whose width contradicts its identity.