@@ -70740,6 +70740,59 @@ static int test_dtls_empty_keyshare_with_cookie(void)
7074070740 return EXPECT_RESULT();
7074170741}
7074270742
70743+ static int test_dtls_old_seq_number(void)
70744+ {
70745+ EXPECT_DECLS;
70746+ #if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_DTLS)
70747+ WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
70748+ WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
70749+ struct test_memio_ctx test_ctx;
70750+
70751+ XMEMSET(&test_ctx, 0, sizeof(test_ctx));
70752+
70753+ ExpectIntEQ(test_memio_setup(&test_ctx, &ctx_c, &ctx_s, &ssl_c, &ssl_s,
70754+ wolfDTLSv1_2_client_method, wolfDTLSv1_2_server_method), 0);
70755+
70756+ /* CH1 */
70757+ ExpectIntEQ(wolfSSL_negotiate(ssl_c), -1);
70758+ ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WOLFSSL_ERROR_WANT_READ);
70759+ /* HVR */
70760+ ExpectIntEQ(wolfSSL_negotiate(ssl_s), -1);
70761+ ExpectIntEQ(wolfSSL_get_error(ssl_s, -1), WOLFSSL_ERROR_WANT_READ);
70762+ /* CH2 */
70763+ ExpectIntEQ(wolfSSL_negotiate(ssl_c), -1);
70764+ ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WOLFSSL_ERROR_WANT_READ);
70765+ /* Server first flight */
70766+ ExpectIntEQ(wolfSSL_negotiate(ssl_s), -1);
70767+ ExpectIntEQ(wolfSSL_get_error(ssl_s, -1), WOLFSSL_ERROR_WANT_READ);
70768+ /* Client second flight */
70769+ ExpectIntEQ(wolfSSL_negotiate(ssl_c), -1);
70770+ ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WOLFSSL_ERROR_WANT_READ);
70771+ /* Modify the sequence number */
70772+ {
70773+ DtlsRecordLayerHeader* dtlsRH = (DtlsRecordLayerHeader*)test_ctx.s_buff;
70774+ XMEMSET(dtlsRH->sequence_number, 0, sizeof(dtlsRH->sequence_number));
70775+ }
70776+ /* Server second flight */
70777+ ExpectIntEQ(wolfSSL_negotiate(ssl_s), -1);
70778+ ExpectIntEQ(wolfSSL_get_error(ssl_s, -1), WOLFSSL_ERROR_WANT_READ);
70779+ /* Server should not do anything as a pkt was dropped */
70780+ ExpectIntEQ(test_ctx.c_len, 0);
70781+ ExpectIntEQ(test_ctx.s_len, 0);
70782+ /* Trigger rtx */
70783+ ExpectIntEQ(wolfSSL_dtls_got_timeout(ssl_c), WOLFSSL_SUCCESS);
70784+
70785+ /* Complete connection */
70786+ ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
70787+
70788+ wolfSSL_free(ssl_c);
70789+ wolfSSL_CTX_free(ctx_c);
70790+ wolfSSL_free(ssl_s);
70791+ wolfSSL_CTX_free(ctx_s);
70792+ #endif
70793+ return EXPECT_RESULT();
70794+ }
70795+
7074370796#if defined(HAVE_IO_TESTS_DEPENDENCIES) && defined(WOLFSSL_TLS13) && \
7074470797 defined(HAVE_LIBOQS)
7074570798static void test_tls13_pq_groups_ctx_ready(WOLFSSL_CTX* ctx)
@@ -72965,6 +73018,7 @@ TEST_CASE testCases[] = {
7296573018 TEST_DECL(test_dtls_frag_ch),
7296673019 TEST_DECL(test_dtls13_frag_ch_pq),
7296773020 TEST_DECL(test_dtls_empty_keyshare_with_cookie),
73021+ TEST_DECL(test_dtls_old_seq_number),
7296873022 TEST_DECL(test_tls13_pq_groups),
7296973023 TEST_DECL(test_tls13_early_data),
7297073024 TEST_DECL(test_tls_multi_handshakes_one_record),
0 commit comments