[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:
Michael Brown
2025-04-21 22:40:59 +01:00
parent 04d0b2fdf9
commit 3f8937d2f3
10 changed files with 70 additions and 109 deletions
+2 -2
View File
@@ -54,14 +54,14 @@ static struct x509_chain efi_cacerts = {
* @v offset Offset within data
* @v next Next offset, or negative error
*/
static int efi_cacert ( void *data, size_t len, size_t offset ) {
static int efi_cacert ( const void *data, size_t len, size_t offset ) {
struct asn1_cursor *cursor;
struct x509_certificate *cert;
int next;
int rc;
/* Extract ASN.1 object */
next = efisig_asn1 ( virt_to_user ( data ), len, offset, &cursor );
next = efisig_asn1 ( data, len, offset, &cursor );
if ( next < 0 ) {
rc = next;
DBGC ( &efi_cacerts, "EFICA could not parse at +%#zx: %s\n",