summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-07-14 08:14:08 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-07-16 12:37:02 +0200
commit1a7b0f6e4ec908da1f93ea77a251429892ef0c8a (patch)
treee216507f5bbece0b55d3f6df0fd601f8190f4ad3 /lib/efi_loader
parent012c56ac76e1bdabc711a90898e81316e1d1a020 (diff)
efi_loader: update secure state
Update the UEFI secure state when variable 'PK' is updated in the TEE variables implementation. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_variable_tee.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c
index 24e0663ebd..c042348938 100644
--- a/lib/efi_loader/efi_variable_tee.c
+++ b/lib/efi_loader/efi_variable_tee.c
@@ -557,6 +557,12 @@ efi_status_t efi_set_variable_int(u16 *variable_name, const efi_guid_t *vendor,
var_property.maxsize = var_acc->data_size;
ret = set_property_int(variable_name, name_size, vendor, &var_property);
}
+
+ if (alt_ret != EFI_SUCCESS)
+ goto out;
+
+ if (!u16_strcmp(variable_name, L"PK"))
+ alt_ret = efi_init_secure_state();
out:
free(comm_buf);
return alt_ret == EFI_SUCCESS ? ret : alt_ret;
@@ -716,5 +722,9 @@ efi_status_t efi_init_variables(void)
MM_VARIABLE_COMMUNICATE_SIZE +
max_payload_size;
+ ret = efi_init_secure_state();
+ if (ret != EFI_SUCCESS)
+ return ret;
+
return EFI_SUCCESS;
}