68 if ( remaining <
sizeof ( **lhdr ) ) {
69 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated header " 76 if ( remaining < (*lhdr)->SignatureListSize ) {
77 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated list at " 81 remaining = (*lhdr)->SignatureListSize;
84 dlen = (*lhdr)->SignatureSize;
85 if ( dlen <
sizeof ( **dhdr ) ) {
86 DBGC (
data,
"EFISIG [%#zx,%#zx) underlength " 92 if ( ( remaining <
sizeof ( **lhdr ) ) ||
93 ( ( remaining -
sizeof ( **lhdr ) ) <
94 (*lhdr)->SignatureHeaderSize ) ) {
95 DBGC (
data,
"EFISIG [%#zx,%#zx) malformed header at " 99 skip = (
sizeof ( **lhdr ) + (*lhdr)->SignatureHeaderSize );
104 for ( ; remaining ;
offset += dlen, remaining -= dlen ) {
107 if ( remaining < dlen ) {
108 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated " 161 ( ( asn1 ==
der_asn1 ) ?
"DER" :
"PEM" ) );
165 DBGC (
data,
"EFISIG [%#zx,%#zx) could not extract ASN.1: " 171 if ( ( (
unsigned int )
next ) !=
len ) {
172 DBGC (
data,
"EFISIG [%#zx,%#zx) malformed data\n",
197 unsigned int count = 0;
205 &lhdr, &dhdr ) ) != 0 ) {
215 DBGC (
image,
"EFISIG %s contains %d signatures\n",
242 DBGC (
image,
"EFISIG %s could not extract ASN.1: %s\n",
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
int pem_asn1(const void *data, size_t len, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from PEM data.
UINT32 SignatureSize
Size of each signature.
const void * data
Read-only data.
An executable image type.
static int efisig_image_asn1(struct image *image, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from EFI signature list image.
#define PROBE_NORMAL
Normal image probe priority.
#define offsetof(type, field)
Get offset of a field within a structure.
char * name
Name of this image type.
uint32_t start
Starting offset.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
UINT8 SignatureData[1]
The format of the signature is defined by the SignatureType.
int efisig_asn1(const void *data, size_t len, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from EFI signature list.
int(* asn1)(struct image *image, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from image.
static unsigned int count
Number of entries.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int efisig_find(const void *data, size_t len, size_t *start, const EFI_SIGNATURE_LIST **lhdr, const EFI_SIGNATURE_DATA **dhdr)
Find EFI signature list entry.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
size_t len
Length of raw file image.
struct image_type efisig_image_type __image_type(PROBE_NORMAL)
EFI signature list image type.
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
#define ASN1_SEQUENCE
ASN.1 sequence.
uint32_t next
Next descriptor address.
static int efisig_image_probe(struct image *image)
Probe EFI signature list image.
The format of a signature database.
Image signature database are defined for the signed image validation.
uint8_t data[48]
Additional event data.
int der_asn1(const void *data, size_t len, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from DER data.
typeof(acpi_finder=acpi_find)
ACPI table finder.
uint16_t offset
Offset to command line.