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/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/securerom')
-rw-r--r-- | src/securerom/ROM.C | 8 | ||||
-rw-r--r-- | src/securerom/contrib/sha512.C | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/securerom/ROM.C b/src/securerom/ROM.C index 97fe1f479..129052680 100644 --- a/src/securerom/ROM.C +++ b/src/securerom/ROM.C @@ -121,7 +121,7 @@ asm(".globl .L.ROM_verify"); ROM_response ROM_verify( ROM_container_raw* container, ROM_hw_params* params ) { - sha2_hash_t digest; + SHA512_t digest; ROM_prefix_header_raw* prefix; ROM_prefix_data_raw* hw_data; ROM_sw_header_raw* header; @@ -140,7 +140,7 @@ ROM_response ROM_verify( ROM_container_raw* container, // process hw keys // test for valid hw keys SHA512_Hash(container->hw_pkey_a, HW_KEY_COUNT*sizeof(ecc_key_t), &digest); - if(memcmp(params->hw_key_hash, digest, sizeof(sha2_hash_t))) + if(memcmp(params->hw_key_hash, digest, sizeof(SHA512_t))) { FAILED(HW_KEY_HASH_TEST,"invalid hw keys"); } @@ -169,7 +169,7 @@ ROM_response ROM_verify( ROM_container_raw* container, // test for valid prefix payload hash size = GET64(prefix->payload_size); SHA512_Hash(hw_data->sw_pkey_p, size, &digest); - if(memcmp(prefix->payload_hash, digest, sizeof(sha2_hash_t))) + if(memcmp(prefix->payload_hash, digest, sizeof(SHA512_t))) { FAILED(PREFIX_HASH_TEST,"invalid prefix payload hash"); } @@ -223,7 +223,7 @@ ROM_response ROM_verify( ROM_container_raw* container, // begin test for valid sw payload hash SHA512_Hash((uint8_t*)container + 4096, size, &digest); - if(memcmp(header->payload_hash, digest, sizeof(sha2_hash_t))) + if(memcmp(header->payload_hash, digest, sizeof(SHA512_t))) { FAILED(HEADER_HASH_TEST,"invalid sw payload hash"); } diff --git a/src/securerom/contrib/sha512.C b/src/securerom/contrib/sha512.C index 6ce16ce1c..65d29cbac 100644 --- a/src/securerom/contrib/sha512.C +++ b/src/securerom/contrib/sha512.C @@ -406,7 +406,7 @@ static void SHA512_Last(SHA512_CTX* context) } asm(".globl .L.SHA512_Final"); -void SHA512_Final(SHA512_CTX* context, sha2_hash_t *result) { +void SHA512_Final(SHA512_CTX* context, SHA512_t *result) { /* Sanity check: */ //assert(context != (SHA512_CTX*)0); @@ -421,10 +421,10 @@ void SHA512_Final(SHA512_CTX* context, sha2_hash_t *result) { } asm(".globl .L.SHA512_Hash"); -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) { SHA512_CTX context; SHA512_Init(&context); SHA512_Update(&context, data, len); SHA512_Final(&context, result); -}
\ No newline at end of file +} |