mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 02:50:25 +03:00
[crypto] Allow for parsing of partial ASN.1 cursors
Allow code to create a partial ASN.1 cursor containing only the type and length bytes, so that asn1_start() may be used to determine the length of a large ASN.1 blob without first allocating memory to hold the entire blob. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -337,6 +337,8 @@ asn1_type ( const struct asn1_cursor *cursor ) {
|
||||
return ( ( cursor->len >= sizeof ( *type ) ) ? *type : ASN1_END );
|
||||
}
|
||||
|
||||
extern int asn1_start ( struct asn1_cursor *cursor, unsigned int type,
|
||||
size_t extra );
|
||||
extern int asn1_enter ( struct asn1_cursor *cursor, unsigned int type );
|
||||
extern int asn1_skip_if_exists ( struct asn1_cursor *cursor,
|
||||
unsigned int type );
|
||||
|
||||
Reference in New Issue
Block a user