aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhackermnementh <[email protected]>2017-08-29 09:50:27 -0700
committerGitHub <[email protected]>2017-08-29 09:50:27 -0700
commitb584d780be6e39b0a1a7884be58b3825616dd113 (patch)
tree9cb16472a06d3e337e1cc84e403f3a382537790e
parent7c7e5c6bfb1de2762ecb4d15030f8a1fca58ed79 (diff)
parent72ed9c800348f5a7b703aeb82bc634b37ad641f6 (diff)
Merge pull request #25 from ramakrishnapallala/coverity
Thanks!
-rw-r--r--lib/source/hmac.c9
-rw-r--r--lib/source/sha256.c4
2 files changed, 4 insertions, 9 deletions
diff --git a/lib/source/hmac.c b/lib/source/hmac.c
index 3f4dadd..89878ce 100644
--- a/lib/source/hmac.c
+++ b/lib/source/hmac.c
@@ -97,8 +97,7 @@ int tc_hmac_init(TCHmacState_t ctx)
{
/* input sanity check: */
- if (ctx == (TCHmacState_t) 0 ||
- ctx->key == (uint8_t *) 0) {
+ if (ctx == (TCHmacState_t) 0) {
return TC_CRYPTO_FAIL;
}
@@ -114,8 +113,7 @@ int tc_hmac_update(TCHmacState_t ctx,
{
/* input sanity check: */
- if (ctx == (TCHmacState_t) 0 ||
- ctx->key == (uint8_t *) 0) {
+ if (ctx == (TCHmacState_t) 0) {
return TC_CRYPTO_FAIL;
}
@@ -130,8 +128,7 @@ int tc_hmac_final(uint8_t *tag, unsigned int taglen, TCHmacState_t ctx)
/* input sanity check: */
if (tag == (uint8_t *) 0 ||
taglen != TC_SHA256_DIGEST_SIZE ||
- ctx == (TCHmacState_t) 0 ||
- ctx->key == (uint8_t *) 0) {
+ ctx == (TCHmacState_t) 0) {
return TC_CRYPTO_FAIL;
}
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;
}