vaseboot/include/VasEBoot/key_protector.h

48 lines
1.5 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2022 Microsoft Corporation
* Copyright (C) 2024 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_PROTECTOR_HEADER
#define VAS_EBOOT_PROTECTOR_HEADER 1
#include <VasEBoot/err.h>
#include <VasEBoot/types.h>
struct VasEBoot_key_protector
{
struct VasEBoot_key_protector *next;
struct VasEBoot_key_protector **prev;
const char *name;
VasEBoot_err_t (*recover_key) (VasEBoot_uint8_t **key, VasEBoot_size_t *key_size);
};
VasEBoot_err_t
VasEBoot_key_protector_register (struct VasEBoot_key_protector *protector);
VasEBoot_err_t
VasEBoot_key_protector_unregister (struct VasEBoot_key_protector *protector);
VasEBoot_err_t
VasEBoot_key_protector_recover_key (const char *protector,
VasEBoot_uint8_t **key,
VasEBoot_size_t *key_size);
#endif /* ! VAS_EBOOT_PROTECTOR_HEADER */