@@ -11307,6 +11307,31 @@ static int test_wolfSSL_UseMaxFragment(void)
1130711307
1130811308 wolfSSL_free(ssl);
1130911309 wolfSSL_CTX_free(ctx);
11310+
11311+ #if defined(OPENSSL_EXTRA) && defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES)
11312+ /* check negotiated max fragment size */
11313+ {
11314+ WOLFSSL *ssl_c = NULL;
11315+ WOLFSSL *ssl_s = NULL;
11316+ struct test_memio_ctx test_ctx;
11317+ WOLFSSL_CTX *ctx_c = NULL;
11318+ WOLFSSL_CTX *ctx_s = NULL;
11319+
11320+ XMEMSET(&test_ctx, 0, sizeof(test_ctx));
11321+ ExpectIntEQ(test_memio_setup(&test_ctx, &ctx_c, &ctx_s, &ssl_c, &ssl_s,
11322+ wolfTLSv1_2_client_method, wolfTLSv1_2_server_method), 0);
11323+ ExpectIntEQ(wolfSSL_UseMaxFragment(ssl_c, WOLFSSL_MFL_2_8),
11324+ WOLFSSL_SUCCESS);
11325+ ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
11326+ ExpectIntEQ(SSL_SESSION_get_max_fragment_length(
11327+ wolfSSL_get_session(ssl_c)), WOLFSSL_MFL_2_8);
11328+
11329+ wolfSSL_free(ssl_c);
11330+ wolfSSL_free(ssl_s);
11331+ wolfSSL_CTX_free(ctx_c);
11332+ wolfSSL_CTX_free(ctx_s);
11333+ }
11334+ #endif
1131011335#endif /* !NO_WOLFSSL_CLIENT || !NO_WOLFSSL_SERVER */
1131111336#endif
1131211337 return EXPECT_RESULT();
@@ -47946,6 +47971,7 @@ static int test_wolfSSL_CTX_sess_set_remove_cb(void)
4794647971 /* Both should have been allocated */
4794747972 ExpectIntEQ(clientSessRemCountMalloc, 1);
4794847973 ExpectIntEQ(serverSessRemCountMalloc, 1);
47974+
4794947975 /* This should not be called yet. Session wasn't evicted from cache yet. */
4795047976 ExpectIntEQ(clientSessRemCountFree, 0);
4795147977#if (defined(WOLFSSL_TLS13) && defined(HAVE_SESSION_TICKET)) || \
@@ -47972,13 +47998,6 @@ static int test_wolfSSL_CTX_sess_set_remove_cb(void)
4797247998 ExpectIntEQ(SSL_CTX_remove_session(serverSessCtx, serverSess), 0);
4797347999 ExpectNull(SSL_SESSION_get_ex_data(serverSess, serverSessRemIdx));
4797448000 ExpectIntEQ(serverSessRemCountFree, 1);
47975-
47976- /* check on the max fragment size */
47977- #ifdef HAVE_MAX_FRAGMENT
47978- ExpectIntEQ(SSL_SESSION_get_max_fragment_length(serverSess),
47979- MAX_RECORD_SIZE);
47980- #endif
47981-
4798248001 /* Need to free the references that we kept */
4798348002 SSL_CTX_free(serverSessCtx);
4798448003 SSL_SESSION_free(serverSess);
@@ -67062,6 +67081,7 @@ static int test_wolfSSL_dtls_stateless_maxfrag(void)
6706267081 /* CH without cookie shouldn't change state */
6706367082 ExpectIntEQ(ssl_s->max_fragment, max_fragment);
6706467083 ExpectIntNE(test_ctx.c_len, 0);
67084+
6706567085 /* consume HRR from buffer */
6706667086 test_ctx.c_len = 0;
6706767087 ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
0 commit comments