Fixes from cppcheck

Added PRIVATE_D version of rsa private key operation for SP
implementation for specific platforms.
WC_NO_RNG results in warnings when RNG calls don't do anything.
Added ifdef checks for variables not used otherwise.
Remove superfluous if statements like when checking ret == 0.
Change names of globals that are generic and are used locally before
global definition.
Remove definition of variable len that isn't used except as a
replacement for sz which is parameter.
Don't subtract two variables when one has just been assigned the value
of the other.
Fix shifting of signed value.
Fix parameter checking in aes.c and des3.c for platform specific code.
This commit is contained in:
Sean Parkinson
2020-04-08 09:46:22 +10:00
parent 9a1687d00e
commit 411aee6e05
43 changed files with 1767 additions and 719 deletions
+3 -3
View File
@@ -212,9 +212,9 @@ int wc_bigint_alloc(WC_BIGINT* a, word32 sz)
}
if (a->buf == NULL) {
a->buf = (byte*)XMALLOC(sz, a->heap, DYNAMIC_TYPE_WOLF_BIGINT);
}
if (a->buf == NULL) {
err = MP_MEM;
if (a->buf == NULL) {
err = MP_MEM;
}
}
else {
XMEMSET(a->buf, 0, sz);