summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authornagendra modadugu <ngm@google.com>2016-12-13 13:31:21 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-12-15 15:53:48 +0000
commitda1e59bd1fe5acab7683a2e7d18731c7daab440f (patch)
tree127dd9074bcd30e80514b0bbe57b1dc4b8a081e5 /chip
parent246afeb8417f4404cdadff012389eb7de847875b (diff)
downloadchrome-ec-da1e59bd1fe5acab7683a2e7d18731c7daab440f.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> Reviewed-on: https://chromium-review.googlesource.com/420781 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Aaron Durbin <adurbin@chromium.org> Tested-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/g/dcrypto/internal.h4
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,