fix math errors unmasked by change to sp-math-all as default math back end.

This commit is contained in:
Daniel Pouzzner
2022-06-24 15:56:54 -05:00
parent 940d0140f9
commit 047c662af8
2 changed files with 2 additions and 2 deletions

View File

@ -12233,7 +12233,7 @@ int wolfSSL_X509_set_pubkey(WOLFSSL_X509 *cert, WOLFSSL_EVP_PKEY *pkey)
int wolfSSL_X509_set_version(WOLFSSL_X509* x509, long v)
{
WOLFSSL_ENTER("wolfSSL_X509_set_version");
if ((x509 == NULL) || (v < 0) || (v > INT_MAX)) {
if ((x509 == NULL) || (v < 0) || (v >= INT_MAX)) {
return WOLFSSL_FAILURE;
}
x509->version = (int) v + 1;

View File

@ -7277,7 +7277,7 @@ static int _sp_mul(sp_int* a, sp_int* b, sp_int* r)
#endif
for (k = 1; k <= (a->used - 1) + (b->used - 1); k++) {
i = k - (b->used - 1);
i &= ~(i >> (sizeof(i) * 8 - 1));
i &= ~((unsigned int)i >> (sizeof(i) * 8 - 1));
j = k - i;
for (; (i < a->used) && (j >= 0); i++, j--) {
w = (sp_int_word)a->dp[i] * b->dp[j];