1 | /* $Id: UefiVariableStoreImpl.h 91396 2021-09-27 13:40:35Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox COM UEFI variable store class implementation
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2021 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.alldomusa.eu.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef MAIN_INCLUDED_UefiVariableStoreImpl_h
|
---|
19 | #define MAIN_INCLUDED_UefiVariableStoreImpl_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "UefiVariableStoreWrap.h"
|
---|
25 | #include <iprt/types.h>
|
---|
26 |
|
---|
27 | #include <iprt/formats/efi-common.h>
|
---|
28 |
|
---|
29 | class NvramStore;
|
---|
30 | class Machine;
|
---|
31 |
|
---|
32 | class ATL_NO_VTABLE UefiVariableStore :
|
---|
33 | public UefiVariableStoreWrap
|
---|
34 | {
|
---|
35 | public:
|
---|
36 |
|
---|
37 | DECLARE_COMMON_CLASS_METHODS(UefiVariableStore)
|
---|
38 |
|
---|
39 | HRESULT FinalConstruct();
|
---|
40 | void FinalRelease();
|
---|
41 |
|
---|
42 | // public initializer/uninitializer for internal purposes only
|
---|
43 | HRESULT init(NvramStore *aParent, Machine *pMachine, RTVFS hVfsUefiVarStore);
|
---|
44 | void uninit();
|
---|
45 |
|
---|
46 | // public methods for internal purposes only
|
---|
47 |
|
---|
48 | private:
|
---|
49 |
|
---|
50 | // Wrapped NVRAM store properties
|
---|
51 |
|
---|
52 | // Wrapped NVRAM store members
|
---|
53 | HRESULT addVariable(const com::Utf8Str &aName, const com::Guid &aOwnerUuid, const std::vector<BYTE> &aData);
|
---|
54 | HRESULT deleteVariable(const com::Utf8Str &aName, const com::Guid &aOwnerUuid);
|
---|
55 | HRESULT changeVariable(const com::Utf8Str &aName, const com::Guid &aOwnerUuid, const std::vector<BYTE> &aData);
|
---|
56 | HRESULT queryVariableByName(const com::Utf8Str &aName, com::Guid &aOwnerUuid, std::vector<BYTE> &aData);
|
---|
57 | HRESULT queryVariables(std::vector<com::Utf8Str> &aNames, std::vector<com::Guid> &aOwnerUuids);
|
---|
58 | HRESULT enrollPlatformKey(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid);
|
---|
59 | HRESULT addKek(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
|
---|
60 | HRESULT addSignatureToDb(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
|
---|
61 | HRESULT addSignatureToDbx(const std::vector<BYTE> &aData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
|
---|
62 | HRESULT enrollDefaultMsSignatures(void);
|
---|
63 |
|
---|
64 | int i_uefiVarStoreSetVarAttr(const char *pszVar, uint32_t fAttr);
|
---|
65 |
|
---|
66 | HRESULT i_uefiVarStoreAddVar(PCEFI_GUID pGuid, const char *pszVar, uint32_t fAttr, PRTVFSFILE phVfsFile);
|
---|
67 | HRESULT i_uefiSigDbAddSig(RTEFISIGDB hEfiSigDb, const void *pvData, size_t cbData, const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
|
---|
68 | HRESULT i_uefiVarStoreAddSignatureToDbVec(PCEFI_GUID pGuid, const char *pszDb, const std::vector<BYTE> &aData,
|
---|
69 | const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
|
---|
70 | HRESULT i_uefiVarStoreAddSignatureToDb(PCEFI_GUID pGuid, const char *pszDb, const void *pvData, size_t cbData,
|
---|
71 | const com::Guid &aOwnerUuid, SignatureType_T enmSignatureType);
|
---|
72 |
|
---|
73 | struct Data; // opaque data struct, defined in UefiVariableStoreImpl.cpp
|
---|
74 | Data *m;
|
---|
75 | };
|
---|
76 |
|
---|
77 | #endif /* !MAIN_INCLUDED_UefiVariableStoreImpl_h */
|
---|
78 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|