From b8b2fed7685fd4c9a64e25bee8b49c1c193f80ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Frauenschl=C3=A4ger?= Date: Wed, 21 Oct 2026 14:49:20 +0200 Subject: [PATCH] Report failures from test_wolfSSL_dtls13_null_cipher The test returned TEST_SUCCESS whatever its checks found, so the failing shutdown check was never reported. With session tickets enabled, the client's second wolfSSL_shutdown() processed the server's unread NewSessionTicket and returned before the server's close_notify, and once that is drained the server's second call stops at the client's ACK the same way. Read once on each side before shutting down, so each second wolfSSL_shutdown() finds the peer's close_notify, and return EXPECT_RESULT(). --- tests/api/test_dtls13.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/api/test_dtls13.c b/tests/api/test_dtls13.c index db052197ad..240080bcfa 100644 --- a/tests/api/test_dtls13.c +++ b/tests/api/test_dtls13.c @@ -151,6 +151,12 @@ int test_wolfSSL_dtls13_null_cipher(void) ExpectIntEQ(ssl_s->error, WC_NO_ERR_TRACE(WANT_READ)); } + /* Drain the post-handshake records on each side */ + ExpectIntEQ(wolfSSL_read(ssl_c, buf, sizeof(buf)), -1); + ExpectIntEQ(wolfSSL_get_error(ssl_c, -1), WOLFSSL_ERROR_WANT_READ); + ExpectIntEQ(wolfSSL_read(ssl_s, buf, sizeof(buf)), -1); + ExpectIntEQ(wolfSSL_get_error(ssl_s, -1), WOLFSSL_ERROR_WANT_READ); + ExpectIntEQ(wolfSSL_shutdown(ssl_c), WOLFSSL_SHUTDOWN_NOT_DONE); ExpectIntEQ(wolfSSL_shutdown(ssl_s), WOLFSSL_SHUTDOWN_NOT_DONE); ExpectIntEQ(wolfSSL_shutdown(ssl_c), 1); @@ -160,7 +166,7 @@ int test_wolfSSL_dtls13_null_cipher(void) wolfSSL_free(ssl_s); wolfSSL_CTX_free(ctx_c); wolfSSL_CTX_free(ctx_s); - return TEST_SUCCESS; + return EXPECT_RESULT(); } #else int test_wolfSSL_dtls13_null_cipher(void)