diff options
author | nagendra modadugu <ngm@google.com> | 2016-12-13 13:31:21 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-12-14 06:03:07 -0800 |
commit | c648430a6d3bd525becb523bf50703f16e147515 (patch) | |
tree | e84285f54f049f879d06944ff6749d2a3eea922b /chip | |
parent | dba4c111137b1819538a314043760bf17092690f (diff) | |
download | chrome-ec-c648430a6d3bd525becb523bf50703f16e147515.tar.gz |
CR50: fix errors flagged by coverity
- Update SHA_DIGEST_MAX_BYTES to reflect SHA-512 support
- Fix unitialized variable error in tpm2/hash.c
BRANCH=none
BUG=none
CQ-DEPEND=CL:419327
TEST=make buildall succeeds
Change-Id: Ie002e5807d1e616da034dbb8896867572e148e00
Signed-off-by: nagendra modadugu <ngm@google.com>
Reviewed-on: https://chromium-review.googlesource.com/419698
Commit-Ready: Nagendra Modadugu <ngm@google.com>
Tested-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/g/dcrypto/internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chip/g/dcrypto/internal.h b/chip/g/dcrypto/internal.h index c90d39e0f0..8c7ec267eb 100644 --- a/chip/g/dcrypto/internal.h +++ b/chip/g/dcrypto/internal.h @@ -29,7 +29,11 @@ #define SHA_DIGEST_WORDS (SHA_DIGEST_SIZE / sizeof(uint32_t)) #define SHA256_DIGEST_WORDS (SHA256_DIGEST_SIZE / sizeof(uint32_t)) +#ifdef SHA512_SUPPORT +#define SHA_DIGEST_MAX_BYTES SHA512_DIGEST_SIZE +#else #define SHA_DIGEST_MAX_BYTES SHA256_DIGEST_SIZE +#endif enum sha_mode { SHA1_MODE = 0, |