Reject DTLS application data messages in epoch 0 as out of order.

This commit is contained in:
John Safranek
2020-08-14 16:27:39 -07:00
parent ef5271dd9f
commit 3be7f3ea3a

View File

@ -8337,10 +8337,13 @@ static int GetRecordHeader(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
}
#ifdef WOLFSSL_DTLS
if (IsDtlsNotSctpMode(ssl) && !DtlsCheckWindow(ssl)) {
if (IsDtlsNotSctpMode(ssl)) {
if (!DtlsCheckWindow(ssl) ||
(ssl->keys.curEpoch == 0 && rh->type == application_data)) {
WOLFSSL_LEAVE("GetRecordHeader()", SEQUENCE_ERROR);
return SEQUENCE_ERROR;
}
}
#endif
/* catch version mismatch */