efi: capsule: Add support for uefi capsule authentication
Add support for authenticating uefi capsules. Most of the signature verification functionality is shared with the uefi secure boot feature. The root certificate containing the public key used for the signature verification is stored as part of the device tree blob. The root certificate is stored as an efi signature list(esl) file -- this file contains the x509 certificate which is the root certificate. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
This commit is contained in:
committed by
Heinrich Schuchardt
parent
b4f20a5d83
commit
04be98bd6b
@@ -1812,6 +1812,24 @@ struct efi_variable_authentication_2 {
|
||||
struct win_certificate_uefi_guid auth_info;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
/**
|
||||
* efi_firmware_image_authentication - Capsule authentication method
|
||||
* descriptor
|
||||
*
|
||||
* This structure describes an authentication information for
|
||||
* a capsule with IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED set
|
||||
* and should be included as part of the capsule.
|
||||
* Only EFI_CERT_TYPE_PKCS7_GUID is accepted.
|
||||
*
|
||||
* @monotonic_count: Count to prevent replay
|
||||
* @auth_info: Authentication info
|
||||
*/
|
||||
struct efi_firmware_image_authentication {
|
||||
uint64_t monotonic_count;
|
||||
struct win_certificate_uefi_guid auth_info;
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
/**
|
||||
* efi_signature_data - A format of signature
|
||||
*
|
||||
|
||||
@@ -819,6 +819,8 @@ struct efi_signature_store *efi_sigstore_parse_sigdb(u16 *name);
|
||||
|
||||
bool efi_secure_boot_enabled(void);
|
||||
|
||||
bool efi_capsule_auth_enabled(void);
|
||||
|
||||
bool efi_image_parse(void *efi, size_t len, struct efi_image_regions **regp,
|
||||
WIN_CERTIFICATE **auth, size_t *auth_len);
|
||||
|
||||
@@ -847,6 +849,10 @@ efi_status_t EFIAPI efi_query_capsule_caps(
|
||||
u64 *maximum_capsule_size,
|
||||
u32 *reset_type);
|
||||
|
||||
efi_status_t efi_capsule_authenticate(const void *capsule,
|
||||
efi_uintn_t capsule_size,
|
||||
void **image, efi_uintn_t *image_size);
|
||||
|
||||
#define EFI_CAPSULE_DIR L"\\EFI\\UpdateCapsule\\"
|
||||
|
||||
/* Hook at initialization */
|
||||
|
||||
Reference in New Issue
Block a user