mirror of
https://github.com/apple/swift-certificates
synced 2026-11-24 04:27:49 +00:00
Per [RFC 5652 § 11.2](https://datatracker.ietf.org/doc/html/rfc5652#section-11.2): "For signed-data, the message digest is computed using the signer's message digest algorithm." Currently, when computing the signed attributes' message digest, `CMS.sign` assumes the digest algorithm is SHA256, which is incorrect. The behavior of `CMS.isValid` is already correct and doesn't need updating. I've made `Digest` conform to `Sequence` to facilitate the conversion/comparison of the message digest. --------- Co-authored-by: Cory Benfield <lukasa@apple.com>