mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 23:15:10 +03:00
[crypto] Hold CMS message as a single ASN.1 object
Reduce the number of dynamic allocations required to parse a CMS message by retaining the ASN.1 cursor returned from image_asn1() for the lifetime of the CMS message. This allows embedded ASN.1 cursors to be used for parsed objects within the message, such as embedded signatures. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -48,15 +48,15 @@ struct cms_participant {
|
||||
struct pubkey_algorithm *pubkey;
|
||||
|
||||
/** Signature or key value */
|
||||
void *value;
|
||||
/** Length of signature or key value */
|
||||
size_t len;
|
||||
struct asn1_cursor value;
|
||||
};
|
||||
|
||||
/** A CMS message */
|
||||
struct cms_message {
|
||||
/** Reference count */
|
||||
struct refcnt refcnt;
|
||||
/** Raw ASN.1 data */
|
||||
struct asn1_cursor *raw;
|
||||
/** Message type */
|
||||
struct cms_type *type;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user