forked from wolfSSL/wolfssl
Merge pull request #2610 from ejohnstown/maintenance-DTLS
Maintenance: DTLS
This commit is contained in:
@@ -12122,7 +12122,7 @@ static WC_INLINE int DtlsCheckWindow(WOLFSSL* ssl)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window[idx] & (1 << (newDiff - 1))) {
|
if (window[idx] & (1 << newDiff)) {
|
||||||
WOLFSSL_MSG("Current record sequence number already received.");
|
WOLFSSL_MSG("Current record sequence number already received.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -12229,7 +12229,7 @@ static WC_INLINE int DtlsUpdateWindow(WOLFSSL* ssl)
|
|||||||
word32 newDiff = diff % DTLS_WORD_BITS;
|
word32 newDiff = diff % DTLS_WORD_BITS;
|
||||||
|
|
||||||
if (idx < WOLFSSL_DTLS_WINDOW_WORDS)
|
if (idx < WOLFSSL_DTLS_WINDOW_WORDS)
|
||||||
window[idx] |= (1 << (newDiff - 1));
|
window[idx] |= (1 << newDiff);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (diff >= DTLS_SEQ_BITS)
|
if (diff >= DTLS_SEQ_BITS)
|
||||||
@@ -12251,7 +12251,7 @@ static WC_INLINE int DtlsUpdateWindow(WOLFSSL* ssl)
|
|||||||
else {
|
else {
|
||||||
temp |= (oldWindow[i-idx] << newDiff);
|
temp |= (oldWindow[i-idx] << newDiff);
|
||||||
window[i] = temp;
|
window[i] = temp;
|
||||||
temp = oldWindow[i-idx] >> (DTLS_WORD_BITS - newDiff);
|
temp = oldWindow[i-idx] >> (DTLS_WORD_BITS - newDiff - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12549,7 +12549,6 @@ static int ChachaAEADEncrypt(WOLFSSL* ssl, byte* out, const byte* input,
|
|||||||
#ifdef WOLFSSL_DTLS
|
#ifdef WOLFSSL_DTLS
|
||||||
if (ssl->options.dtls) {
|
if (ssl->options.dtls) {
|
||||||
additionalSrc -= DTLS_HANDSHAKE_EXTRA;
|
additionalSrc -= DTLS_HANDSHAKE_EXTRA;
|
||||||
DtlsSEQIncrement(ssl, CUR_ORDER);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -13089,11 +13088,6 @@ static WC_INLINE int Encrypt(WOLFSSL* ssl, byte* out, const byte* input, word16
|
|||||||
#endif
|
#endif
|
||||||
if (ssl->encrypt.nonce)
|
if (ssl->encrypt.nonce)
|
||||||
ForceZero(ssl->encrypt.nonce, AESGCM_NONCE_SZ);
|
ForceZero(ssl->encrypt.nonce, AESGCM_NONCE_SZ);
|
||||||
|
|
||||||
#ifdef WOLFSSL_DTLS
|
|
||||||
if (ssl->options.dtls)
|
|
||||||
DtlsSEQIncrement(ssl, CUR_ORDER);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif /* BUILD_AESGCM || HAVE_AESCCM */
|
#endif /* BUILD_AESGCM || HAVE_AESCCM */
|
||||||
break;
|
break;
|
||||||
@@ -22943,10 +22937,6 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
|
|||||||
if ((ret = DtlsMsgPoolSave(ssl, output, sendSz)) != 0)
|
if ((ret = DtlsMsgPoolSave(ssl, output, sendSz)) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssl->options.dtls) {
|
|
||||||
DtlsSEQIncrement(ssl, CUR_ORDER);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ssl->options.groupMessages)
|
if (ssl->options.groupMessages)
|
||||||
|
@@ -568,6 +568,8 @@ void mp_rshb (mp_int *c, int x)
|
|||||||
mp_digit r, rr;
|
mp_digit r, rr;
|
||||||
mp_digit D = x;
|
mp_digit D = x;
|
||||||
|
|
||||||
|
if (mp_iszero(c)) return;
|
||||||
|
|
||||||
/* mask */
|
/* mask */
|
||||||
mask = (((mp_digit)1) << D) - 1;
|
mask = (((mp_digit)1) << D) - 1;
|
||||||
|
|
||||||
|
@@ -3176,6 +3176,8 @@ void fp_rshb(fp_int *c, int x)
|
|||||||
fp_digit r, rr;
|
fp_digit r, rr;
|
||||||
fp_digit D = x;
|
fp_digit D = x;
|
||||||
|
|
||||||
|
if (fp_iszero(c)) return;
|
||||||
|
|
||||||
/* mask */
|
/* mask */
|
||||||
mask = (((fp_digit)1) << D) - 1;
|
mask = (((fp_digit)1) << D) - 1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user