mirror of
https://github.com/ipxe/ipxe
synced 2026-01-24 21:24:47 +03:00
[crypto] Remove userptr_t from ASN.1 parsers
Simplify the ASN.1 code by assuming that all objects are fully accessible via pointer dereferences. This allows the concept of "additional data beyond the end of the cursor" to be removed, and simplifies parsing of all ASN.1 image formats. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -481,8 +481,6 @@ asn1_built ( struct asn1_builder *builder ) {
|
||||
return &u->cursor;
|
||||
}
|
||||
|
||||
extern int asn1_enter_partial ( 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 );
|
||||
|
||||
@@ -13,7 +13,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#include <ipxe/asn1.h>
|
||||
#include <ipxe/image.h>
|
||||
|
||||
extern int der_asn1 ( userptr_t data, size_t len, size_t offset,
|
||||
extern int der_asn1 ( const void *data, size_t len, size_t offset,
|
||||
struct asn1_cursor **cursor );
|
||||
|
||||
extern struct image_type der_image_type __image_type ( PROBE_NORMAL );
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ipxe/uaccess.h>
|
||||
#include <ipxe/asn1.h>
|
||||
#include <ipxe/image.h>
|
||||
|
||||
extern int efisig_asn1 ( userptr_t data, size_t len, size_t offset,
|
||||
extern int efisig_asn1 ( const void *data, size_t len, size_t offset,
|
||||
struct asn1_cursor **cursor );
|
||||
|
||||
extern struct image_type efisig_image_type __image_type ( PROBE_NORMAL );
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ipxe/uaccess.h>
|
||||
#include <ipxe/asn1.h>
|
||||
#include <ipxe/image.h>
|
||||
|
||||
@@ -20,7 +19,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
/** Post-encapsulation boundary marker */
|
||||
#define PEM_END "-----END"
|
||||
|
||||
extern int pem_asn1 ( userptr_t data, size_t len, size_t offset,
|
||||
extern int pem_asn1 ( const void *data, size_t len, size_t offset,
|
||||
struct asn1_cursor **cursor );
|
||||
|
||||
extern struct image_type pem_image_type __image_type ( PROBE_NORMAL );
|
||||
|
||||
Reference in New Issue
Block a user