Fixes from using cppcheck tool

Various fixes for uninitialized variable use.
sniffer.c: close file when seek fails
tls.c: fix QSH_GET_SIZE macro
wolfio.c: uIPGenerateCookie: use the parameter, _ctx, instead of self
referencing.
wolfssl_adds.c: check for equivalent to XBADFILE to indicate error.
SP: change right shift of signed value to unsigned
sp_int.h: define 128-bit types
types.h: change a XMALLOC define to not use (,,) - cppcheck doesn't like
it and is unnecessary.
This commit is contained in:
Sean Parkinson
2019-09-26 08:48:19 +10:00
parent ea68e146c7
commit 901ee627fc
26 changed files with 697 additions and 683 deletions

View File

@@ -233,8 +233,13 @@ static int check_md5(void)
ret = wc_Md5Final(&defMd5, defDigest);
}
if (memcmp(mcDigest, defDigest, CRYPT_MD5_DIGEST_SIZE) != 0) {
printf("md5 final memcmp fialed\n");
if (ret != 0) {
printf("md5 failed\n");
return -1;
}
if (ret == 0 && memcmp(mcDigest, defDigest, CRYPT_MD5_DIGEST_SIZE) != 0) {
printf("md5 final memcmp failed\n");
return -1;
}
printf("md5 mcapi test passed\n");