diff options
author | Flavio Santes <[email protected]> | 2016-11-18 18:11:37 -0600 |
---|---|---|
committer | Flavio Santes <[email protected]> | 2016-11-18 18:11:37 -0600 |
commit | 351636e0932b1d6b7b4d189723ba64997f453c30 (patch) | |
tree | 7e574c873bba9a4cc8db28ccdc0e56ede094420a | |
parent | 23e77279bd97e10881def41eac28f3ec97c30e1a (diff) |
tinycrypt/sha256: Array compared to NULL has no effect
This commit fixes the issue reported by Coverity/Zephyr: an array
compared against NULL is always false.
Coverity-CID: 143715
Coverity-CID: 143730
Change-Id: Ia502736f605774b71c1a41a850b84663c78fc7d0
Signed-off-by: Flavio Santes <[email protected]>
-rw-r--r-- | lib/source/sha256.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/source/sha256.c b/lib/source/sha256.c index a02e464..c27d3e1 100644 --- a/lib/source/sha256.c +++ b/lib/source/sha256.c @@ -66,7 +66,6 @@ int32_t tc_sha256_update(TCSha256State_t s, const uint8_t *data, size_t datalen) { /* input sanity check: */ if (s == (TCSha256State_t) 0 || - s->iv == (uint32_t *) 0 || data == (void *) 0) { return TC_CRYPTO_FAIL; } else if (datalen == 0) { @@ -91,8 +90,7 @@ int32_t tc_sha256_final(uint8_t *digest, TCSha256State_t s) /* input sanity check: */ if (digest == (uint8_t *) 0 || - s == (TCSha256State_t) 0 || - s->iv == (uint32_t *) 0) { + s == (TCSha256State_t) 0) { return TC_CRYPTO_FAIL; } |