]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[crypto] Generalise cms_signature to cms_message
authorMichael Brown <mcb30@ipxe.org>
Mon, 12 Aug 2024 11:36:41 +0000 (12:36 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 14 Aug 2024 12:04:01 +0000 (13:04 +0100)
commit97635eb71b5ad7e81e79f32fef5f4394bcee0722
tree5cade59887c1c710ccd184bfc62cb16339b5a22b
parent998edc6ec515a6c9b0635d728b1cc51253e7dd7f
[crypto] Generalise cms_signature to cms_message

There is some exploitable similarity between the data structures used
for representing CMS signatures and CMS encryption keys.  In both
cases, the CMS message fundamentally encodes a list of participants
(either message signers or message recipients), where each participant
has an associated certificate and an opaque octet string representing
the signature or encrypted cipher key.  The ASN.1 structures are not
identical, but are sufficiently similar to be worth exploiting: for
example, the SignerIdentifier and RecipientIdentifier data structures
are defined identically.

Rename data structures and functions, and add the concept of a CMS
message type.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/crypto/cms.c
src/include/ipxe/asn1.h
src/include/ipxe/cms.h
src/tests/cms_test.c
src/usr/imgtrust.c