Lines Matching refs:clientssl

351     SSL *clientssl = NULL, *serverssl = NULL;  in test_keylog()  local
391 &clientssl, NULL, NULL)) in test_keylog()
392 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog()
407 if (!TEST_true(test_keylog_output(client_log_buffer, clientssl, in test_keylog()
408 SSL_get_session(clientssl), &expected))) in test_keylog()
420 SSL_free(clientssl); in test_keylog()
432 SSL *clientssl = NULL, *serverssl = NULL; in test_keylog_no_master_key() local
470 &clientssl, NULL, NULL)) in test_keylog_no_master_key()
471 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog_no_master_key()
486 if (!TEST_true(test_keylog_output(client_log_buffer, clientssl, in test_keylog_no_master_key()
487 SSL_get_session(clientssl), &expected)) in test_keylog_no_master_key()
494 sess = SSL_get1_session(clientssl); in test_keylog_no_master_key()
495 SSL_shutdown(clientssl); in test_keylog_no_master_key()
498 SSL_free(clientssl); in test_keylog_no_master_key()
499 serverssl = clientssl = NULL; in test_keylog_no_master_key()
508 &clientssl, NULL, NULL)) in test_keylog_no_master_key()
509 || !TEST_true(SSL_set_session(clientssl, sess)) in test_keylog_no_master_key()
511 || !TEST_true(SSL_write_early_data(clientssl, NULL, 0, &written)) in test_keylog_no_master_key()
517 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog_no_master_key()
519 || !TEST_true(SSL_session_reused(clientssl))) in test_keylog_no_master_key()
525 if (!TEST_true(test_keylog_output(client_log_buffer, clientssl, in test_keylog_no_master_key()
526 SSL_get_session(clientssl), &expected)) in test_keylog_no_master_key()
537 SSL_free(clientssl); in test_keylog_no_master_key()
575 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_verify_cb() local
592 &clientssl, NULL, NULL))) in test_client_cert_verify_cb()
596 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_client_cert_verify_cb()
603 || !TEST_ptr((server_chain = SSL_get_peer_cert_chain(clientssl)))) in test_client_cert_verify_cb()
614 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_verify_cb()
623 if (clientssl != NULL) { in test_client_cert_verify_cb()
624 SSL_shutdown(clientssl); in test_client_cert_verify_cb()
625 SSL_free(clientssl); in test_client_cert_verify_cb()
755 SSL *clientssl = NULL, *serverssl = NULL; in test_client_hello_cb() local
770 &clientssl, NULL, NULL)) in test_client_hello_cb()
771 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_client_hello_cb()
779 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_hello_cb()
787 SSL_free(clientssl); in test_client_hello_cb()
797 SSL *clientssl = NULL, *serverssl = NULL; in test_no_ems() local
809 if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) { in test_no_ems()
814 status = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_no_ems()
829 if (SSL_get_extms_support(clientssl)) { in test_no_ems()
838 SSL_free(clientssl); in test_no_ems()
854 SSL *clientssl = NULL, *serverssl = NULL; in test_ccs_change_cipher() local
870 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
872 || !TEST_true(SSL_set_cipher_list(clientssl, "AES128-GCM-SHA256")) in test_ccs_change_cipher()
873 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
876 || !TEST_ptr(sess = SSL_get1_session(clientssl))) in test_ccs_change_cipher()
879 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
880 serverssl = clientssl = NULL; in test_ccs_change_cipher()
884 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
886 || !TEST_true(SSL_set_session(clientssl, sess)) in test_ccs_change_cipher()
887 || !TEST_true(SSL_set_cipher_list(clientssl, "AES256-GCM-SHA384:AES128-GCM-SHA256")) in test_ccs_change_cipher()
888 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
890 || !TEST_true(SSL_session_reused(clientssl)) in test_ccs_change_cipher()
895 SSL_CIPHER_get_id(SSL_get_current_cipher(clientssl)))) in test_ccs_change_cipher()
897 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
898 serverssl = clientssl = NULL; in test_ccs_change_cipher()
904 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
906 || !TEST_true(SSL_set_cipher_list(clientssl, "AES128-GCM-SHA256")) in test_ccs_change_cipher()
907 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
910 || !TEST_true(SSL_set_cipher_list(clientssl, "AES256-GCM-SHA384")) in test_ccs_change_cipher()
911 || !TEST_true(SSL_renegotiate(clientssl)) in test_ccs_change_cipher()
912 || !TEST_true(SSL_renegotiate_pending(clientssl))) in test_ccs_change_cipher()
916 if (SSL_read_ex(clientssl, &buf, sizeof(buf), &readbytes) > 0) { in test_ccs_change_cipher()
919 } else if (!TEST_int_eq(SSL_get_error(clientssl, 0), in test_ccs_change_cipher()
932 if (!TEST_false(SSL_renegotiate_pending(clientssl)) in test_ccs_change_cipher()
933 || !TEST_false(SSL_session_reused(clientssl)) in test_ccs_change_cipher()
938 SSL_CIPHER_get_id(SSL_get_current_cipher(clientssl)))) in test_ccs_change_cipher()
941 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
942 serverssl = clientssl = NULL; in test_ccs_change_cipher()
948 SSL_free(clientssl); in test_ccs_change_cipher()
963 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_large_message() local
995 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_test_large_message()
997 || !TEST_true(create_ssl_connection(serverssl, clientssl, in execute_test_large_message()
1011 SSL_free(clientssl); in execute_test_large_message()
1028 static int ping_pong_query(SSL *clientssl, SSL *serverssl) in ping_pong_query() argument
1044 if (!TEST_ptr(clientsc = SSL_CONNECTION_FROM_SSL_ONLY(clientssl)) in ping_pong_query()
1054 if (!TEST_true(SSL_write(clientssl, cbuf, sizeof(cbuf)) == sizeof(cbuf))) in ping_pong_query()
1066 while ((err = SSL_read(clientssl, &cbuf, sizeof(cbuf))) != sizeof(cbuf)) { in ping_pong_query()
1067 if (SSL_get_error(clientssl, err) != SSL_ERROR_WANT_READ) { in ping_pong_query()
1134 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_ktls() local
1176 &clientssl, sfd, cfd))) in execute_test_ktls()
1179 if (!TEST_ptr(clientsc = SSL_CONNECTION_FROM_SSL_ONLY(clientssl)) in execute_test_ktls()
1184 if (!TEST_true(SSL_set_options(clientssl, SSL_OP_ENABLE_KTLS))) in execute_test_ktls()
1193 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in execute_test_ktls()
1245 if (!TEST_true(ping_pong_query(clientssl, serverssl))) in execute_test_ktls()
1256 while ((ret = SSL_write(clientssl, buf, bufsz)) != (int)bufsz) { in execute_test_ktls()
1257 if (!TEST_true(SSL_get_error(clientssl, ret) == SSL_ERROR_WANT_WRITE)) in execute_test_ktls()
1281 if (clientssl) { in execute_test_ktls()
1282 SSL_shutdown(clientssl); in execute_test_ktls()
1283 SSL_free(clientssl); in execute_test_ktls()
1291 serverssl = clientssl = NULL; in execute_test_ktls()
1307 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_ktls_sendfile() local
1352 &clientssl, sfd, cfd))) in execute_test_ktls_sendfile()
1367 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in execute_test_ktls_sendfile()
1404 while ((err = SSL_read(clientssl, in execute_test_ktls_sendfile()
1407 if (SSL_get_error(clientssl, err) != SSL_ERROR_WANT_READ) in execute_test_ktls_sendfile()
1423 if (clientssl) { in execute_test_ktls_sendfile()
1424 SSL_shutdown(clientssl); in execute_test_ktls_sendfile()
1425 SSL_free(clientssl); in execute_test_ktls_sendfile()
1433 serverssl = clientssl = NULL; in execute_test_ktls_sendfile()
1552 SSL *clientssl = NULL, *serverssl = NULL; in test_large_app_data() local
1654 &clientssl, NULL, NULL))) in test_large_app_data()
1661 || !TEST_true(SSL_set_options(clientssl, in test_large_app_data()
1672 || !TEST_true(SSL_set_options(clientssl, in test_large_app_data()
1677 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_large_app_data()
1680 if (!TEST_true(SSL_write_ex(clientssl, msg, SSL3_RT_MAX_PLAIN_LENGTH, in test_large_app_data()
1698 SSL_free(clientssl); in test_large_app_data()
1712 SSL *clientssl = NULL, *serverssl = NULL; in execute_cleanse_plaintext() local
1746 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_cleanse_plaintext()
1753 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in execute_cleanse_plaintext()
1761 if (!TEST_int_eq(SSL_write(clientssl, cbuf, sizeof(cbuf)), sizeof(cbuf))) in execute_cleanse_plaintext()
1805 SSL_free(clientssl); in execute_cleanse_plaintext()
1899 SSL *clientssl = NULL, *serverssl = NULL; in test_tlsext_status_type() local
1915 clientssl = SSL_new(cctx); in test_tlsext_status_type()
1916 if (!TEST_ptr(clientssl)) in test_tlsext_status_type()
1918 if (!TEST_int_eq(SSL_get_tlsext_status_type(clientssl), -1) in test_tlsext_status_type()
1919 || !TEST_true(SSL_set_tlsext_status_type(clientssl, in test_tlsext_status_type()
1921 || !TEST_int_eq(SSL_get_tlsext_status_type(clientssl), in test_tlsext_status_type()
1925 SSL_free(clientssl); in test_tlsext_status_type()
1926 clientssl = NULL; in test_tlsext_status_type()
1932 clientssl = SSL_new(cctx); in test_tlsext_status_type()
1933 if (!TEST_ptr(clientssl)) in test_tlsext_status_type()
1935 if (SSL_get_tlsext_status_type(clientssl) != TLSEXT_STATUSTYPE_ocsp) in test_tlsext_status_type()
1937 SSL_free(clientssl); in test_tlsext_status_type()
1938 clientssl = NULL; in test_tlsext_status_type()
1949 &clientssl, NULL, NULL)) in test_tlsext_status_type()
1950 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1956 SSL_free(clientssl); in test_tlsext_status_type()
1958 clientssl = NULL; in test_tlsext_status_type()
1965 &clientssl, NULL, NULL)) in test_tlsext_status_type()
1967 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1973 SSL_free(clientssl); in test_tlsext_status_type()
1975 clientssl = NULL; in test_tlsext_status_type()
1985 &clientssl, NULL, NULL))) in test_tlsext_status_type()
2001 SSL_set_tlsext_status_ids(clientssl, ids); in test_tlsext_status_type()
2008 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
2018 SSL_free(clientssl); in test_tlsext_status_type()
2493 SSL *serverssl = NULL, *clientssl = NULL; in check_resumption() local
2500 &clientssl, NULL, NULL)) in check_resumption()
2501 || !TEST_true(SSL_set_session(clientssl, sesscache[i]))) in check_resumption()
2504 SSL_set_post_handshake_auth(clientssl, 1); in check_resumption()
2506 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in check_resumption()
2515 if (!TEST_true(SSL_session_reused(clientssl)) in check_resumption()
2519 if (!TEST_false(SSL_session_reused(clientssl)) in check_resumption()
2527 && (!post_handshake_verify(serverssl, clientssl) in check_resumption()
2531 SSL_shutdown(clientssl); in check_resumption()
2534 SSL_free(clientssl); in check_resumption()
2535 serverssl = clientssl = NULL; in check_resumption()
2543 SSL_free(clientssl); in check_resumption()
2551 SSL *serverssl = NULL, *clientssl = NULL; in test_tickets() local
2564 &clientssl, NULL, NULL))) in test_tickets()
2567 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2573 SSL_shutdown(clientssl); in test_tickets()
2576 SSL_free(clientssl); in test_tickets()
2579 clientssl = serverssl = NULL; in test_tickets()
2608 &clientssl, NULL, NULL))) in test_tickets()
2611 SSL_set_post_handshake_auth(clientssl, 1); in test_tickets()
2613 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2620 if (!post_handshake_verify(serverssl, clientssl) in test_tickets()
2624 SSL_shutdown(clientssl); in test_tickets()
2627 SSL_free(clientssl); in test_tickets()
2628 serverssl = clientssl = NULL; in test_tickets()
2644 SSL_free(clientssl); in test_tickets()
2668 SSL *serverssl = NULL, *clientssl = NULL; in test_psk_tickets() local
2690 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_psk_tickets()
2693 clientpsk = serverpsk = create_a_psk(clientssl, SHA384_DIGEST_LENGTH); in test_psk_tickets()
2698 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_psk_tickets()
2710 SSL_free(clientssl); in test_psk_tickets()
2723 SSL *serverssl = NULL, *clientssl = NULL; in test_extra_tickets() local
2746 &clientssl, NULL, NULL))) in test_extra_tickets()
2753 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_extra_tickets()
2767 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2771 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes))) in test_extra_tickets()
2781 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2795 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2806 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2844 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2848 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes))) in test_extra_tickets()
2859 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2863 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes))) in test_extra_tickets()
2866 SSL_shutdown(clientssl); in test_extra_tickets()
2874 SSL_free(clientssl); in test_extra_tickets()
2877 clientssl = serverssl = NULL; in test_extra_tickets()
2937 SSL *serverssl = NULL, *clientssl = NULL; in test_ssl_set_bio() local
2976 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_set_bio()
2999 SSL_set_bio(clientssl, irbio, iwbio); in test_ssl_set_bio()
3013 && !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_set_bio()
3035 SSL_set_bio(clientssl, nrbio, nwbio); in test_ssl_set_bio()
3049 SSL_free(clientssl); in test_ssl_set_bio()
3173 SSL *clientssl = NULL, *serverssl = NULL; in test_set_sigalgs() local
3215 &clientssl, NULL, NULL))) in test_set_sigalgs()
3222 ret = SSL_set1_sigalgs(clientssl, curr->list, curr->listlen); in test_set_sigalgs()
3224 ret = SSL_set1_sigalgs_list(clientssl, curr->liststr); in test_set_sigalgs()
3236 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_sigalgs()
3245 SSL_free(clientssl); in test_set_sigalgs()
3415 static int setupearly_data_test(SSL_CTX **cctx, SSL_CTX **sctx, SSL **clientssl, in setupearly_data_test() argument
3447 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, clientssl, in setupearly_data_test()
3458 && !TEST_true(SSL_set_tlsext_host_name(*clientssl, "localhost"))) in setupearly_data_test()
3462 clientpsk = create_a_psk(*clientssl, mdsize); in setupearly_data_test()
3492 if (!TEST_true(create_ssl_connection(*serverssl, *clientssl, in setupearly_data_test()
3496 *sess = SSL_get1_session(*clientssl); in setupearly_data_test()
3497 SSL_shutdown(*clientssl); in setupearly_data_test()
3500 SSL_free(*clientssl); in setupearly_data_test()
3501 *serverssl = *clientssl = NULL; in setupearly_data_test()
3512 clientssl, NULL, NULL)) in setupearly_data_test()
3513 || !TEST_true(SSL_set_session(*clientssl, *sess))) in setupearly_data_test()
3541 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_read_write() local
3552 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_read_write()
3562 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_read_write()
3586 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3591 if (!TEST_true(SSL_write_early_data(clientssl, MSG3, strlen(MSG3), in test_early_data_read_write()
3607 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3615 if (!TEST_true(SSL_write_ex(clientssl, MSG5, strlen(MSG5), &written)) in test_early_data_read_write()
3617 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_read_write()
3667 if (!TEST_false(SSL_write_early_data(clientssl, MSG6, strlen(MSG6), in test_early_data_read_write()
3678 if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3687 if (!TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3688 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), in test_early_data_read_write()
3695 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3700 sess = SSL_get1_session(clientssl); in test_early_data_read_write()
3704 SSL_shutdown(clientssl); in test_early_data_read_write()
3707 SSL_free(clientssl); in test_early_data_read_write()
3708 serverssl = clientssl = NULL; in test_early_data_read_write()
3710 &clientssl, NULL, NULL)) in test_early_data_read_write()
3711 || !TEST_true(SSL_set_session(clientssl, sess))) in test_early_data_read_write()
3715 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_read_write()
3724 if (!TEST_int_gt(SSL_connect(clientssl), 0) in test_early_data_read_write()
3729 if (!TEST_false(SSL_write_early_data(clientssl, MSG6, strlen(MSG6), in test_early_data_read_write()
3740 if (!TEST_true(SSL_write_ex(clientssl, MSG5, strlen(MSG5), &written)) in test_early_data_read_write()
3754 SSL_free(clientssl); in test_early_data_read_write()
3786 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_replay_int() local
3821 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_replay_int()
3830 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3831 || !TEST_true(SSL_session_reused(clientssl))) in test_early_data_replay_int()
3834 SSL_shutdown(clientssl); in test_early_data_replay_int()
3837 SSL_free(clientssl); in test_early_data_replay_int()
3838 serverssl = clientssl = NULL; in test_early_data_replay_int()
3841 &clientssl, NULL, NULL)) in test_early_data_replay_int()
3842 || !TEST_true(SSL_set_session(clientssl, sess))) in test_early_data_replay_int()
3847 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_replay_int()
3876 || !TEST_int_gt(SSL_connect(clientssl), 0) in test_early_data_replay_int()
3886 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3887 || !TEST_int_eq(SSL_session_reused(clientssl), (usecb > 0) ? 1 : 0) in test_early_data_replay_int()
3899 SSL_free(clientssl); in test_early_data_replay_int()
3944 SSL *clientssl = NULL, *serverssl = NULL; in early_data_skip_helper() local
3971 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in early_data_skip_helper()
4008 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in early_data_skip_helper()
4033 if (!TEST_false(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in early_data_skip_helper()
4041 BIO *wbio = SSL_get_wbio(clientssl); in early_data_skip_helper()
4052 if (!TEST_false(SSL_write_ex(clientssl, MSG2, strlen(MSG2), in early_data_skip_helper()
4090 if (!TEST_true(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in early_data_skip_helper()
4092 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in early_data_skip_helper()
4113 SSL_free(clientssl); in early_data_skip_helper()
4171 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_sent() local
4177 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_not_sent()
4183 SSL_set_connect_state(clientssl); in test_early_data_not_sent()
4184 if (!TEST_false(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written))) in test_early_data_not_sent()
4194 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_not_sent()
4199 if (!TEST_true(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)) in test_early_data_not_sent()
4207 if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_not_sent()
4219 SSL_free(clientssl); in test_early_data_not_sent()
4254 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk() local
4272 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_psk()
4290 || !TEST_true(SSL_set_tlsext_host_name(clientssl, "badhost"))) in test_early_data_psk()
4300 || !TEST_false(SSL_set_alpn_protos(clientssl, BADALPN, in test_early_data_psk()
4332 || !TEST_true(SSL_set_tlsext_host_name(clientssl, "goodhost")) in test_early_data_psk()
4357 || !TEST_false(SSL_set_alpn_protos(clientssl, GOODALPN, in test_early_data_psk()
4375 || !TEST_false(SSL_set_alpn_protos(clientssl, alpnlist, in test_early_data_psk()
4390 SSL_set_connect_state(clientssl); in test_early_data_psk()
4392 if (!TEST_false(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_psk()
4394 || !TEST_int_eq(SSL_get_error(clientssl, 0), SSL_ERROR_SSL) in test_early_data_psk()
4400 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_psk()
4413 || !TEST_int_eq(SSL_connect(clientssl), connectres)) in test_early_data_psk()
4425 SSL_free(clientssl); in test_early_data_psk()
4444 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk_with_all_ciphers() local
4498 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_psk_with_all_ciphers()
4508 SSL_set_security_level(clientssl, 0); in test_early_data_psk_with_all_ciphers()
4512 if (!TEST_true(SSL_set_ciphersuites(clientssl, cipher_str[idx])) in test_early_data_psk_with_all_ciphers()
4523 cipher = SSL_CIPHER_find(clientssl, cipher_bytes[idx]); in test_early_data_psk_with_all_ciphers()
4527 SSL_set_connect_state(clientssl); in test_early_data_psk_with_all_ciphers()
4529 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_psk_with_all_ciphers()
4543 || !TEST_int_eq(SSL_connect(clientssl), 1) in test_early_data_psk_with_all_ciphers()
4548 if (!TEST_true(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in test_early_data_psk_with_all_ciphers()
4562 if (clientssl != NULL) in test_early_data_psk_with_all_ciphers()
4563 SSL_shutdown(clientssl); in test_early_data_psk_with_all_ciphers()
4567 SSL_free(clientssl); in test_early_data_psk_with_all_ciphers()
4580 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_expected() local
4586 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_not_expected()
4592 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_not_expected()
4601 || !TEST_int_gt(SSL_connect(clientssl), 0) in test_early_data_not_expected()
4605 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_not_expected()
4610 if (!TEST_true(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in test_early_data_not_expected()
4626 SSL_free(clientssl); in test_early_data_not_expected()
4641 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_tls1_2() local
4646 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_tls1_2()
4652 SSL_set_max_proto_version(clientssl, TLS1_2_VERSION); in test_early_data_tls1_2()
4653 SSL_set_connect_state(clientssl); in test_early_data_tls1_2()
4654 if (!TEST_false(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written))) in test_early_data_tls1_2()
4671 if (!TEST_false(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)) in test_early_data_tls1_2()
4681 if (!TEST_true(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)) in test_early_data_tls1_2()
4683 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_tls1_2()
4689 || !SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes) in test_early_data_tls1_2()
4700 SSL_free(clientssl); in test_early_data_tls1_2()
4725 SSL *clientssl = NULL, *serverssl = NULL; in test_set_ciphersuite() local
4754 &clientssl, NULL, NULL))) in test_set_ciphersuite()
4759 if (!TEST_true(SSL_set_cipher_list(clientssl, "AES256-GCM-SHA384"))) in test_set_ciphersuite()
4765 if (!TEST_true(SSL_set_ciphersuites(clientssl, in test_set_ciphersuite()
4770 if (!TEST_true(SSL_set_ciphersuites(clientssl, in test_set_ciphersuite()
4775 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_set_ciphersuite()
4782 SSL_free(clientssl); in test_set_ciphersuite()
4792 SSL *clientssl = NULL, *serverssl = NULL; in test_ciphersuite_change() local
4809 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4811 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4815 clntsess = SSL_get1_session(clientssl); in test_ciphersuite_change()
4818 SSL_shutdown(clientssl); in test_ciphersuite_change()
4821 SSL_free(clientssl); in test_ciphersuite_change()
4822 serverssl = clientssl = NULL; in test_ciphersuite_change()
4828 &clientssl, NULL, NULL)) in test_ciphersuite_change()
4829 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ciphersuite_change()
4830 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4832 || !TEST_true(SSL_session_reused(clientssl))) in test_ciphersuite_change()
4836 clntsess = SSL_get1_session(clientssl); in test_ciphersuite_change()
4837 SSL_shutdown(clientssl); in test_ciphersuite_change()
4840 SSL_free(clientssl); in test_ciphersuite_change()
4841 serverssl = clientssl = NULL; in test_ciphersuite_change()
4848 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4850 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ciphersuite_change()
4851 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4853 || !TEST_false(SSL_session_reused(clientssl))) in test_ciphersuite_change()
4858 SSL_shutdown(clientssl); in test_ciphersuite_change()
4861 SSL_free(clientssl); in test_ciphersuite_change()
4862 serverssl = clientssl = NULL; in test_ciphersuite_change()
4867 &clientssl, NULL, NULL)) in test_ciphersuite_change()
4868 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4872 clntsess = SSL_get1_session(clientssl); in test_ciphersuite_change()
4873 SSL_shutdown(clientssl); in test_ciphersuite_change()
4876 SSL_free(clientssl); in test_ciphersuite_change()
4877 serverssl = clientssl = NULL; in test_ciphersuite_change()
4883 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4885 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ciphersuite_change()
4891 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4904 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4915 SSL_free(clientssl); in test_ciphersuite_change()
4954 SSL *serverssl = NULL, *clientssl = NULL; in test_key_exchange() local
5070 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_exchange()
5075 || !TEST_true(SSL_set1_groups(clientssl, kexch_groups, kexch_groups_size))) in test_key_exchange()
5078 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_key_exchange()
5097 || !TEST_str_eq(SSL_get0_group_name(clientssl), kexch_name0)) in test_key_exchange()
5101 if (!TEST_int_eq(SSL_get_negotiated_group(clientssl), kexch_groups[0])) in test_key_exchange()
5108 SSL_free(clientssl); in test_key_exchange()
5117 static int set_ssl_groups(SSL *serverssl, SSL *clientssl, int clientmulti, in set_ssl_groups() argument
5135 if (!TEST_true(SSL_set1_groups(clientssl, ecdhe_kexch_groups, in set_ssl_groups()
5139 if (!TEST_true(SSL_set1_groups(clientssl, ffdhe_kexch_groups, in set_ssl_groups()
5144 if (!TEST_true(SSL_set1_groups(clientssl, kexch_groups, 1))) in set_ssl_groups()
5187 SSL *serverssl = NULL, *clientssl = NULL; in test_negotiated_group() local
5240 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5244 if (!TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, isecdhe, in test_negotiated_group()
5248 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_negotiated_group()
5252 if (!TEST_uint_eq(SSL_get_negotiated_group(clientssl), expectednid) in test_negotiated_group()
5256 if (!TEST_ptr((origsess = SSL_get1_session(clientssl)))) in test_negotiated_group()
5259 SSL_shutdown(clientssl); in test_negotiated_group()
5262 SSL_free(clientssl); in test_negotiated_group()
5263 serverssl = clientssl = NULL; in test_negotiated_group()
5266 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5268 || !TEST_true(SSL_set_session(clientssl, origsess)) in test_negotiated_group()
5269 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
5273 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
5274 || !TEST_true(SSL_session_reused(clientssl))) in test_negotiated_group()
5278 if (!TEST_uint_eq(SSL_get_negotiated_group(clientssl), expectednid) in test_negotiated_group()
5282 SSL_shutdown(clientssl); in test_negotiated_group()
5285 SSL_free(clientssl); in test_negotiated_group()
5286 serverssl = clientssl = NULL; in test_negotiated_group()
5312 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5314 || !TEST_true(SSL_set_session(clientssl, origsess)) in test_negotiated_group()
5315 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
5319 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
5320 || !TEST_true(SSL_session_reused(clientssl))) in test_negotiated_group()
5324 if (!TEST_uint_eq(SSL_get_negotiated_group(clientssl), expectednid) in test_negotiated_group()
5331 SSL_free(clientssl); in test_negotiated_group()
5349 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_ciphersuite() local
5432 &clientssl, NULL, NULL))) in test_tls13_ciphersuite()
5437 || !TEST_true(SSL_set_ciphersuites(clientssl, t13_cipher))) in test_tls13_ciphersuite()
5441 || !TEST_true(SSL_set_cipher_list(clientssl, in test_tls13_ciphersuite()
5447 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_ciphersuite()
5454 clientssl)); in test_tls13_ciphersuite()
5476 SSL_free(clientssl); in test_tls13_ciphersuite()
5477 clientssl = NULL; in test_tls13_ciphersuite()
5488 SSL_free(clientssl); in test_tls13_ciphersuite()
5504 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_psk() local
5568 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5570 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5572 || !TEST_false(SSL_session_reused(clientssl)) in test_tls13_psk()
5594 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5595 serverssl = clientssl = NULL; in test_tls13_psk()
5599 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5604 cipher = SSL_CIPHER_find(clientssl, TLS13_AES_128_GCM_SHA256_BYTES); in test_tls13_psk()
5618 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5619 || !TEST_true(SSL_session_reused(clientssl)) in test_tls13_psk()
5637 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5638 serverssl = clientssl = NULL; in test_tls13_psk()
5642 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5659 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5660 || !TEST_true(SSL_session_reused(clientssl)) in test_tls13_psk()
5678 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5679 serverssl = clientssl = NULL; in test_tls13_psk()
5689 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5691 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5693 || !TEST_false(SSL_session_reused(clientssl)) in test_tls13_psk()
5715 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5716 serverssl = clientssl = NULL; in test_tls13_psk()
5725 SSL_free(clientssl); in test_tls13_psk()
5745 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_no_dhe_kex() local
5778 &clientssl, NULL, NULL))) in test_tls13_no_dhe_kex()
5781 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_no_dhe_kex()
5790 SSL_shutdown(clientssl); in test_tls13_no_dhe_kex()
5793 SSL_free(clientssl); in test_tls13_no_dhe_kex()
5795 clientssl = serverssl = NULL; in test_tls13_no_dhe_kex()
5811 &clientssl, NULL, NULL)) in test_tls13_no_dhe_kex()
5812 || !TEST_true(SSL_set_session(clientssl, saved_session))) in test_tls13_no_dhe_kex()
5815 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_no_dhe_kex()
5822 if (!TEST_true(SSL_session_reused(clientssl))) in test_tls13_no_dhe_kex()
5825 SSL_shutdown(clientssl); in test_tls13_no_dhe_kex()
5832 SSL_free(clientssl); in test_tls13_no_dhe_kex()
5887 SSL *serverssl = NULL, *clientssl = NULL; in test_stateless() local
5898 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5901 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5911 SSL_free(clientssl); in test_stateless()
5912 clientssl = NULL; in test_stateless()
5922 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5925 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5932 SSL_free(clientssl); in test_stateless()
5933 clientssl = NULL; in test_stateless()
5939 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5942 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5947 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5952 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_stateless()
5956 shutdown_ssl_connection(serverssl, clientssl); in test_stateless()
5957 serverssl = clientssl = NULL; in test_stateless()
5962 SSL_free(clientssl); in test_stateless()
6102 SSL *clientssl = NULL, *serverssl = NULL; in test_custom_exts() local
6228 &clientssl, NULL, NULL)) in test_custom_exts()
6229 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
6262 sess = SSL_get1_session(clientssl); in test_custom_exts()
6263 SSL_shutdown(clientssl); in test_custom_exts()
6266 SSL_free(clientssl); in test_custom_exts()
6267 serverssl = clientssl = NULL; in test_custom_exts()
6275 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_custom_exts()
6277 || !TEST_true(SSL_set_session(clientssl, sess)) in test_custom_exts()
6278 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
6317 SSL_free(clientssl); in test_custom_exts()
6372 SSL *clientssl = NULL, *serverssl = NULL; in test_serverinfo_custom() local
6435 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_serverinfo_custom()
6437 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_serverinfo_custom()
6439 || !TEST_int_eq(SSL_do_handshake(clientssl), 1)) in test_serverinfo_custom()
6449 SSL_free(clientssl); in test_serverinfo_custom()
6468 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat() local
6517 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_export_key_mat()
6524 if (!TEST_int_le(SSL_export_keying_material(clientssl, ckeymat1, in test_export_key_mat()
6530 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_export_key_mat()
6539 if (!TEST_int_le(SSL_export_keying_material(clientssl, ckeymat1, in test_export_key_mat()
6555 if (!TEST_int_eq(SSL_export_keying_material(clientssl, ckeymat1, in test_export_key_mat()
6559 || !TEST_int_eq(SSL_export_keying_material(clientssl, ckeymat2, in test_export_key_mat()
6564 || !TEST_int_eq(SSL_export_keying_material(clientssl, ckeymat3, in test_export_key_mat()
6569 && !TEST_int_eq(SSL_export_keying_material(clientssl, in test_export_key_mat()
6642 SSL_free(clientssl); in test_export_key_mat()
6663 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat_early() local
6671 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, &serverssl, in test_export_key_mat_early()
6676 if (!TEST_true(SSL_write_early_data(clientssl, NULL, 0, &written)) in test_export_key_mat_early()
6685 clientssl, ckeymat1, sizeof(ckeymat1), label, in test_export_key_mat_early()
6688 clientssl, ckeymat2, sizeof(ckeymat2), label, in test_export_key_mat_early()
6721 SSL_free(clientssl); in test_export_key_mat_early()
6735 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update() local
6745 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update()
6747 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update()
6754 if (!TEST_true(SSL_key_update(clientssl, in test_key_update()
6758 || !TEST_true(SSL_do_handshake(clientssl))) in test_key_update()
6763 if (!TEST_int_eq(SSL_write(clientssl, mess, strlen(mess)), strlen(mess)) in test_key_update()
6769 || !TEST_int_eq(SSL_read(clientssl, buf, sizeof(buf)), in test_key_update()
6778 SSL_free(clientssl); in test_key_update()
6794 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_write() local
6808 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_write()
6810 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_write()
6814 peerupdate = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_write()
6815 peerwrite = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_write()
6870 SSL_free(clientssl); in test_key_update_peer_in_write()
6889 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_read() local
6901 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_read()
6903 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_read()
6907 local = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_read()
6908 peer = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_read()
6956 SSL_free(clientssl); in test_key_update_peer_in_read()
6972 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_write() local
6986 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_write()
6988 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_write()
6992 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_write()
6993 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_write()
7045 SSL_free(clientssl); in test_key_update_local_in_write()
7063 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_read() local
7075 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_read()
7077 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_read()
7081 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_read()
7082 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_read()
7130 SSL_free(clientssl); in test_key_update_local_in_read()
7153 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_clear() local
7180 &clientssl, NULL, NULL)) in test_ssl_clear()
7181 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
7186 writer = clientssl; in test_ssl_clear()
7190 reader = clientssl; in test_ssl_clear()
7206 SSL_shutdown(clientssl); in test_ssl_clear()
7229 SSL_free(clientssl); in test_ssl_clear()
7230 clientssl = NULL; in test_ssl_clear()
7233 if (!TEST_true(SSL_clear(clientssl))) in test_ssl_clear()
7236 SSL_set_connect_state(clientssl); in test_ssl_clear()
7242 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_clear()
7244 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
7246 || !TEST_true(servertest || SSL_session_reused(clientssl))) in test_ssl_clear()
7249 SSL_shutdown(clientssl); in test_ssl_clear()
7256 SSL_free(clientssl); in test_ssl_clear()
7379 SSL *clientssl = NULL, *serverssl = NULL; in test_pha_key_update() local
7395 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pha_key_update()
7399 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
7407 if (!TEST_true(SSL_key_update(clientssl, SSL_KEY_UPDATE_NOT_REQUESTED))) in test_pha_key_update()
7415 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
7419 SSL_shutdown(clientssl); in test_pha_key_update()
7426 SSL_free(clientssl); in test_pha_key_update()
7583 SSL *clientssl = NULL, *serverssl = NULL; in test_srp() local
7625 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_srp()
7629 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_srp()
7644 SSL_free(clientssl); in test_srp()
7837 SSL *clientssl = NULL, *serverssl = NULL; in test_info_callback() local
7871 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_info_callback()
7879 SSL_set_info_callback((tst % 2) == 0 ? serverssl : clientssl, in test_info_callback()
7884 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_info_callback()
7899 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7930 &clientssl, NULL, NULL)) in test_info_callback()
7931 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7938 clntsess = SSL_get1_session(clientssl); in test_info_callback()
7939 SSL_shutdown(clientssl); in test_info_callback()
7942 SSL_free(clientssl); in test_info_callback()
7943 serverssl = clientssl = NULL; in test_info_callback()
7946 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_info_callback()
7948 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_info_callback()
7949 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7951 || !TEST_true(SSL_session_reused(clientssl)) in test_info_callback()
7959 SSL_free(clientssl); in test_info_callback()
7969 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_pending() local
8009 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_pending()
8011 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_pending()
8015 if (!TEST_int_eq(SSL_pending(clientssl), 0) in test_ssl_pending()
8016 || !TEST_false(SSL_has_pending(clientssl)) in test_ssl_pending()
8021 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_ssl_pending()
8023 || !TEST_int_eq(SSL_pending(clientssl), (int)(written - readbytes)) in test_ssl_pending()
8024 || !TEST_true(SSL_has_pending(clientssl))) in test_ssl_pending()
8031 SSL_free(clientssl); in test_ssl_pending()
8126 SSL *clientssl = NULL, *serverssl = NULL; in int_test_ssl_get_shared_ciphers() local
8171 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in int_test_ssl_get_shared_ciphers()
8173 || !TEST_true(create_ssl_connection(serverssl, clientssl, in int_test_ssl_get_shared_ciphers()
8191 SSL_free(clientssl); in int_test_ssl_get_shared_ciphers()
8369 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_callbacks() local
8452 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ticket_callbacks()
8454 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
8471 clntsess = SSL_get1_session(clientssl); in test_ticket_callbacks()
8472 SSL_shutdown(clientssl); in test_ticket_callbacks()
8475 SSL_free(clientssl); in test_ticket_callbacks()
8476 serverssl = clientssl = NULL; in test_ticket_callbacks()
8479 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_ticket_callbacks()
8481 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ticket_callbacks()
8482 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
8489 if (!TEST_false(SSL_session_reused(clientssl))) in test_ticket_callbacks()
8492 if (!TEST_true(SSL_session_reused(clientssl))) in test_ticket_callbacks()
8510 SSL_free(clientssl); in test_ticket_callbacks()
8529 SSL *clientssl = NULL, *serverssl = NULL; in test_incorrect_shutdown() local
8542 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_incorrect_shutdown()
8546 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_incorrect_shutdown()
8565 SSL_free(clientssl); in test_incorrect_shutdown()
8588 SSL *clientssl = NULL, *serverssl = NULL; in test_shutdown() local
8615 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_shutdown()
8620 if (!TEST_true(create_bare_ssl_connection(serverssl, clientssl, in test_shutdown()
8622 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
8625 } else if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_shutdown()
8627 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
8632 if (!TEST_int_eq(SSL_shutdown(clientssl), 0)) in test_shutdown()
8667 if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), in test_shutdown()
8671 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), in test_shutdown()
8680 if (!TEST_false(SSL_write_ex(clientssl, msg, sizeof(msg), &written))) in test_shutdown()
8695 || !TEST_int_eq(SSL_shutdown(clientssl), 1) in test_shutdown()
8696 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
8706 if (!TEST_int_eq(SSL_shutdown(clientssl), 1) in test_shutdown()
8707 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
8718 if (!TEST_int_eq(SSL_shutdown(clientssl), -1) in test_shutdown()
8719 || !TEST_int_eq(SSL_get_error(clientssl, -1), SSL_ERROR_SSL)) in test_shutdown()
8727 SSL_free(clientssl); in test_shutdown()
8741 SSL *clientssl = NULL, *serverssl = NULL; in test_async_shutdown() local
8754 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_async_shutdown()
8758 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_async_shutdown()
8762 if (!TEST_int_eq(SSL_shutdown(clientssl), 0)) in test_async_shutdown()
8795 if (!TEST_int_eq(SSL_shutdown(clientssl), 1)) in test_async_shutdown()
8801 SSL_free(clientssl); in test_async_shutdown()
8915 SSL *clientssl = NULL, *serverssl = NULL; in test_cert_cb_int() local
8946 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_cert_cb_int()
8955 if (!TEST_true(SSL_set1_sigalgs_list(clientssl, in test_cert_cb_int()
8963 if (!TEST_true(SSL_set1_sigalgs_list(clientssl, in test_cert_cb_int()
8968 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_cert_cb_int()
8979 SSL_free(clientssl); in test_cert_cb_int()
9041 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_cb() local
9070 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_client_cert_cb()
9072 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_cb()
9080 SSL_free(clientssl); in test_client_cert_cb()
9098 SSL *clientssl = NULL, *serverssl = NULL; in test_ca_names_int() local
9153 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ca_names_int()
9155 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ca_names_int()
9182 sktmp = SSL_get0_peer_CA_list(clientssl); in test_ca_names_int()
9195 SSL_free(clientssl); in test_ca_names_int()
9248 SSL *clientssl = NULL, *serverssl = NULL; in test_multiblock_write() local
9283 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multiblock_write()
9292 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_multiblock_write()
9301 if (!TEST_true(SSL_read_ex(clientssl, p, MULTIBLOCK_FRAGSIZE, &readbytes))) in test_multiblock_write()
9312 SSL_free(clientssl); in test_multiblock_write()
9454 SSL *serverssl = NULL, *clientssl = NULL; in test_session_cache_overflow() local
9482 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9486 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_cache_overflow()
9506 SSL_shutdown(clientssl); in test_session_cache_overflow()
9508 SSL_free(clientssl); in test_session_cache_overflow()
9509 serverssl = clientssl = NULL; in test_session_cache_overflow()
9516 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9520 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_cache_overflow()
9530 sess = SSL_get1_session(clientssl); in test_session_cache_overflow()
9535 SSL_shutdown(clientssl); in test_session_cache_overflow()
9537 SSL_free(clientssl); in test_session_cache_overflow()
9538 serverssl = clientssl = NULL; in test_session_cache_overflow()
9540 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9544 if (!TEST_true(SSL_set_session(clientssl, sess))) in test_session_cache_overflow()
9547 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_cache_overflow()
9554 SSL_free(clientssl); in test_session_cache_overflow()
9578 SSL *clientssl = NULL, *serverssl = NULL; in test_servername() local
9598 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_servername()
9609 if (!TEST_true(SSL_set_tlsext_host_name(clientssl, "goodhost"))) in test_servername()
9614 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
9617 if (!TEST_str_eq(SSL_get_servername(clientssl, TLSEXT_NAMETYPE_host_name), in test_servername()
9626 if (!TEST_int_eq(SSL_shutdown(clientssl), 0) in test_servername()
9627 || !TEST_ptr_ne(sess = SSL_get1_session(clientssl), NULL) in test_servername()
9632 SSL_free(clientssl); in test_servername()
9634 clientssl = serverssl = NULL; in test_servername()
9636 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_servername()
9640 if (!TEST_true(SSL_set_session(clientssl, sess))) in test_servername()
9646 if (!TEST_true(SSL_set_tlsext_host_name(clientssl, "altgoodhost"))) in test_servername()
9655 if (!TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
9667 if (!TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
9672 if (!TEST_true(SSL_set_tlsext_host_name(clientssl, "goodhost"))) in test_servername()
9686 if (!TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
9692 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
9695 if (!TEST_true(SSL_session_reused(clientssl)) in test_servername()
9697 || !TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
9710 SSL_free(clientssl); in test_servername()
9836 SSL *clientssl = NULL, *serverssl = NULL; in test_sigalgs_available() local
9940 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_sigalgs_available()
9944 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_sigalgs_available()
9964 SSL_free(clientssl); in test_sigalgs_available()
9982 SSL *clientssl = NULL, *serverssl = NULL; in test_pluggable_group() local
9997 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pluggable_group()
10004 || !TEST_true(SSL_set1_groups_list(clientssl, group_name))) in test_pluggable_group()
10007 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pluggable_group()
10015 || !TEST_str_eq(group_name, SSL_get0_group_name(clientssl))) in test_pluggable_group()
10022 SSL_free(clientssl); in test_pluggable_group()
10090 SSL *clientssl = NULL, *serverssl = NULL; in test_pluggable_signature() local
10109 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pluggable_signature()
10116 … || !TEST_true(SSL_set1_server_cert_type(clientssl, cert_type_rpk, sizeof(cert_type_rpk)))) in test_pluggable_signature()
10122 || !TEST_true(SSL_set1_groups_list(clientssl, "xorgroup"))) in test_pluggable_signature()
10130 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pluggable_signature()
10134 if (rpkidx && !TEST_long_eq(SSL_get_verify_result(clientssl), X509_V_ERR_RPK_UNTRUSTED)) in test_pluggable_signature()
10141 SSL_free(clientssl); in test_pluggable_signature()
10155 SSL *clientssl = NULL, *serverssl = NULL, *client2ssl = NULL; in test_ssl_dup() local
10166 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_dup()
10170 if (!TEST_true(SSL_set_min_proto_version(clientssl, TLS1_2_VERSION)) in test_ssl_dup()
10171 || !TEST_true(SSL_set_max_proto_version(clientssl, TLS1_2_VERSION))) in test_ssl_dup()
10174 client2ssl = SSL_dup(clientssl); in test_ssl_dup()
10175 rbio = SSL_get_rbio(clientssl); in test_ssl_dup()
10182 wbio = SSL_get_wbio(clientssl); in test_ssl_dup()
10190 || !TEST_ptr_ne(clientssl, client2ssl)) in test_ssl_dup()
10200 SSL_free(clientssl); in test_ssl_dup()
10201 clientssl = SSL_dup(client2ssl); in test_ssl_dup()
10202 if (!TEST_ptr(clientssl) in test_ssl_dup()
10204 || !TEST_ptr_eq(clientssl, client2ssl)) in test_ssl_dup()
10211 SSL_free(clientssl); in test_ssl_dup()
10241 SSL *clientssl = NULL, *serverssl = NULL; in test_session_secret_cb() local
10253 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_secret_cb()
10258 if (!TEST_true(SSL_set_min_proto_version(clientssl, TLS1_2_VERSION)) in test_session_secret_cb()
10262 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_secret_cb()
10265 if (!TEST_ptr(secret_sess = SSL_get1_session(clientssl))) in test_session_secret_cb()
10268 shutdown_ssl_connection(serverssl, clientssl); in test_session_secret_cb()
10269 serverssl = clientssl = NULL; in test_session_secret_cb()
10272 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_secret_cb()
10283 if (!TEST_true(SSL_set_min_proto_version(clientssl, TLS1_2_VERSION)) in test_session_secret_cb()
10287 || !TEST_true(SSL_set_session_secret_cb(clientssl, secret_cb, in test_session_secret_cb()
10289 || !TEST_true(SSL_set_session(clientssl, secret_sess))) in test_session_secret_cb()
10292 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_secret_cb()
10300 SSL_free(clientssl); in test_session_secret_cb()
10406 SSL *clientssl = NULL, *serverssl = NULL; in test_set_tmp_dh() local
10458 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_set_tmp_dh()
10489 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_tmp_dh()
10500 SSL_free(clientssl); in test_set_tmp_dh()
10515 SSL *clientssl = NULL, *serverssl = NULL; in test_dh_auto() local
10585 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_dh_auto()
10593 || !TEST_true(SSL_set_cipher_list(clientssl, ciphersuite))) in test_dh_auto()
10601 if (!TEST_int_le(SSL_connect(clientssl), 0) in test_dh_auto()
10610 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_dh_auto()
10617 SSL_free(clientssl); in test_dh_auto()
10637 SSL *clientssl = NULL, *serverssl = NULL; in test_sni_tls13() local
10663 &clientssl, NULL, NULL)) in test_sni_tls13()
10664 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_sni_tls13()
10676 SSL_free(clientssl); in test_sni_tls13()
10691 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_lifetime() local
10712 &clientssl, NULL, NULL))) in test_ticket_lifetime()
10723 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_ticket_lifetime()
10728 …if (!TEST_ulong_eq(SSL_SESSION_get_ticket_lifetime_hint(SSL_get_session(clientssl)), TWO_WEEK_SEC)) in test_ticket_lifetime()
10732 …if (!TEST_ulong_le(SSL_SESSION_get_ticket_lifetime_hint(SSL_get_session(clientssl)), ONE_WEEK_SEC)) in test_ticket_lifetime()
10739 SSL_free(clientssl); in test_ticket_lifetime()
11064 SSL *clientssl = NULL, *serverssl = NULL; in test_read_ahead_key_change() local
11079 &clientssl, NULL, NULL))) in test_read_ahead_key_change()
11082 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_read_ahead_key_change()
11086 if (!TEST_true(SSL_write_ex(clientssl, msg, strlen(msg), &written)) in test_read_ahead_key_change()
11090 if (!TEST_true(SSL_key_update(clientssl, SSL_KEY_UPDATE_NOT_REQUESTED))) in test_read_ahead_key_change()
11093 if (!TEST_true(SSL_write_ex(clientssl, msg, strlen(msg), &written)) in test_read_ahead_key_change()
11118 SSL_free(clientssl); in test_read_ahead_key_change()
11164 SSL *clientssl = NULL, *serverssl = NULL; in test_tls13_record_padding() local
11196 &clientssl, NULL, NULL))) in test_tls13_record_padding()
11200 SSL_set_record_padding_callback(clientssl, record_pad_cb); in test_tls13_record_padding()
11201 SSL_set_record_padding_callback_arg(clientssl, &called); in test_tls13_record_padding()
11202 if (!TEST_ptr_eq(SSL_get_record_padding_callback_arg(clientssl), &called)) in test_tls13_record_padding()
11206 if (!TEST_false(SSL_set_block_padding(clientssl, in test_tls13_record_padding()
11209 if (!TEST_true(SSL_set_block_padding(clientssl, 512))) in test_tls13_record_padding()
11213 if (!TEST_false(SSL_set_block_padding_ex(clientssl, 0, in test_tls13_record_padding()
11217 if (!TEST_true(SSL_set_block_padding_ex(clientssl, 0, 512))) in test_tls13_record_padding()
11223 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_tls13_record_padding()
11235 if (!TEST_true(SSL_write_ex(clientssl, msg, strlen(msg), &written)) in test_tls13_record_padding()
11255 SSL_free(clientssl); in test_tls13_record_padding()
11284 SSL *clientssl = NULL, *serverssl = NULL, *peera, *peerb; in test_pipelining() local
11315 &clientssl, NULL, NULL))) in test_pipelining()
11318 if (!TEST_true(SSL_set_cipher_list(clientssl, "AES128-SHA"))) in test_pipelining()
11324 peerb = clientssl; in test_pipelining()
11327 peera = clientssl; in test_pipelining()
11373 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pipelining()
11446 SSL_free(clientssl); in test_pipelining()
11500 SSL *clientssl = NULL, *serverssl = NULL; in test_version() local
11571 &clientssl, NULL, NULL))) in test_version()
11574 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_version()
11578 || !TEST_int_eq(SSL_version(clientssl), version) in test_version()
11580 || !TEST_true(check_version_string(clientssl, version))) in test_version()
11585 || !TEST_true(SSL_is_dtls(clientssl)) in test_version()
11587 || !TEST_false(SSL_is_tls(clientssl)) in test_version()
11589 || !TEST_false(SSL_is_quic(clientssl))) in test_version()
11593 || !TEST_true(SSL_is_tls(clientssl)) in test_version()
11595 || !TEST_false(SSL_is_dtls(clientssl)) in test_version()
11597 || !TEST_false(SSL_is_quic(clientssl))) in test_version()
11604 SSL_free(clientssl); in test_version()
11616 SSL *clientssl = NULL, *serverssl = NULL; in test_rstate_string() local
11635 &clientssl, NULL, NULL))) in test_rstate_string()
11642 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_rstate_string()
11674 SSL_free(clientssl); in test_rstate_string()
11700 SSL *clientssl = NULL, *serverssl = NULL; in test_handshake_retry() local
11739 &clientssl, NULL, NULL))) in test_handshake_retry()
11750 if (!TEST_int_eq(SSL_connect(clientssl), -1)) in test_handshake_retry()
11761 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_handshake_retry()
11767 SSL_free(clientssl); in test_handshake_retry()
11782 SSL *clientssl = NULL, *serverssl = NULL; in test_data_retry() local
11802 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_data_retry()
11806 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_data_retry()
11810 if (!TEST_true(SSL_set_max_send_fragment(clientssl, 512))) in test_data_retry()
11813 tmp = SSL_get_wbio(clientssl); in test_data_retry()
11820 SSL_set0_wbio(clientssl, bretry); in test_data_retry()
11828 if (!TEST_false(SSL_write_ex(clientssl, inbuf, sizeof(inbuf), &written))) in test_data_retry()
11830 if (!TEST_int_eq(SSL_get_error(clientssl, 0), SSL_ERROR_WANT_WRITE)) in test_data_retry()
11845 if (!TEST_false(SSL_write_ex(clientssl, inbuf, sizeof(inbuf), &written))) in test_data_retry()
11847 if (!TEST_int_eq(SSL_get_error(clientssl, 0), SSL_ERROR_WANT_WRITE)) in test_data_retry()
11852 if (!TEST_true(SSL_write_ex(clientssl, inbuf, sizeof(inbuf), &written))) in test_data_retry()
11864 SSL_free(clientssl); in test_data_retry()
11887 SSL *serverssl = NULL, *clientssl = NULL; in resume_servername_cb() local
11899 &clientssl, NULL, NULL)) in resume_servername_cb()
11900 || !TEST_true(SSL_set_session(clientssl, cbdata->sess))) in resume_servername_cb()
11908 if (!TEST_false(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) { in resume_servername_cb()
11917 SSL_free(clientssl); in resume_servername_cb()
11932 SSL *serverssl = NULL, *clientssl = NULL; in test_multi_resume() local
11978 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multi_resume()
11980 || !TEST_true(SSL_set_session(clientssl, sess))) in test_multi_resume()
12002 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_multi_resume()
12006 if (!TEST_false(SSL_session_reused(clientssl))) in test_multi_resume()
12009 if (!TEST_true(SSL_session_reused(clientssl))) in test_multi_resume()
12018 if (!TEST_ptr((sess = SSL_get1_session(clientssl)))) in test_multi_resume()
12022 SSL_shutdown(clientssl); in test_multi_resume()
12025 SSL_free(clientssl); in test_multi_resume()
12026 serverssl = clientssl = NULL; in test_multi_resume()
12036 SSL_free(clientssl); in test_multi_resume()
12242 SSL *serverssl = NULL, *clientssl = NULL; in test_npn() local
12253 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_npn()
12259 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_npn()
12266 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_npn()
12294 SSL_free(clientssl); in test_npn()
12340 SSL *serverssl = NULL, *clientssl = NULL; in test_alpn() local
12352 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_alpn()
12362 if (!TEST_false(SSL_set_alpn_protos(clientssl, prots, protslen))) in test_alpn()
12367 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_alpn()
12374 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_alpn()
12378 SSL_get0_alpn_selected(clientssl, &prot, &protlen); in test_alpn()
12397 SSL_free(clientssl); in test_alpn()