aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamakrishna Pallala <[email protected]>2017-08-29 08:12:20 -0400
committerRamakrishna Pallala <[email protected]>2017-08-29 08:12:20 -0400
commit72ed9c800348f5a7b703aeb82bc634b37ad641f6 (patch)
tree9cb16472a06d3e337e1cc84e403f3a382537790e
parent3e4e536c33f9e8ca32eeae1e32885371bed31131 (diff)
tinycrypt/sha256: Array compared to NULL has no effect
This commit fixes the issue reported by Coverity: an array compared against NULL is always false. Signed-off-by: Ramakrishna Pallala <[email protected]>
-rw-r--r--lib/source/sha256.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/source/sha256.c b/lib/source/sha256.c
index 2fbee4f..b4efd20 100644
--- a/lib/source/sha256.c
+++ b/lib/source/sha256.c
@@ -66,7 +66,6 @@ int tc_sha256_update(TCSha256State_t s, const uint8_t *data, size_t datalen)
{
/* input sanity check: */
if (s == (TCSha256State_t) 0 ||
- s->iv == (unsigned int *) 0 ||
data == (void *) 0) {
return TC_CRYPTO_FAIL;
} else if (datalen == 0) {
@@ -91,8 +90,7 @@ int tc_sha256_final(uint8_t *digest, TCSha256State_t s)
/* input sanity check: */
if (digest == (uint8_t *) 0 ||
- s == (TCSha256State_t) 0 ||
- s->iv == (unsigned int *) 0) {
+ s == (TCSha256State_t) 0) {
return TC_CRYPTO_FAIL;
}