diff options
author | Jaymes Wilks <mjwilks@us.ibm.com> | 2017-07-25 16:08:02 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-04 09:53:51 -0400 |
commit | 0914d87ae57960ef859886a67b5ae1187aa82474 (patch) | |
tree | ad0c445fa7b0294150e0a5ff3aadc955ea40ca89 /src/include/securerom | |
parent | 69b38d2b257691fb31347ef0ab1ffab9f74d8ab7 (diff) | |
download | talos-hostboot-0914d87ae57960ef859886a67b5ae1187aa82474.tar.gz talos-hostboot-0914d87ae57960ef859886a67b5ae1187aa82474.zip |
Fix duplicate sha512 definitions
All instances for sha2_hash_t have been replaced with SHA512_t and
the SHA512_t typedef is now in securerom/contrib/sha512.H in place
of the old definition.
Change-Id: I32524524d755eb3b0264881317d9be5a294dc9a7
RTC:172333
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43610
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/securerom')
-rw-r--r-- | src/include/securerom/ROM.H | 18 | ||||
-rw-r--r-- | src/include/securerom/contrib/sha512.H | 8 | ||||
-rw-r--r-- | src/include/securerom/hw_utils.H | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/include/securerom/ROM.H b/src/include/securerom/ROM.H index fbfbae3e0..efd90b970 100644 --- a/src/include/securerom/ROM.H +++ b/src/include/securerom/ROM.H @@ -68,7 +68,7 @@ typedef struct uint32_t flags; uint8_t sw_key_count; uint64_t payload_size; - sha2_hash_t payload_hash; + SHA512_t payload_hash; uint8_t ecid_count; // optional ecid place holder ecid_count * ecid_size(128 bits) uint8_t ecid[ECID_SIZE]; @@ -96,7 +96,7 @@ typedef struct uint32_t flags; uint8_t reserved_0; uint64_t payload_size; - sha2_hash_t payload_hash; + SHA512_t payload_hash; uint8_t ecid_count; // optional ecid place holder ecid_count * ecid_size(128 bits) uint8_t ecid[ECID_SIZE]; @@ -120,10 +120,10 @@ typedef enum { ROM_DONE, ROM_FAILED } ROM_response; typedef struct { - sha2_hash_t hw_key_hash; - uint8_t my_ecid[ECID_SIZE]; - uint64_t entry_point; - uint64_t log; + SHA512_t hw_key_hash; + uint8_t my_ecid[ECID_SIZE]; + uint64_t entry_point; + uint64_t log; }__attribute__((packed)) ROM_hw_params; extern void ROM_sreset (void); @@ -220,11 +220,11 @@ ROM_response call_rom_verify(void*, const ROM_container_raw*, ROM_hw_params*); * @param[in] void* Address of function offset into Secure ROM * @param[in] sha2_byte* Pointer to effective address of blob to hash * @param[in] size_t Size of blob to hash - * @param[in/out] sha2_hash_t* Pointer to resulting hash value + * @param[in/out] SHA512_t* Pointer to resulting hash value * * @return N/A */ -void call_rom_SHA512(void*, const sha2_byte *, size_t, sha2_hash_t*); +void call_rom_SHA512(void*, const sha2_byte *, size_t, SHA512_t*); #ifdef __cplusplus } @@ -306,7 +306,7 @@ enum SB_FUNC_VERS : sbFuncVer_t // rom_entry.S // SHA512 Hash function definition(s) per version - SHA512_INIT = 0x0001, // void call_rom_SHA512(void*, const sha2_byte *, size_t, sha2_hash_t*); + SHA512_INIT = 0x0001, // void call_rom_SHA512(void*, const sha2_byte *, size_t, SHA512_t*); // ECDSA521 function definition(s) per version ECDSA521_INIT = 0x0001, // ROM_response call_rom_verify(void*, const ROM_container_raw*, ROM_hw_params*); diff --git a/src/include/securerom/contrib/sha512.H b/src/include/securerom/contrib/sha512.H index 9ae4310f8..c273fb050 100644 --- a/src/include/securerom/contrib/sha512.H +++ b/src/include/securerom/contrib/sha512.H @@ -59,8 +59,7 @@ #include <stdlib.h> -typedef uint8_t __attribute__((aligned(8))) \ - sha2_hash_t[ SHA512_DIGEST_LENGTH / sizeof(uint8_t) ]; +typedef uint8_t SHA512_t[SHA512_DIGEST_LENGTH]; typedef uint8_t sha2_byte; /* Exactly 1 byte */ typedef uint32_t sha2_word32; /* Exactly 4 bytes */ @@ -73,13 +72,14 @@ typedef struct _SHA512_CTX uint8_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; + extern "C" void SHA512_Init(SHA512_CTX* context); extern "C" void SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len); extern "C" -void SHA512_Final(SHA512_CTX* context, sha2_hash_t *result); +void SHA512_Final(SHA512_CTX* context, SHA512_t *result); extern "C" -void SHA512_Hash(const sha2_byte *data, size_t len, sha2_hash_t *result); +void SHA512_Hash(const sha2_byte *data, size_t len, SHA512_t *result); #endif diff --git a/src/include/securerom/hw_utils.H b/src/include/securerom/hw_utils.H index 014d82d20..54cae61fd 100644 --- a/src/include/securerom/hw_utils.H +++ b/src/include/securerom/hw_utils.H @@ -78,7 +78,7 @@ typedef struct uint64_t mask; } FSP_BAR; uint8_t ECID[ECID_SIZE]; - sha2_hash_t PIBMEM_HW_KEY_HASH; + SHA512_t PIBMEM_HW_KEY_HASH; uint8_t* data; // 64M+4K malloc/mmap uint8_t* memory; // 64M (4K aligned) int mfd; |