aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/eltan/security/mboot/mboot.c
diff options
context:
space:
mode:
authorWim Vervoorn <wvervoorn@eltan.com>2019-10-30 16:46:41 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-04 11:30:17 +0000
commit944fdc477140d874c1c674954044c0c2b540abb2 (patch)
treeddce8d938bbd37ee409e8289c5b2144e492eed24 /src/vendorcode/eltan/security/mboot/mboot.c
parentadf344013d30dc685bab3dbd148bdecb35e833b1 (diff)
vendorcode/eltan/security: Use custom hash for little endian only
Only use the custom hash routine when we need little endian. Rename the function as well as it is little endian only now. BUG=N/A TEST=tested on fbg1701 board. Change-Id: I037fa38c5961dab7a81e752c1685da2dc6b33d12 Signed-off-by: Wim Vervoorn <wvervoorn@eltan.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36482 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Diffstat (limited to 'src/vendorcode/eltan/security/mboot/mboot.c')
-rw-r--r--src/vendorcode/eltan/security/mboot/mboot.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/vendorcode/eltan/security/mboot/mboot.c b/src/vendorcode/eltan/security/mboot/mboot.c
index 5774429329..bae377a4d4 100644
--- a/src/vendorcode/eltan/security/mboot/mboot.c
+++ b/src/vendorcode/eltan/security/mboot/mboot.c
@@ -159,11 +159,8 @@ int mboot_hash_extend_log(EFI_TCG2_EVENT_ALGORITHM_BITMAP activePcr,
memcpy(digest->digest.sha1, (void *)hashData,
VB2_SHA1_DIGEST_SIZE);
} else {
- status = cb_sha_endian(VB2_HASH_SHA1, hashData,
- hashDataLen,
- digest->digest.sha1,
- NO_ENDIAN_ALGORITHM);
- if ( status )
+ if (cb_sha_little_endian(VB2_HASH_SHA1, hashData,
+ hashDataLen, digest->digest.sha1))
return TPM_E_IOERROR;
}
@@ -186,11 +183,9 @@ int mboot_hash_extend_log(EFI_TCG2_EVENT_ALGORITHM_BITMAP activePcr,
memcpy(digest->digest.sha256,
(void *)hashData, hashDataLen);
} else {
- status = cb_sha_endian(VB2_HASH_SHA256, hashData,
- hashDataLen,
- digest->digest.sha256,
- LITTLE_ENDIAN_ALGORITHM);
- if (status)
+
+ if (cb_sha_little_endian(VB2_HASH_SHA256, hashData,
+ hashDataLen, digest->digest.sha256))
return TPM_E_IOERROR;
}
digest->hashAlg = TPM_ALG_SHA256;