Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -8577,7 +8577,10 @@ static WC_INLINE int DecodeTls13SigAlg(byte* input, byte* hashAlgo,
break;
#endif
case NEW_SA_MAJOR:
*hashAlgo = GetNewSAHashAlgo(input[1]);
{
enum wc_MACAlgorithm mac = GetNewSAHashAlgo(input[1]);
*hashAlgo = (byte)mac;
}

/* PSS encryption: 0x080[4-6] */
if (input[1] >= RSA_PSS_RSAE_SHA256_MINOR &&
Expand Down
6 changes: 5 additions & 1 deletion src/wolfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,7 +3286,11 @@ int LwIPNativeSend(WOLFSSL* ssl, char* buf, int sz, void* ctx)
err_t ret;
WOLFSSL_LWIP_NATIVE_STATE* nlwip = (WOLFSSL_LWIP_NATIVE_STATE*)ctx;

ret = tcp_write(nlwip->pcb, buf, sz, TCP_WRITE_FLAG_COPY);
if (sz < 0 || sz > (int)WOLFSSL_MAX_16BIT) {
return BAD_FUNC_ARG;
}

ret = tcp_write(nlwip->pcb, buf, (u16_t)sz, TCP_WRITE_FLAG_COPY);
if (ret != ERR_OK) {
sz = WOLFSSL_FATAL_ERROR;
}
Expand Down
18 changes: 9 additions & 9 deletions wolfcrypt/src/fe_low_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ void fe_load(byte *x, word32 c)
word32 i;

for (i = 0; i < sizeof(c); i++) {
x[i] = c;
x[i] = (byte)c;
c >>= 8;
}

Expand Down Expand Up @@ -636,7 +636,7 @@ void lm_sub(byte* r, const byte* a, const byte* b)
c = 218;
for (i = 0; i + 1 < F25519_SIZE; i++) {
c += 65280 + ((word32)a[i]) - ((word32)b[i]);
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}

Expand All @@ -646,7 +646,7 @@ void lm_sub(byte* r, const byte* a, const byte* b)

for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
Expand All @@ -661,7 +661,7 @@ void lm_neg(byte* r, const byte* a)
c = 218;
for (i = 0; i + 1 < F25519_SIZE; i++) {
c += 65280 - ((word32)a[i]);
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}

Expand All @@ -671,7 +671,7 @@ void lm_neg(byte* r, const byte* a)

for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
Expand All @@ -693,15 +693,15 @@ void fe_mul__distinct(byte *r, const byte *a, const byte *b)
c += ((word32)a[j]) *
((word32)b[i + F25519_SIZE - j]) * 38;

r[i] = c;
r[i] = (byte)c;
}

r[31] &= 127;
c = (c >> 7) * 19;

for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
Expand All @@ -724,7 +724,7 @@ void fe_mul_c(byte *r, const byte *a, word32 b)
for (i = 0; i < F25519_SIZE; i++) {
c >>= 8;
c += b * ((word32)a[i]);
r[i] = c;
r[i] = (byte)c;
}

r[31] &= 127;
Expand All @@ -733,7 +733,7 @@ void fe_mul_c(byte *r, const byte *a, word32 b)

for (i = 0; i < F25519_SIZE; i++) {
c += r[i];
r[i] = c;
r[i] = (byte)c;
c >>= 8;
}
}
Expand Down
Loading