From 3be7f3ea3a56d178acf0f7f84ee4ae8cbfee8915 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 14 Aug 2020 16:27:39 -0700 Subject: [PATCH] Reject DTLS application data messages in epoch 0 as out of order. --- src/internal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 3572835ae..0e3d12aaf 100644 --- a/src/internal.c +++ b/src/internal.c @@ -8337,9 +8337,12 @@ 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