69 if ( remaining <
sizeof ( **lhdr ) ) {
70 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated header "
77 if ( remaining < (*lhdr)->SignatureListSize ) {
78 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated list at "
85 dlen = (*lhdr)->SignatureSize;
86 if ( dlen <
sizeof ( **dhdr ) ) {
87 DBGC (
data,
"EFISIG [%#zx,%#zx) underlength "
93 if ( ( remaining <
sizeof ( **lhdr ) ) ||
94 ( ( remaining -
sizeof ( **lhdr ) ) <
95 (*lhdr)->SignatureHeaderSize ) ) {
96 DBGC (
data,
"EFISIG [%#zx,%#zx) malformed header at "
100 skip = (
sizeof ( **lhdr ) + (*lhdr)->SignatureHeaderSize );
105 for ( ; remaining ;
offset += dlen, remaining -= dlen ) {
108 if ( remaining < dlen ) {
109 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated "
147 int ( * asn1 ) (
const void *
data,
size_t len,
size_t offset,
162 ( ( asn1 ==
der_asn1 ) ?
"DER" :
"PEM" ) );
166 DBGC (
data,
"EFISIG [%#zx,%#zx) could not extract ASN.1: "
172 if ( ( (
unsigned int )
next ) !=
len ) {
173 DBGC (
data,
"EFISIG [%#zx,%#zx) malformed data\n",
198 unsigned int count = 0;
206 &lhdr, &dhdr ) ) != 0 ) {
216 DBGC (
image,
"EFISIG %s contains %d signatures\n",
243 DBGC (
image,
"EFISIG %s could not extract ASN.1: %s\n",
Image signature database are defined for the signed image validation.
typeof(acpi_finder=acpi_find)
ACPI table finder.
struct arbelprm_rc_send_wqe rc
#define ASN1_SEQUENCE
ASN.1 sequence.
#define assert(condition)
Assert a condition at run-time.
uint16_t offset
Offset to command line.
int der_asn1(const void *data, size_t len, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from DER data.
uint32_t next
Next descriptor address.
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
int efisig_asn1(const void *data, size_t len, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from EFI signature list.
static int efisig_image_asn1(struct image *image, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from EFI signature list image.
static int efisig_image_probe(struct image *image)
Probe EFI signature list image.
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.
uint8_t data[48]
Additional event data.
uint32_t start
Starting offset.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define PROBE_NORMAL
Normal image probe priority.
#define __image_type(probe_order)
An executable image type.
int pem_asn1(const void *data, size_t len, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from PEM data.
static void(* free)(struct refcnt *refcnt))
#define offsetof(type, field)
Get offset of a field within a structure.
char * strerror(int errno)
Retrieve string representation of error number.
The format of a signature database.
UINT8 SignatureData[1]
The format of the signature is defined by the SignatureType.
UINT32 SignatureListSize
Total size of the signature list, including this header.
UINT32 SignatureSize
Size of each signature.
An executable image type.
const void * data
Read-only data.
size_t len
Length of raw file image.