@@ -32012,7 +32012,7 @@ static int test_write_dup(void)
3201232012{
3201332013 EXPECT_DECLS;
3201432014#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && defined(HAVE_WRITE_DUP)
32015- size_t i, j;
32015+ size_t i, j, k ;
3201632016 char hiWorld[] = "dup message";
3201732017 char readData[sizeof(hiWorld) + 5];
3201832018 struct {
@@ -32132,6 +32132,35 @@ static int test_write_dup(void)
3213232132 WC_NO_ERR_TRACE(WRITE_DUP_READ_E));
3213332133 ExpectIntEQ(wolfSSL_read(ssl_c, readData, sizeof(readData)),
3213432134 sizeof(hiWorld));
32135+ #ifdef WOLFSSL_DTLS13
32136+ /* After ssl_c (read side) processes the post-handshake
32137+ * NewSessionTicket it must have delegated the ACK to the
32138+ * write side via the shared WriteDup struct. */
32139+ if (ssl_c != NULL && ssl_c->options.dtls &&
32140+ IsAtLeastTLSv1_3(ssl_c->version) &&
32141+ ssl_c->dupWrite != NULL)
32142+ ExpectIntEQ(ssl_c->dupWrite->sendAcks, 1);
32143+ #endif
32144+
32145+ for (k = 0; k < 10; k++) {
32146+ ExpectIntEQ(wolfSSL_write(ssl_c2, hiWorld, sizeof(hiWorld)),
32147+ sizeof(hiWorld));
32148+ ExpectIntEQ(wolfSSL_read(ssl_s, readData, sizeof(readData)),
32149+ sizeof(hiWorld));
32150+ #ifdef WOLFSSL_DTLS13
32151+ /* On the first iteration the write side must have sent the
32152+ * ACK for the NewSessionTicket. Once the server reads it,
32153+ * its retransmit list for the NST must be empty. */
32154+ if (k == 0 && ssl_s != NULL && ssl_c != NULL &&
32155+ ssl_c->options.dtls &&
32156+ IsAtLeastTLSv1_3(ssl_c->version))
32157+ ExpectNull(ssl_s->dtls13Rtx.rtxRecords);
32158+ #endif
32159+ ExpectIntEQ(wolfSSL_write(ssl_s, hiWorld, sizeof(hiWorld)),
32160+ sizeof(hiWorld));
32161+ ExpectIntEQ(wolfSSL_read(ssl_c, readData, sizeof(readData)),
32162+ sizeof(hiWorld));
32163+ }
3213532164
3213632165 if (EXPECT_SUCCESS())
3213732166 printf("ok\n");
0 commit comments