69 if ( remaining <
sizeof ( **lhdr ) ) {
70 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated header "
77 if ( remaining <
le32_to_cpu ( (*lhdr)->SignatureListSize ) ) {
78 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated list at "
82 remaining =
le32_to_cpu ( (*lhdr)->SignatureListSize );
86 if ( dlen <
sizeof ( **dhdr ) ) {
87 DBGC (
data,
"EFISIG [%#zx,%#zx) underlength "
93 if ( ( remaining <
sizeof ( **lhdr ) ) ||
94 ( ( remaining -
sizeof ( **lhdr ) ) <
96 DBGC (
data,
"EFISIG [%#zx,%#zx) malformed header at "
100 skip = (
sizeof ( **lhdr ) +
106 for ( ; remaining ;
offset += dlen, remaining -= dlen ) {
109 if ( remaining < dlen ) {
110 DBGC (
data,
"EFISIG [%#zx,%#zx) truncated "
148 int ( * asn1 ) (
const void *
data,
size_t len,
size_t offset,
163 ( ( asn1 ==
der_asn1 ) ?
"DER" :
"PEM" ) );
167 DBGC (
data,
"EFISIG [%#zx,%#zx) could not extract ASN.1: "
173 if ( ( (
unsigned int )
next ) !=
len ) {
174 DBGC (
data,
"EFISIG [%#zx,%#zx) malformed data\n",
199 unsigned int count = 0;
207 &lhdr, &dhdr ) ) != 0 ) {
217 DBGC (
image,
"EFISIG %s contains %d signatures\n",
244 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.
#define le32_to_cpu(value)
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 SignatureSize
Size of each signature.
An executable image type.
const void * data
Read-only data.
size_t len
Length of raw file image.