DTLS Fuzz Fix

Only save a next epoch message if it is in the next epoch, not any future epoch.
This commit is contained in:
John Safranek
2020-04-14 10:13:37 -07:00
parent aadec345ab
commit 70d03f3ba0

View File

@@ -14747,7 +14747,8 @@ int ProcessReply(WOLFSSL* ssl)
&ssl->curRL, &ssl->curSize);
#ifdef WOLFSSL_DTLS
if (ssl->options.dtls && ret == SEQUENCE_ERROR) {
if (ssl->keys.curEpoch != 0) {
if (ssl->keys.curEpoch == ssl->keys.dtls_epoch + 1) {
/* Store if in the next epoch. Probably finished. */
word32 sz = ssl->buffers.inputBuffer.length -
ssl->buffers.inputBuffer.idx +
DTLS_RECORD_HEADER_SZ;