From f55f9bfd36f83dded53397ca17219fda98cebb74 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Fri, 3 Feb 2023 11:05:56 -0800 Subject: [PATCH] fix DTLS test case for when able to read peers close notify alert --- tests/api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/api.c b/tests/api.c index 4d458fb79..d29591dc7 100644 --- a/tests/api.c +++ b/tests/api.c @@ -57831,8 +57831,11 @@ static int test_wolfSSL_dtls_fragments(void) AssertFalse(func_cb_server.return_code); /* The socket should be closed by the server resulting in a - * socket error */ - AssertIntEQ(func_cb_client.last_err, SOCKET_ERROR_E); + * socket error or reading a close notify alert */ + if (func_cb_client.last_err != SOCKET_ERROR_E && + func_cb_client.last_err != WOLFSSL_ERROR_ZERO_RETURN) { + AssertIntEQ(func_cb_client.last_err, SOCKET_ERROR_E); + } /* Check the server returned an error indicating the msg buffer * was full */ AssertIntEQ(func_cb_server.last_err, DTLS_TOO_MANY_FRAGMENTS_E);