@@ -11311,6 +11311,31 @@ static int test_wolfSSL_UseMaxFragment(void)
1131111311
1131211312 wolfSSL_free(ssl);
1131311313 wolfSSL_CTX_free(ctx);
11314+
11315+ #if defined(OPENSSL_EXTRA) && defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES)
11316+ /* check negotiated max fragment size */
11317+ {
11318+ WOLFSSL *ssl_c = NULL;
11319+ WOLFSSL *ssl_s = NULL;
11320+ struct test_memio_ctx test_ctx;
11321+ WOLFSSL_CTX *ctx_c = NULL;
11322+ WOLFSSL_CTX *ctx_s = NULL;
11323+
11324+ XMEMSET(&test_ctx, 0, sizeof(test_ctx));
11325+ ExpectIntEQ(test_memio_setup(&test_ctx, &ctx_c, &ctx_s, &ssl_c, &ssl_s,
11326+ wolfTLSv1_2_client_method, wolfTLSv1_2_server_method), 0);
11327+ ExpectIntEQ(wolfSSL_UseMaxFragment(ssl_c, WOLFSSL_MFL_2_8),
11328+ WOLFSSL_SUCCESS);
11329+ ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
11330+ ExpectIntEQ(SSL_SESSION_get_max_fragment_length(
11331+ wolfSSL_get_session(ssl_c)), WOLFSSL_MFL_2_8);
11332+
11333+ wolfSSL_free(ssl_c);
11334+ wolfSSL_free(ssl_s);
11335+ wolfSSL_CTX_free(ctx_c);
11336+ wolfSSL_CTX_free(ctx_s);
11337+ }
11338+ #endif
1131411339#endif /* !NO_WOLFSSL_CLIENT || !NO_WOLFSSL_SERVER */
1131511340#endif
1131611341 return EXPECT_RESULT();
@@ -35030,6 +35055,7 @@ static int test_wolfSSL_X509_NAME_print_ex(void)
3503035055 X509_NAME* name = NULL;
3503135056
3503235057 const char* expNormal = "C=US, CN=wolfssl.com";
35058+ const char* expEqSpace = "C = US, CN = wolfssl.com";
3503335059 const char* expReverse = "CN=wolfssl.com, C=US";
3503435060
3503535061 const char* expNotEscaped = "C= US,+\"\\ , CN=#wolfssl.com<>;";
@@ -35087,6 +35113,17 @@ static int test_wolfSSL_X509_NAME_print_ex(void)
3508735113 BIO_free(membio);
3508835114 membio = NULL;
3508935115
35116+ /* Test with XN_FLAG_ONELINE which should enable XN_FLAG_SPC_EQ for
35117+ spaces aroun '=' */
35118+ ExpectNotNull(membio = BIO_new(BIO_s_mem()));
35119+ ExpectIntEQ(X509_NAME_print_ex(membio, name, 0, XN_FLAG_ONELINE),
35120+ WOLFSSL_SUCCESS);
35121+ ExpectIntGE((memSz = BIO_get_mem_data(membio, &mem)), 0);
35122+ ExpectIntEQ(memSz, XSTRLEN(expEqSpace));
35123+ ExpectIntEQ(XSTRNCMP((char*)mem, expEqSpace, XSTRLEN(expEqSpace)), 0);
35124+ BIO_free(membio);
35125+ membio = NULL;
35126+
3509035127 /* Test flags: XN_FLAG_RFC2253 - should be reversed */
3509135128 ExpectNotNull(membio = BIO_new(BIO_s_mem()));
3509235129 ExpectIntEQ(X509_NAME_print_ex(membio, name, 0,
@@ -49863,6 +49900,7 @@ static int test_wolfSSL_CTX_sess_set_remove_cb(void)
4986349900 /* Both should have been allocated */
4986449901 ExpectIntEQ(clientSessRemCountMalloc, 1);
4986549902 ExpectIntEQ(serverSessRemCountMalloc, 1);
49903+
4986649904 /* This should not be called yet. Session wasn't evicted from cache yet. */
4986749905 ExpectIntEQ(clientSessRemCountFree, 0);
4986849906#if (defined(WOLFSSL_TLS13) && defined(HAVE_SESSION_TICKET)) || \
@@ -49889,7 +49927,6 @@ static int test_wolfSSL_CTX_sess_set_remove_cb(void)
4988949927 ExpectIntEQ(SSL_CTX_remove_session(serverSessCtx, serverSess), 0);
4989049928 ExpectNull(SSL_SESSION_get_ex_data(serverSess, serverSessRemIdx));
4989149929 ExpectIntEQ(serverSessRemCountFree, 1);
49892-
4989349930 /* Need to free the references that we kept */
4989449931 SSL_CTX_free(serverSessCtx);
4989549932 SSL_SESSION_free(serverSess);
@@ -65220,8 +65257,15 @@ static int test_stubs_are_stubs(void)
6522065257 CHECKZERO_RET(wolfSSL_CTX_sess_misses, ctx, ctxN);
6522165258 CHECKZERO_RET(wolfSSL_CTX_sess_timeouts, ctx, ctxN);
6522265259
65260+ /* when implemented this should take WOLFSSL object insted, right now
65261+ * always returns 0 */
65262+ ExpectIntEQ(SSL_get_current_expansion(NULL), 0);
65263+
6522365264 wolfSSL_CTX_free(ctx);
6522465265 ctx = NULL;
65266+
65267+ ExpectStrEQ(SSL_COMP_get_name(NULL), "not supported");
65268+ ExpectIntEQ(SSL_get_current_expansion(), 0);
6522565269#endif /* OPENSSL_EXTRA && !NO_WOLFSSL_STUB && (!NO_WOLFSSL_CLIENT ||
6522665270 * !NO_WOLFSSL_SERVER) */
6522765271 return EXPECT_RESULT();
@@ -69055,6 +69099,7 @@ static int test_wolfSSL_dtls_stateless_maxfrag(void)
6905569099 /* CH without cookie shouldn't change state */
6905669100 ExpectIntEQ(ssl_s->max_fragment, max_fragment);
6905769101 ExpectIntNE(test_ctx.c_len, 0);
69102+
6905869103 /* consume HRR from buffer */
6905969104 test_ctx.c_len = 0;
6906069105 ExpectIntEQ(test_memio_do_handshake(ssl_c, ssl_s, 10, NULL), 0);
0 commit comments