TCG_BOOT_SERVICE_CAPABILITY capability = {
.Size = sizeof(capability),
};
- EFI_STATUS status;
+ EFI_STATUS err;
UINT32 features;
EFI_TCG *tcg;
- status = BS->LocateProtocol((EFI_GUID *) EFI_TCG_GUID, NULL, (void **) &tcg);
- if (EFI_ERROR(status))
+ err = BS->LocateProtocol((EFI_GUID *) EFI_TCG_GUID, NULL, (void **) &tcg);
+ if (EFI_ERROR(err))
return NULL;
- status = tcg->StatusCheck(
+ err = tcg->StatusCheck(
tcg,
&capability,
&features,
&event_log_location,
&event_log_last_entry);
- if (EFI_ERROR(status))
+ if (EFI_ERROR(err))
return NULL;
if (capability.TPMDeactivatedFlag)
EFI_TCG2_BOOT_SERVICE_CAPABILITY capability = {
.Size = sizeof(capability),
};
- EFI_STATUS status;
+ EFI_STATUS err;
EFI_TCG2 *tcg;
- status = BS->LocateProtocol((EFI_GUID *) EFI_TCG2_GUID, NULL, (void **) &tcg);
- if (EFI_ERROR(status))
+ err = BS->LocateProtocol((EFI_GUID *) EFI_TCG2_GUID, NULL, (void **) &tcg);
+ if (EFI_ERROR(err))
return NULL;
- status = tcg->GetCapability(tcg, &capability);
- if (EFI_ERROR(status))
+ err = tcg->GetCapability(tcg, &capability);
+ if (EFI_ERROR(err))
return NULL;
if (capability.StructureVersion.Major == 1 &&
static EFIAPI EFI_STATUS security2_policy_authentication (const EFI_SECURITY2_PROTOCOL *this,
const EFI_DEVICE_PATH_PROTOCOL *device_path,
void *file_buffer, UINTN file_size, BOOLEAN boot_policy) {
- EFI_STATUS status;
+ EFI_STATUS err;
assert(this);
/* device_path and file_buffer may be NULL */
/* Chain original security policy */
- status = es2fa(this, device_path, file_buffer, file_size, boot_policy);
+ err = es2fa(this, device_path, file_buffer, file_size, boot_policy);
/* if OK, don't bother with MOK check */
- if (!EFI_ERROR(status))
- return status;
+ if (!EFI_ERROR(err))
+ return err;
if (shim_validate(file_buffer, file_size))
return EFI_SUCCESS;
- return status;
+ return err;
}
/*
*/
static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROTOCOL *this, UINT32 authentication_status,
const EFI_DEVICE_PATH_PROTOCOL *device_path_const) {
- EFI_STATUS status;
+ EFI_STATUS err;
_cleanup_freepool_ CHAR16 *dev_path_str = NULL;
EFI_HANDLE h;
_cleanup_freepool_ CHAR8 *file_buffer = NULL;
return EFI_INVALID_PARAMETER;
EFI_DEVICE_PATH *dp = (EFI_DEVICE_PATH *) device_path_const;
- status = BS->LocateDevicePath(&FileSystemProtocol, &dp, &h);
- if (EFI_ERROR(status))
- return status;
+ err = BS->LocateDevicePath(&FileSystemProtocol, &dp, &h);
+ if (EFI_ERROR(err))
+ return err;
_cleanup_(file_closep) EFI_FILE *root = NULL;
- status = open_volume(h, &root);
- if (status != EFI_SUCCESS)
- return status;
+ err = open_volume(h, &root);
+ if (err != EFI_SUCCESS)
+ return err;
dev_path_str = DevicePathToStr(dp);
if (!dev_path_str)
return EFI_OUT_OF_RESOURCES;
- status = file_read(root, dev_path_str, 0, 0, &file_buffer, &file_size);
- if (EFI_ERROR(status))
- return status;
+ err = file_read(root, dev_path_str, 0, 0, &file_buffer, &file_size);
+ if (EFI_ERROR(err))
+ return err;
if (shim_validate(file_buffer, file_size))
return EFI_SUCCESS;
EFI_STATUS security_policy_install(void) {
EFI_SECURITY_PROTOCOL *security_protocol;
EFI_SECURITY2_PROTOCOL *security2_protocol = NULL;
- EFI_STATUS status;
+ EFI_STATUS err;
/* Already Installed */
if (esfas)
*/
BS->LocateProtocol((EFI_GUID*) SECURITY_PROTOCOL2_GUID, NULL, (void**) &security2_protocol);
- status = BS->LocateProtocol((EFI_GUID*) SECURITY_PROTOCOL_GUID, NULL, (void**) &security_protocol);
+ err = BS->LocateProtocol((EFI_GUID*) SECURITY_PROTOCOL_GUID, NULL, (void**) &security_protocol);
/* This one is mandatory, so there's a serious problem */
- if (EFI_ERROR(status))
- return status;
+ if (EFI_ERROR(err))
+ return err;
esfas = security_protocol->FileAuthenticationState;
security_protocol->FileAuthenticationState = security_policy_authentication;