mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-15 07:43:07 +00:00
6a2e26b95f
The current capsule authentication code checks if the environment variable capsule_authentication_enabled is set, for authenticating the capsule. This is in addition to the check for the config symbol CONFIG_EFI_CAPSULE_AUTHENTICATE. Remove the check for the environment variable. The capsule will now be authenticated if the config symbol is set. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviwed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
43 lines
888 B
C
43 lines
888 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (c) 2020 Linaro Limited
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <efi_api.h>
|
|
#include <efi_loader.h>
|
|
#include <env.h>
|
|
#include <fdtdec.h>
|
|
#include <asm/global_data.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
int efi_get_public_key_data(void **pkey, efi_uintn_t *pkey_len)
|
|
{
|
|
const void *fdt_blob = gd->fdt_blob;
|
|
const void *blob;
|
|
const char *cnode_name = "capsule-key";
|
|
const char *snode_name = "signature";
|
|
int sig_node;
|
|
int len;
|
|
|
|
sig_node = fdt_subnode_offset(fdt_blob, 0, snode_name);
|
|
if (sig_node < 0) {
|
|
EFI_PRINT("Unable to get signature node offset\n");
|
|
return -FDT_ERR_NOTFOUND;
|
|
}
|
|
|
|
blob = fdt_getprop(fdt_blob, sig_node, cnode_name, &len);
|
|
|
|
if (!blob || len < 0) {
|
|
EFI_PRINT("Unable to get capsule-key value\n");
|
|
*pkey = NULL;
|
|
*pkey_len = 0;
|
|
return -FDT_ERR_NOTFOUND;
|
|
}
|
|
|
|
*pkey = (void *)blob;
|
|
*pkey_len = len;
|
|
|
|
return 0;
|
|
}
|