1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00

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().
This commit is contained in:
Tobias Frauenschläger
2026-10-21 14:49:20 +02:00
parent d60f1f0450
commit b8b2fed768

View File

@@ -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)