Files
Mike Crowe 990e3e81e6 Use LF line endings in the repository
Convert the line endings stored for all text files in the repository to
LF. The majority previously used DOS-style CRLF line endings. Add a
.gitattributes file to enforce this and treat certain extensions as
never being text files.

Update PatchCheck.py to insist on LF line endings rather than CRLF.
However, its other checks fail on this commit due to lots of
pre-existing complaints that it only notices because the line endings
have changed.

Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch
needs to be treated as binary since it contains a mixture of line
endings.

This change has implications depending on the client platform you are
using the repository from:

* Windows

The usual configuration for Git on Windows means that text files will
be checked out to the work tree with DOS-style CRLF line endings. If
that's not the case then you can configure Git to do so for the entire
machine with:

 git config --global core.autocrlf true

or for just the repository with:

 git config core.autocrlf true

Line endings will be normalised to LF when they are committed to the
repository. If you commit a text file with only LF line endings then it
will be converted to CRLF line endings in your work tree.

* Linux, MacOS and other Unices

The usual configuration for Git on such platforms is to check files out
of the repository with LF line endings. This is probably the right thing
for you. In the unlikely even that you are using Git on Unix but editing
or compiling on Windows for some reason then you may need to tweak your
configuration to force the use of CRLF line endings as described above.

* General

For more information see
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings .

Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400
Signed-off-by: Mike Crowe <mac@mcrowe.com>
2021-11-10 12:46:42 -08:00

93 lines
2.5 KiB
C

/** @file
This file defines the hob structure used for paylod.
Copyright (c) 2017-2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __PAYLOAD_KEY_HASH_GUID_H__
#define __PAYLOAD_KEY_HASH_GUID_H__
///
/// The pre-process public key GUID used for payload to verify image.
///
extern EFI_GUID gPayloadKeyHashGuid;
#define HASH_STORE_SIGNATURE SIGNATURE_32('_', 'H', 'S', '_')
#define COMP_TYPE_STAGE_1B 0
#define COMP_TYPE_STAGE_2 1
#define COMP_TYPE_PAYLOAD 2
#define COMP_TYPE_PAYLOAD_FWU 3
#define COMP_TYPE_INVALID 4
//
// Hash Table Definition for Component and Public key usage
//
typedef UINT32 HASH_COMP_USAGE;
#define HASH_USAGE_STAGE_1B (1 << COMP_TYPE_STAGE_1B)
#define HASH_USAGE_STAGE_2 (1 << COMP_TYPE_STAGE_2)
#define HASH_USAGE_PAYLOAD (1 << COMP_TYPE_PAYLOAD)
#define HASH_USAGE_FIRMWARE_UPDATE (1 << COMP_TYPE_PAYLOAD_FWU)
#define HASH_USAGE_PUBKEY_MASTER BIT8
#define HASH_USAGE_PUBKEY_CFG_DATA BIT9
#define HASH_USAGE_PUBKEY_FWU BIT10
#define HASH_USAGE_PUBKEY_OS BIT11
#define HASH_USAGE_PUBKEY_CONTAINER_DEF BIT12
#define HASH_USAGE_PUBKEY_OEM_0 BIT24
#define HASH_USAGE_PUBKEY_OEM_1 BIT25
#define HASH_USAGE_PUBKEY_OEM_2 BIT26
#define HASH_USAGE_PUBKEY_OEM_3 BIT27
#define HASH_USAGE_PUBKEY_OEM_4 BIT28
#define HASH_USAGE_PUBKEY_OEM_5 BIT29
#define HASH_USAGE_PUBKEY_OEM_6 BIT30
#define HASH_USAGE_PUBKEY_OEM_7 BIT31
#define HASH_USAGE_PUBKEY_OEM(x) (HASH_USAGE_PUBKEY_OEM_0 << (x))
#pragma pack(1)
typedef struct {
//
// Usage corresponds to components bit mask for hash is valid
//
HASH_COMP_USAGE Usage;
//
// Hash algorithm used for digest
//
UINT8 HashAlg;
UINT8 Reserved;
//
// Digest Length
//
UINT16 DigestLen;
//
// Hash of the component
//
UINT8 Digest[0];
} HASH_STORE_DATA;
typedef struct {
UINT32 Signature;
UINT8 Revision;
UINT8 HeaderLength;
UINT8 Reserved[2];
//
// Total valid hash store data including the header
//
UINT32 UsedLength;
//
// The total space for hash store data allocated
//
UINT32 TotalLength;
//
// Hash store data chain with type HASH_STORE_DATA
//
UINT8 Data[0];
} HASH_STORE_TABLE;
#pragma pack()
#endif