OpenCore
1.0.4
OpenCore Bootloader
|
#include <Library/BaseOverflowLib.h>
#include <Library/OcCryptoLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcSerializeLib.h>
Go to the source code of this file.
Data Structures | |
struct | OC_STORAGE_CONTEXT |
Macros | |
#define | OC_STORAGE_VAULT_PATH L"vault.plist" |
#define | OC_STORAGE_VAULT_SIGNATURE_PATH L"vault.sig" |
#define | OC_STORAGE_VAULT_VERSION 1 |
#define | OC_STORAGE_SAFE_PATH_MAX 128 |
#define | OC_STORAGE_VAULT_HASH_FIELDS(_, __) |
#define | OC_STORAGE_VAULT_FILES_FIELDS(_, __) |
#define | OC_STORAGE_VAULT_FIELDS(_, __) |
Functions | |
EFI_STATUS | OcStorageInitFromFs (OUT OC_STORAGE_CONTEXT *Context, IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *FileSystem, IN EFI_HANDLE StorageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *StoragePath OPTIONAL, IN CONST CHAR16 *StorageRoot, IN OC_RSA_PUBLIC_KEY *StorageKey OPTIONAL) |
VOID | OcStorageFree (IN OUT OC_STORAGE_CONTEXT *Context) |
BOOLEAN | OcStorageExistsFileUnicode (IN OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *FilePath) |
VOID * | OcStorageReadFileUnicode (IN OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *FilePath, OUT UINT32 *FileSize OPTIONAL) |
EFI_STATUS | OcStorageGetInfo (IN OC_STORAGE_CONTEXT *Context, IN CONST CHAR16 *FilePath, OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *StorageHandle, OUT EFI_DEVICE_PATH_PROTOCOL **StoragePath, IN BOOLEAN RealPath) |
Copyright (C) 2019, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcStorageLib.h.
#define OC_STORAGE_SAFE_PATH_MAX 128 |
Safe maximum file path in the storage.
Definition at line 41 of file OcStorageLib.h.
#define OC_STORAGE_VAULT_FIELDS | ( | _, | |
__ ) |
Definition at line 54 of file OcStorageLib.h.
#define OC_STORAGE_VAULT_FILES_FIELDS | ( | _, | |
__ ) |
Definition at line 50 of file OcStorageLib.h.
#define OC_STORAGE_VAULT_HASH_FIELDS | ( | _, | |
__ ) |
Structure declaration for vault file.
Definition at line 46 of file OcStorageLib.h.
#define OC_STORAGE_VAULT_PATH L"vault.plist" |
Storage vault file containing a dictionary with SHA-256 hashes for all files.
Definition at line 26 of file OcStorageLib.h.
#define OC_STORAGE_VAULT_SIGNATURE_PATH L"vault.sig" |
RSA-2048 signature of SHA-256 hash of vault.plist.
Definition at line 31 of file OcStorageLib.h.
#define OC_STORAGE_VAULT_VERSION 1 |
Storage vault version declaring vault compatibility.
Definition at line 36 of file OcStorageLib.h.
BOOLEAN OcStorageExistsFileUnicode | ( | IN OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | FilePath ) |
Check whether file exists.
[in] | Context | Storage context. |
[in] | FilePath | The full path to the file on the device. |
TRUE | if file is present in vault or ondisk. |
Definition at line 340 of file OcStorageLib.c.
VOID OcStorageFree | ( | IN OUT OC_STORAGE_CONTEXT * | Context | ) |
Free storage context resources.
[in,out] | Context | Storage context. |
Definition at line 315 of file OcStorageLib.c.
EFI_STATUS OcStorageGetInfo | ( | IN OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | FilePath, | ||
OUT EFI_DEVICE_PATH_PROTOCOL ** | DevicePath, | ||
OUT EFI_HANDLE * | StorageHandle, | ||
OUT EFI_DEVICE_PATH_PROTOCOL ** | StoragePath, | ||
IN BOOLEAN | RealPath ) |
Get information about the storage file when possible.
[in] | Context | Storage context. |
[in] | FilePath | The full path to the file on the device. |
[out] | DevicePath | Full storage file device path. |
[out] | StorageHandle | Storage handle. |
[out] | StoragePath | Path on the storage. |
[in] | RealPath | Provide real paths instead of dummy. |
EFI_SUCCESS | on success. |
EFI_STATUS OcStorageInitFromFs | ( | OUT OC_STORAGE_CONTEXT * | Context, |
IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL * | FileSystem, | ||
IN EFI_HANDLE StorageHandle | OPTIONAL, | ||
IN EFI_DEVICE_PATH_PROTOCOL *StoragePath | OPTIONAL, | ||
IN CONST CHAR16 * | StorageRoot, | ||
IN OC_RSA_PUBLIC_KEY *StorageKey | OPTIONAL ) |
Create storage context from UEFI file system at specified path.
[out] | Context | Resulting storage context. |
[in] | FileSystem | Storage file system. |
[in] | StorageHandle | Storage handle, optional. |
[in] | StoragePath | Actual storage device path, optional. |
[in] | StorageRoot | Storage file system root (e.g. L"\\"). |
[in] | StorageKey | Storage signature verification key, optional. |
EFI_SUCCESS | on success. |
Definition at line 215 of file OcStorageLib.c.
VOID * OcStorageReadFileUnicode | ( | IN OC_STORAGE_CONTEXT * | Context, |
IN CONST CHAR16 * | FilePath, | ||
OUT UINT32 *FileSize | OPTIONAL ) |
Read file from storage with implicit double (2 byte) null termination. Null termination does not affect the returned file size. Depending on the implementation 0 byte files may return null. If storage context was created with valid storage key, then signature checking will be performed
[in] | Context | Storage context. |
[in] | FilePath | The full path to the file on the device. |
[out] | FileSize | The size of the file read (optional). |
A | pointer to a buffer containing file read or NULL. |
Definition at line 383 of file OcStorageLib.c.