add early return to normal math and WOLFSSL_VALIDATE_ECC_IMPORT to enable-all and enable-fpecc builds

This commit is contained in:
Jacob Barthelmeh
2019-11-25 10:47:08 -07:00
parent 9a0a48e093
commit 316b8b0b4d
2 changed files with 7 additions and 1 deletions

View File

@@ -199,6 +199,9 @@ then
# Enable multiple attribute additions such as DC
AM_CFLAGS="-DWOLFSSL_MULTI_ATTRIB $AM_CFLAGS"
# Enable checks on ECC keys that are imported
AM_CFLAGS="-DWOLFSSL_VALIDATE_ECC_IMPORT $AM_CFLAGS"
fi
@@ -1626,6 +1629,9 @@ then
AC_MSG_ERROR([cannot enable fpecc without enabling ecc.])
fi
AM_CFLAGS="$AM_CFLAGS -DFP_ECC"
# Enable checks on ECC keys that are imported
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VALIDATE_ECC_IMPORT"
fi

View File

@@ -965,7 +965,7 @@ int mp_invmod (mp_int * a, mp_int * b, mp_int * c)
#endif
{
/* b cannot be negative */
if (b->sign == MP_NEG || mp_iszero(b) == MP_YES) {
if (b->sign == MP_NEG || mp_iszero(b) == MP_YES || mp_iszero(a) == MP_YES) {
return MP_VAL;
}