Lines Matching refs:clientssl
363 SSL *clientssl = NULL, *serverssl = NULL; in test_keylog() local
403 &clientssl, NULL, NULL)) in test_keylog()
404 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog()
419 if (!TEST_true(test_keylog_output(client_log_buffer, clientssl, in test_keylog()
420 SSL_get_session(clientssl), &expected))) in test_keylog()
432 SSL_free(clientssl); in test_keylog()
444 SSL *clientssl = NULL, *serverssl = NULL; in test_keylog_no_master_key() local
482 &clientssl, NULL, NULL)) in test_keylog_no_master_key()
483 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog_no_master_key()
498 if (!TEST_true(test_keylog_output(client_log_buffer, clientssl, in test_keylog_no_master_key()
499 SSL_get_session(clientssl), &expected)) in test_keylog_no_master_key()
506 sess = SSL_get1_session(clientssl); in test_keylog_no_master_key()
507 SSL_shutdown(clientssl); in test_keylog_no_master_key()
510 SSL_free(clientssl); in test_keylog_no_master_key()
511 serverssl = clientssl = NULL; in test_keylog_no_master_key()
520 &clientssl, NULL, NULL)) in test_keylog_no_master_key()
521 || !TEST_true(SSL_set_session(clientssl, sess)) in test_keylog_no_master_key()
523 || !TEST_true(SSL_write_early_data(clientssl, NULL, 0, &written)) in test_keylog_no_master_key()
529 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog_no_master_key()
531 || !TEST_true(SSL_session_reused(clientssl))) in test_keylog_no_master_key()
537 if (!TEST_true(test_keylog_output(client_log_buffer, clientssl, in test_keylog_no_master_key()
538 SSL_get_session(clientssl), &expected)) in test_keylog_no_master_key()
549 SSL_free(clientssl); in test_keylog_no_master_key()
578 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_verify_cb() local
595 &clientssl, NULL, NULL))) in test_client_cert_verify_cb()
599 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_client_cert_verify_cb()
606 || !TEST_ptr((server_chain = SSL_get_peer_cert_chain(clientssl)))) in test_client_cert_verify_cb()
617 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_verify_cb()
626 if (clientssl != NULL) { in test_client_cert_verify_cb()
627 SSL_shutdown(clientssl); in test_client_cert_verify_cb()
628 SSL_free(clientssl); in test_client_cert_verify_cb()
746 SSL *clientssl = NULL, *serverssl = NULL; in test_client_hello_cb() local
761 &clientssl, NULL, NULL)) in test_client_hello_cb()
762 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_client_hello_cb()
770 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_hello_cb()
778 SSL_free(clientssl); in test_client_hello_cb()
788 SSL *clientssl = NULL, *serverssl = NULL; in test_no_ems() local
800 if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) { in test_no_ems()
805 if (!create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) { in test_no_ems()
815 if (SSL_get_extms_support(clientssl)) { in test_no_ems()
823 SSL_free(clientssl); in test_no_ems()
839 SSL *clientssl = NULL, *serverssl = NULL; in test_ccs_change_cipher() local
855 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
857 || !TEST_true(SSL_set_cipher_list(clientssl, "AES128-GCM-SHA256")) in test_ccs_change_cipher()
858 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
861 || !TEST_ptr(sess = SSL_get1_session(clientssl))) in test_ccs_change_cipher()
864 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
865 serverssl = clientssl = NULL; in test_ccs_change_cipher()
869 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
871 || !TEST_true(SSL_set_session(clientssl, sess)) in test_ccs_change_cipher()
872 || !TEST_true(SSL_set_cipher_list(clientssl, "AES256-GCM-SHA384:AES128-GCM-SHA256")) in test_ccs_change_cipher()
873 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
875 || !TEST_true(SSL_session_reused(clientssl)) in test_ccs_change_cipher()
880 SSL_CIPHER_get_id(SSL_get_current_cipher(clientssl)))) in test_ccs_change_cipher()
882 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
883 serverssl = clientssl = NULL; in test_ccs_change_cipher()
889 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
891 || !TEST_true(SSL_set_cipher_list(clientssl, "AES128-GCM-SHA256")) in test_ccs_change_cipher()
892 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
895 || !TEST_true(SSL_set_cipher_list(clientssl, "AES256-GCM-SHA384")) in test_ccs_change_cipher()
896 || !TEST_true(SSL_renegotiate(clientssl)) in test_ccs_change_cipher()
897 || !TEST_true(SSL_renegotiate_pending(clientssl))) in test_ccs_change_cipher()
901 if (SSL_read_ex(clientssl, &buf, sizeof(buf), &readbytes) > 0) { in test_ccs_change_cipher()
904 } else if (!TEST_int_eq(SSL_get_error(clientssl, 0), in test_ccs_change_cipher()
917 if (!TEST_false(SSL_renegotiate_pending(clientssl)) in test_ccs_change_cipher()
918 || !TEST_false(SSL_session_reused(clientssl)) in test_ccs_change_cipher()
923 SSL_CIPHER_get_id(SSL_get_current_cipher(clientssl)))) in test_ccs_change_cipher()
926 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
927 serverssl = clientssl = NULL; in test_ccs_change_cipher()
933 SSL_free(clientssl); in test_ccs_change_cipher()
948 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_large_message() local
1011 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_test_large_message()
1013 || !TEST_true(create_ssl_connection(serverssl, clientssl, in execute_test_large_message()
1029 SSL_free(clientssl); in execute_test_large_message()
1046 static int ping_pong_query(SSL *clientssl, SSL *serverssl) in ping_pong_query() argument
1062 memcpy(crec_wseq_before, &clientssl->rlayer.write_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1063 memcpy(crec_rseq_before, &clientssl->rlayer.read_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1067 if (!TEST_true(SSL_write(clientssl, cbuf, sizeof(cbuf)) == sizeof(cbuf))) in ping_pong_query()
1079 while ((err = SSL_read(clientssl, &cbuf, sizeof(cbuf))) != sizeof(cbuf)) { in ping_pong_query()
1080 if (SSL_get_error(clientssl, err) != SSL_ERROR_WANT_READ) { in ping_pong_query()
1085 memcpy(crec_wseq_after, &clientssl->rlayer.write_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1086 memcpy(crec_rseq_after, &clientssl->rlayer.read_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1098 if (!BIO_get_ktls_send(clientssl->wbio)) { in ping_pong_query()
1118 if (!BIO_get_ktls_recv(clientssl->wbio)) { in ping_pong_query()
1147 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_ktls() local
1184 &clientssl, sfd, cfd))) in execute_test_ktls()
1188 if (!TEST_true(SSL_set_options(clientssl, SSL_OP_ENABLE_KTLS))) in execute_test_ktls()
1197 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in execute_test_ktls()
1206 if (!TEST_false(BIO_get_ktls_send(clientssl->wbio))) in execute_test_ktls()
1209 if (BIO_get_ktls_send(clientssl->wbio)) in execute_test_ktls()
1227 if (!TEST_false(BIO_get_ktls_recv(clientssl->rbio))) in execute_test_ktls()
1230 if (BIO_get_ktls_send(clientssl->rbio)) in execute_test_ktls()
1249 if (!TEST_true(ping_pong_query(clientssl, serverssl))) in execute_test_ktls()
1254 if (clientssl) { in execute_test_ktls()
1255 SSL_shutdown(clientssl); in execute_test_ktls()
1256 SSL_free(clientssl); in execute_test_ktls()
1264 serverssl = clientssl = NULL; in execute_test_ktls()
1279 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_ktls_sendfile() local
1323 &clientssl, sfd, cfd))) in execute_test_ktls_sendfile()
1329 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in execute_test_ktls_sendfile()
1366 while ((err = SSL_read(clientssl, in execute_test_ktls_sendfile()
1369 if (SSL_get_error(clientssl, err) != SSL_ERROR_WANT_READ) in execute_test_ktls_sendfile()
1385 if (clientssl) { in execute_test_ktls_sendfile()
1386 SSL_shutdown(clientssl); in execute_test_ktls_sendfile()
1387 SSL_free(clientssl); in execute_test_ktls_sendfile()
1395 serverssl = clientssl = NULL; in execute_test_ktls_sendfile()
1506 SSL *clientssl = NULL, *serverssl = NULL; in execute_cleanse_plaintext() local
1541 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_cleanse_plaintext()
1548 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in execute_cleanse_plaintext()
1556 if (!TEST_int_eq(SSL_write(clientssl, cbuf, sizeof(cbuf)), sizeof(cbuf))) in execute_cleanse_plaintext()
1597 SSL_free(clientssl); in execute_cleanse_plaintext()
1687 SSL *clientssl = NULL, *serverssl = NULL; in test_tlsext_status_type() local
1703 clientssl = SSL_new(cctx); in test_tlsext_status_type()
1704 if (!TEST_int_eq(SSL_get_tlsext_status_type(clientssl), -1) in test_tlsext_status_type()
1705 || !TEST_true(SSL_set_tlsext_status_type(clientssl, in test_tlsext_status_type()
1707 || !TEST_int_eq(SSL_get_tlsext_status_type(clientssl), in test_tlsext_status_type()
1711 SSL_free(clientssl); in test_tlsext_status_type()
1712 clientssl = NULL; in test_tlsext_status_type()
1718 clientssl = SSL_new(cctx); in test_tlsext_status_type()
1719 if (SSL_get_tlsext_status_type(clientssl) != TLSEXT_STATUSTYPE_ocsp) in test_tlsext_status_type()
1721 SSL_free(clientssl); in test_tlsext_status_type()
1722 clientssl = NULL; in test_tlsext_status_type()
1733 &clientssl, NULL, NULL)) in test_tlsext_status_type()
1734 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1740 SSL_free(clientssl); in test_tlsext_status_type()
1742 clientssl = NULL; in test_tlsext_status_type()
1749 &clientssl, NULL, NULL)) in test_tlsext_status_type()
1751 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1757 SSL_free(clientssl); in test_tlsext_status_type()
1759 clientssl = NULL; in test_tlsext_status_type()
1769 &clientssl, NULL, NULL))) in test_tlsext_status_type()
1785 SSL_set_tlsext_status_ids(clientssl, ids); in test_tlsext_status_type()
1792 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1802 SSL_free(clientssl); in test_tlsext_status_type()
2250 SSL *serverssl = NULL, *clientssl = NULL; in check_resumption() local
2257 &clientssl, NULL, NULL)) in check_resumption()
2258 || !TEST_true(SSL_set_session(clientssl, sesscache[i]))) in check_resumption()
2261 SSL_set_post_handshake_auth(clientssl, 1); in check_resumption()
2263 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in check_resumption()
2272 if (!TEST_true(SSL_session_reused(clientssl)) in check_resumption()
2276 if (!TEST_false(SSL_session_reused(clientssl)) in check_resumption()
2284 && (!post_handshake_verify(serverssl, clientssl) in check_resumption()
2288 SSL_shutdown(clientssl); in check_resumption()
2291 SSL_free(clientssl); in check_resumption()
2292 serverssl = clientssl = NULL; in check_resumption()
2300 SSL_free(clientssl); in check_resumption()
2308 SSL *serverssl = NULL, *clientssl = NULL; in test_tickets() local
2321 &clientssl, NULL, NULL))) in test_tickets()
2324 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2330 SSL_shutdown(clientssl); in test_tickets()
2333 SSL_free(clientssl); in test_tickets()
2336 clientssl = serverssl = NULL; in test_tickets()
2365 &clientssl, NULL, NULL))) in test_tickets()
2368 SSL_set_post_handshake_auth(clientssl, 1); in test_tickets()
2370 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2377 if (!post_handshake_verify(serverssl, clientssl) in test_tickets()
2381 SSL_shutdown(clientssl); in test_tickets()
2384 SSL_free(clientssl); in test_tickets()
2385 serverssl = clientssl = NULL; in test_tickets()
2401 SSL_free(clientssl); in test_tickets()
2425 SSL *serverssl = NULL, *clientssl = NULL; in test_psk_tickets() local
2447 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_psk_tickets()
2450 clientpsk = serverpsk = create_a_psk(clientssl); in test_psk_tickets()
2455 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_psk_tickets()
2467 SSL_free(clientssl); in test_psk_tickets()
2480 SSL *serverssl = NULL, *clientssl = NULL; in test_extra_tickets() local
2503 &clientssl, NULL, NULL))) in test_extra_tickets()
2510 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_extra_tickets()
2524 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2528 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes))) in test_extra_tickets()
2538 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2552 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2563 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2601 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2605 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes))) in test_extra_tickets()
2616 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes)) in test_extra_tickets()
2620 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &nbytes))) in test_extra_tickets()
2623 SSL_shutdown(clientssl); in test_extra_tickets()
2631 SSL_free(clientssl); in test_extra_tickets()
2634 clientssl = serverssl = NULL; in test_extra_tickets()
2694 SSL *serverssl = NULL, *clientssl = NULL; in test_ssl_set_bio() local
2733 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_set_bio()
2756 SSL_set_bio(clientssl, irbio, iwbio); in test_ssl_set_bio()
2770 && !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_set_bio()
2792 SSL_set_bio(clientssl, nrbio, nwbio); in test_ssl_set_bio()
2806 SSL_free(clientssl); in test_ssl_set_bio()
2929 SSL *clientssl = NULL, *serverssl = NULL; in test_set_sigalgs() local
2971 &clientssl, NULL, NULL))) in test_set_sigalgs()
2978 ret = SSL_set1_sigalgs(clientssl, curr->list, curr->listlen); in test_set_sigalgs()
2980 ret = SSL_set1_sigalgs_list(clientssl, curr->liststr); in test_set_sigalgs()
2992 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_sigalgs()
3001 SSL_free(clientssl); in test_set_sigalgs()
3176 static int setupearly_data_test(SSL_CTX **cctx, SSL_CTX **sctx, SSL **clientssl, in setupearly_data_test() argument
3202 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, clientssl, in setupearly_data_test()
3213 && !TEST_true(SSL_set_tlsext_host_name(*clientssl, "localhost"))) in setupearly_data_test()
3217 clientpsk = create_a_psk(*clientssl); in setupearly_data_test()
3247 if (!TEST_true(create_ssl_connection(*serverssl, *clientssl, in setupearly_data_test()
3251 *sess = SSL_get1_session(*clientssl); in setupearly_data_test()
3252 SSL_shutdown(*clientssl); in setupearly_data_test()
3255 SSL_free(*clientssl); in setupearly_data_test()
3256 *serverssl = *clientssl = NULL; in setupearly_data_test()
3259 clientssl, NULL, NULL)) in setupearly_data_test()
3260 || !TEST_true(SSL_set_session(*clientssl, *sess))) in setupearly_data_test()
3269 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_read_write() local
3276 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_read_write()
3281 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_read_write()
3299 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3304 if (!TEST_true(SSL_write_early_data(clientssl, MSG3, strlen(MSG3), in test_early_data_read_write()
3320 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3328 if (!TEST_true(SSL_write_ex(clientssl, MSG5, strlen(MSG5), &written)) in test_early_data_read_write()
3330 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_read_write()
3380 if (!TEST_false(SSL_write_early_data(clientssl, MSG6, strlen(MSG6), in test_early_data_read_write()
3391 if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3400 if (!TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3401 || !TEST_false(SSL_read_ex(clientssl, buf, sizeof(buf), in test_early_data_read_write()
3408 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3413 sess = SSL_get1_session(clientssl); in test_early_data_read_write()
3417 SSL_shutdown(clientssl); in test_early_data_read_write()
3420 SSL_free(clientssl); in test_early_data_read_write()
3421 serverssl = clientssl = NULL; in test_early_data_read_write()
3423 &clientssl, NULL, NULL)) in test_early_data_read_write()
3424 || !TEST_true(SSL_set_session(clientssl, sess))) in test_early_data_read_write()
3428 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_read_write()
3437 if (!TEST_int_gt(SSL_connect(clientssl), 0) in test_early_data_read_write()
3442 if (!TEST_false(SSL_write_early_data(clientssl, MSG6, strlen(MSG6), in test_early_data_read_write()
3453 if (!TEST_true(SSL_write_ex(clientssl, MSG5, strlen(MSG5), &written)) in test_early_data_read_write()
3467 SSL_free(clientssl); in test_early_data_read_write()
3499 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_replay_int() local
3533 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_replay_int()
3541 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3542 || !TEST_true(SSL_session_reused(clientssl))) in test_early_data_replay_int()
3545 SSL_shutdown(clientssl); in test_early_data_replay_int()
3548 SSL_free(clientssl); in test_early_data_replay_int()
3549 serverssl = clientssl = NULL; in test_early_data_replay_int()
3552 &clientssl, NULL, NULL)) in test_early_data_replay_int()
3553 || !TEST_true(SSL_set_session(clientssl, sess))) in test_early_data_replay_int()
3557 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_replay_int()
3583 || !TEST_int_gt(SSL_connect(clientssl), 0) in test_early_data_replay_int()
3593 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3594 || !TEST_int_eq(SSL_session_reused(clientssl), (usecb > 0) ? 1 : 0) in test_early_data_replay_int()
3606 SSL_free(clientssl); in test_early_data_replay_int()
3635 SSL *clientssl = NULL, *serverssl = NULL; in early_data_skip_helper() local
3641 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in early_data_skip_helper()
3675 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in early_data_skip_helper()
3700 if (!TEST_false(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in early_data_skip_helper()
3708 BIO *wbio = SSL_get_wbio(clientssl); in early_data_skip_helper()
3719 if (!TEST_false(SSL_write_ex(clientssl, MSG2, strlen(MSG2), in early_data_skip_helper()
3756 if (!TEST_true(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in early_data_skip_helper()
3758 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in early_data_skip_helper()
3772 SSL_free(clientssl); in early_data_skip_helper()
3822 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_sent() local
3828 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_not_sent()
3833 SSL_set_connect_state(clientssl); in test_early_data_not_sent()
3834 if (!TEST_false(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written))) in test_early_data_not_sent()
3844 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_not_sent()
3849 if (!TEST_true(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)) in test_early_data_not_sent()
3857 if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_early_data_not_sent()
3869 SSL_free(clientssl); in test_early_data_not_sent()
3904 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk() local
3922 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_psk()
3939 || !TEST_true(SSL_set_tlsext_host_name(clientssl, "badhost"))) in test_early_data_psk()
3949 || !TEST_false(SSL_set_alpn_protos(clientssl, BADALPN, in test_early_data_psk()
3981 || !TEST_true(SSL_set_tlsext_host_name(clientssl, "goodhost")) in test_early_data_psk()
4006 || !TEST_false(SSL_set_alpn_protos(clientssl, GOODALPN, in test_early_data_psk()
4024 || !TEST_false(SSL_set_alpn_protos(clientssl, alpnlist, in test_early_data_psk()
4039 SSL_set_connect_state(clientssl); in test_early_data_psk()
4041 if (!TEST_false(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_psk()
4043 || !TEST_int_eq(SSL_get_error(clientssl, 0), SSL_ERROR_SSL) in test_early_data_psk()
4047 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_psk()
4056 || !TEST_int_eq(SSL_connect(clientssl), connectres)) in test_early_data_psk()
4068 SSL_free(clientssl); in test_early_data_psk()
4085 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk_with_all_ciphers() local
4121 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_psk_with_all_ciphers()
4127 SSL_set_security_level(clientssl, 0); in test_early_data_psk_with_all_ciphers()
4131 if (!TEST_true(SSL_set_ciphersuites(clientssl, cipher_str[idx])) in test_early_data_psk_with_all_ciphers()
4142 cipher = SSL_CIPHER_find(clientssl, cipher_bytes[idx]); in test_early_data_psk_with_all_ciphers()
4146 SSL_set_connect_state(clientssl); in test_early_data_psk_with_all_ciphers()
4147 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_psk_with_all_ciphers()
4157 || !TEST_int_eq(SSL_connect(clientssl), 1) in test_early_data_psk_with_all_ciphers()
4162 if (!TEST_true(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in test_early_data_psk_with_all_ciphers()
4176 if (clientssl != NULL) in test_early_data_psk_with_all_ciphers()
4177 SSL_shutdown(clientssl); in test_early_data_psk_with_all_ciphers()
4181 SSL_free(clientssl); in test_early_data_psk_with_all_ciphers()
4194 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_expected() local
4200 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_not_expected()
4205 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_early_data_not_expected()
4214 || !TEST_int_gt(SSL_connect(clientssl), 0) in test_early_data_not_expected()
4218 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_not_expected()
4223 if (!TEST_true(SSL_write_ex(clientssl, MSG2, strlen(MSG2), &written)) in test_early_data_not_expected()
4239 SSL_free(clientssl); in test_early_data_not_expected()
4254 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_tls1_2() local
4259 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_tls1_2()
4264 SSL_set_max_proto_version(clientssl, TLS1_2_VERSION); in test_early_data_tls1_2()
4265 SSL_set_connect_state(clientssl); in test_early_data_tls1_2()
4266 if (!TEST_false(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written))) in test_early_data_tls1_2()
4283 if (!TEST_false(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)) in test_early_data_tls1_2()
4293 if (!TEST_true(SSL_write_ex(clientssl, MSG1, strlen(MSG1), &written)) in test_early_data_tls1_2()
4295 || !TEST_int_eq(SSL_get_early_data_status(clientssl), in test_early_data_tls1_2()
4301 || !SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes) in test_early_data_tls1_2()
4312 SSL_free(clientssl); in test_early_data_tls1_2()
4337 SSL *clientssl = NULL, *serverssl = NULL; in test_set_ciphersuite() local
4366 &clientssl, NULL, NULL))) in test_set_ciphersuite()
4371 if (!TEST_true(SSL_set_cipher_list(clientssl, "AES256-GCM-SHA384"))) in test_set_ciphersuite()
4377 if (!TEST_true(SSL_set_ciphersuites(clientssl, in test_set_ciphersuite()
4382 if (!TEST_true(SSL_set_ciphersuites(clientssl, in test_set_ciphersuite()
4387 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_set_ciphersuite()
4394 SSL_free(clientssl); in test_set_ciphersuite()
4404 SSL *clientssl = NULL, *serverssl = NULL; in test_ciphersuite_change() local
4421 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4423 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4427 clntsess = SSL_get1_session(clientssl); in test_ciphersuite_change()
4430 SSL_shutdown(clientssl); in test_ciphersuite_change()
4433 SSL_free(clientssl); in test_ciphersuite_change()
4434 serverssl = clientssl = NULL; in test_ciphersuite_change()
4440 &clientssl, NULL, NULL)) in test_ciphersuite_change()
4441 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ciphersuite_change()
4442 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4444 || !TEST_true(SSL_session_reused(clientssl))) in test_ciphersuite_change()
4448 clntsess = SSL_get1_session(clientssl); in test_ciphersuite_change()
4449 SSL_shutdown(clientssl); in test_ciphersuite_change()
4452 SSL_free(clientssl); in test_ciphersuite_change()
4453 serverssl = clientssl = NULL; in test_ciphersuite_change()
4460 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4462 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ciphersuite_change()
4463 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4465 || !TEST_false(SSL_session_reused(clientssl))) in test_ciphersuite_change()
4470 SSL_shutdown(clientssl); in test_ciphersuite_change()
4473 SSL_free(clientssl); in test_ciphersuite_change()
4474 serverssl = clientssl = NULL; in test_ciphersuite_change()
4479 &clientssl, NULL, NULL)) in test_ciphersuite_change()
4480 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4484 clntsess = SSL_get1_session(clientssl); in test_ciphersuite_change()
4485 SSL_shutdown(clientssl); in test_ciphersuite_change()
4488 SSL_free(clientssl); in test_ciphersuite_change()
4489 serverssl = clientssl = NULL; in test_ciphersuite_change()
4495 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4497 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ciphersuite_change()
4503 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4516 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4527 SSL_free(clientssl); in test_ciphersuite_change()
4562 SSL *serverssl = NULL, *clientssl = NULL; in test_key_exchange() local
4672 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_exchange()
4677 || !TEST_true(SSL_set1_groups(clientssl, kexch_groups, kexch_groups_size))) in test_key_exchange()
4680 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_key_exchange()
4700 if (!TEST_int_eq(SSL_get_negotiated_group(clientssl), kexch_groups[0])) in test_key_exchange()
4707 SSL_free(clientssl); in test_key_exchange()
4716 static int set_ssl_groups(SSL *serverssl, SSL *clientssl, int clientmulti, in set_ssl_groups() argument
4734 if (!TEST_true(SSL_set1_groups(clientssl, ecdhe_kexch_groups, in set_ssl_groups()
4738 if (!TEST_true(SSL_set1_groups(clientssl, ffdhe_kexch_groups, in set_ssl_groups()
4743 if (!TEST_true(SSL_set1_groups(clientssl, kexch_groups, 1))) in set_ssl_groups()
4786 SSL *serverssl = NULL, *clientssl = NULL; in test_negotiated_group() local
4836 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
4840 if (!TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, isecdhe, in test_negotiated_group()
4844 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_negotiated_group()
4848 if (!TEST_uint_eq(SSL_get_negotiated_group(clientssl), expectednid) in test_negotiated_group()
4852 if (!TEST_ptr((origsess = SSL_get1_session(clientssl)))) in test_negotiated_group()
4855 SSL_shutdown(clientssl); in test_negotiated_group()
4858 SSL_free(clientssl); in test_negotiated_group()
4859 serverssl = clientssl = NULL; in test_negotiated_group()
4862 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
4864 || !TEST_true(SSL_set_session(clientssl, origsess)) in test_negotiated_group()
4865 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
4869 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
4870 || !TEST_true(SSL_session_reused(clientssl))) in test_negotiated_group()
4874 if (!TEST_uint_eq(SSL_get_negotiated_group(clientssl), expectednid) in test_negotiated_group()
4878 SSL_shutdown(clientssl); in test_negotiated_group()
4881 SSL_free(clientssl); in test_negotiated_group()
4882 serverssl = clientssl = NULL; in test_negotiated_group()
4908 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
4910 || !TEST_true(SSL_set_session(clientssl, origsess)) in test_negotiated_group()
4911 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
4915 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
4916 || !TEST_true(SSL_session_reused(clientssl))) in test_negotiated_group()
4920 if (!TEST_uint_eq(SSL_get_negotiated_group(clientssl), expectednid) in test_negotiated_group()
4927 SSL_free(clientssl); in test_negotiated_group()
4945 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_ciphersuite() local
5023 &clientssl, NULL, NULL))) in test_tls13_ciphersuite()
5028 || !TEST_true(SSL_set_ciphersuites(clientssl, t13_cipher))) in test_tls13_ciphersuite()
5032 || !TEST_true(SSL_set_cipher_list(clientssl, in test_tls13_ciphersuite()
5038 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_ciphersuite()
5045 clientssl)); in test_tls13_ciphersuite()
5067 SSL_free(clientssl); in test_tls13_ciphersuite()
5068 clientssl = NULL; in test_tls13_ciphersuite()
5079 SSL_free(clientssl); in test_tls13_ciphersuite()
5095 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_psk() local
5159 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5161 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5163 || !TEST_false(SSL_session_reused(clientssl)) in test_tls13_psk()
5185 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5186 serverssl = clientssl = NULL; in test_tls13_psk()
5190 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5195 cipher = SSL_CIPHER_find(clientssl, TLS13_AES_128_GCM_SHA256_BYTES); in test_tls13_psk()
5209 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5210 || !TEST_true(SSL_session_reused(clientssl)) in test_tls13_psk()
5228 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5229 serverssl = clientssl = NULL; in test_tls13_psk()
5233 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5250 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5251 || !TEST_true(SSL_session_reused(clientssl)) in test_tls13_psk()
5269 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5270 serverssl = clientssl = NULL; in test_tls13_psk()
5280 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5282 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5284 || !TEST_false(SSL_session_reused(clientssl)) in test_tls13_psk()
5306 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5307 serverssl = clientssl = NULL; in test_tls13_psk()
5316 SSL_free(clientssl); in test_tls13_psk()
5365 SSL *serverssl = NULL, *clientssl = NULL; in test_stateless() local
5376 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5379 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5389 SSL_free(clientssl); in test_stateless()
5390 clientssl = NULL; in test_stateless()
5400 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5403 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5410 SSL_free(clientssl); in test_stateless()
5411 clientssl = NULL; in test_stateless()
5417 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5420 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5425 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5430 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_stateless()
5434 shutdown_ssl_connection(serverssl, clientssl); in test_stateless()
5435 serverssl = clientssl = NULL; in test_stateless()
5440 SSL_free(clientssl); in test_stateless()
5580 SSL *clientssl = NULL, *serverssl = NULL; in test_custom_exts() local
5706 &clientssl, NULL, NULL)) in test_custom_exts()
5707 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
5740 sess = SSL_get1_session(clientssl); in test_custom_exts()
5741 SSL_shutdown(clientssl); in test_custom_exts()
5744 SSL_free(clientssl); in test_custom_exts()
5745 serverssl = clientssl = NULL; in test_custom_exts()
5753 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_custom_exts()
5755 || !TEST_true(SSL_set_session(clientssl, sess)) in test_custom_exts()
5756 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
5795 SSL_free(clientssl); in test_custom_exts()
5870 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat() local
5917 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_export_key_mat()
5924 if (!TEST_int_le(SSL_export_keying_material(clientssl, ckeymat1, in test_export_key_mat()
5930 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_export_key_mat()
5939 if (!TEST_int_le(SSL_export_keying_material(clientssl, ckeymat1, in test_export_key_mat()
5953 if (!TEST_int_eq(SSL_export_keying_material(clientssl, ckeymat1, in test_export_key_mat()
5957 || !TEST_int_eq(SSL_export_keying_material(clientssl, ckeymat2, in test_export_key_mat()
5962 || !TEST_int_eq(SSL_export_keying_material(clientssl, ckeymat3, in test_export_key_mat()
6018 SSL_free(clientssl); in test_export_key_mat()
6039 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat_early() local
6047 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, &serverssl, in test_export_key_mat_early()
6052 if (!TEST_true(SSL_write_early_data(clientssl, NULL, 0, &written)) in test_export_key_mat_early()
6061 clientssl, ckeymat1, sizeof(ckeymat1), label, in test_export_key_mat_early()
6064 clientssl, ckeymat2, sizeof(ckeymat2), label, in test_export_key_mat_early()
6097 SSL_free(clientssl); in test_export_key_mat_early()
6111 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update() local
6121 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update()
6123 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update()
6130 if (!TEST_true(SSL_key_update(clientssl, in test_key_update()
6134 || !TEST_true(SSL_do_handshake(clientssl))) in test_key_update()
6139 if (!TEST_int_eq(SSL_write(clientssl, mess, strlen(mess)), strlen(mess)) in test_key_update()
6145 || !TEST_int_eq(SSL_read(clientssl, buf, sizeof(buf)), in test_key_update()
6154 SSL_free(clientssl); in test_key_update()
6170 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_write() local
6184 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_write()
6186 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_write()
6190 peerupdate = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_write()
6191 peerwrite = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_write()
6237 SSL_free(clientssl); in test_key_update_peer_in_write()
6256 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_read() local
6268 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_read()
6270 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_read()
6274 local = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_read()
6275 peer = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_read()
6323 SSL_free(clientssl); in test_key_update_peer_in_read()
6339 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_write() local
6353 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_write()
6355 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_write()
6359 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_write()
6360 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_write()
6412 SSL_free(clientssl); in test_key_update_local_in_write()
6430 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_read() local
6442 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_read()
6444 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_read()
6448 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_read()
6449 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_read()
6497 SSL_free(clientssl); in test_key_update_local_in_read()
6508 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_clear() local
6524 &clientssl, NULL, NULL)) in test_ssl_clear()
6525 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
6529 SSL_shutdown(clientssl); in test_ssl_clear()
6535 if (!TEST_true(SSL_clear(clientssl))) in test_ssl_clear()
6538 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_clear()
6540 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
6542 || !TEST_true(SSL_session_reused(clientssl))) in test_ssl_clear()
6545 SSL_shutdown(clientssl); in test_ssl_clear()
6552 SSL_free(clientssl); in test_ssl_clear()
6675 SSL *clientssl = NULL, *serverssl = NULL; in test_pha_key_update() local
6691 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pha_key_update()
6695 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
6703 if (!TEST_true(SSL_key_update(clientssl, SSL_KEY_UPDATE_NOT_REQUESTED))) in test_pha_key_update()
6711 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
6715 SSL_shutdown(clientssl); in test_pha_key_update()
6722 SSL_free(clientssl); in test_pha_key_update()
6879 SSL *clientssl = NULL, *serverssl = NULL; in test_srp() local
6921 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_srp()
6925 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_srp()
6940 SSL_free(clientssl); in test_srp()
7099 SSL *clientssl = NULL, *serverssl = NULL; in test_info_callback() local
7132 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_info_callback()
7139 SSL_set_info_callback((tst % 2) == 0 ? serverssl : clientssl, in test_info_callback()
7143 if (!TEST_true(SSL_write_early_data(clientssl, MSG1, strlen(MSG1), in test_info_callback()
7152 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7179 &clientssl, NULL, NULL)) in test_info_callback()
7180 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7187 clntsess = SSL_get1_session(clientssl); in test_info_callback()
7188 SSL_shutdown(clientssl); in test_info_callback()
7191 SSL_free(clientssl); in test_info_callback()
7192 serverssl = clientssl = NULL; in test_info_callback()
7195 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_info_callback()
7197 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_info_callback()
7198 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7200 || !TEST_true(SSL_session_reused(clientssl)) in test_info_callback()
7208 SSL_free(clientssl); in test_info_callback()
7218 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_pending() local
7258 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_pending()
7260 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_pending()
7264 if (!TEST_int_eq(SSL_pending(clientssl), 0) in test_ssl_pending()
7265 || !TEST_false(SSL_has_pending(clientssl)) in test_ssl_pending()
7270 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), &readbytes)) in test_ssl_pending()
7272 || !TEST_int_eq(SSL_pending(clientssl), (int)(written - readbytes)) in test_ssl_pending()
7273 || !TEST_true(SSL_has_pending(clientssl))) in test_ssl_pending()
7280 SSL_free(clientssl); in test_ssl_pending()
7375 SSL *clientssl = NULL, *serverssl = NULL; in int_test_ssl_get_shared_ciphers() local
7420 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in int_test_ssl_get_shared_ciphers()
7422 || !TEST_true(create_ssl_connection(serverssl, clientssl, in int_test_ssl_get_shared_ciphers()
7440 SSL_free(clientssl); in int_test_ssl_get_shared_ciphers()
7593 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_callbacks() local
7673 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ticket_callbacks()
7675 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
7692 clntsess = SSL_get1_session(clientssl); in test_ticket_callbacks()
7693 SSL_shutdown(clientssl); in test_ticket_callbacks()
7696 SSL_free(clientssl); in test_ticket_callbacks()
7697 serverssl = clientssl = NULL; in test_ticket_callbacks()
7700 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_ticket_callbacks()
7702 || !TEST_true(SSL_set_session(clientssl, clntsess)) in test_ticket_callbacks()
7703 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
7709 if (!TEST_false(SSL_session_reused(clientssl))) in test_ticket_callbacks()
7712 if (!TEST_true(SSL_session_reused(clientssl))) in test_ticket_callbacks()
7729 SSL_free(clientssl); in test_ticket_callbacks()
7748 SSL *clientssl = NULL, *serverssl = NULL; in test_incorrect_shutdown() local
7761 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_incorrect_shutdown()
7765 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_incorrect_shutdown()
7784 SSL_free(clientssl); in test_incorrect_shutdown()
7807 SSL *clientssl = NULL, *serverssl = NULL; in test_shutdown() local
7834 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_shutdown()
7839 if (!TEST_true(create_bare_ssl_connection(serverssl, clientssl, in test_shutdown()
7841 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
7844 } else if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_shutdown()
7846 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
7851 if (!TEST_int_eq(SSL_shutdown(clientssl), 0)) in test_shutdown()
7886 if (!TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), in test_shutdown()
7890 || !TEST_true(SSL_read_ex(clientssl, buf, sizeof(buf), in test_shutdown()
7899 if (!TEST_false(SSL_write_ex(clientssl, msg, sizeof(msg), &written))) in test_shutdown()
7914 || !TEST_int_eq(SSL_shutdown(clientssl), 1) in test_shutdown()
7915 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
7925 if (!TEST_int_eq(SSL_shutdown(clientssl), 1) in test_shutdown()
7926 || !TEST_ptr_ne(sess = SSL_get_session(clientssl), NULL) in test_shutdown()
7937 if (!TEST_int_eq(SSL_shutdown(clientssl), -1) in test_shutdown()
7938 || !TEST_int_eq(SSL_get_error(clientssl, -1), SSL_ERROR_SSL)) in test_shutdown()
7946 SSL_free(clientssl); in test_shutdown()
8058 SSL *clientssl = NULL, *serverssl = NULL; in test_cert_cb_int() local
8085 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_cert_cb_int()
8094 if (!TEST_true(SSL_set1_sigalgs_list(clientssl, in test_cert_cb_int()
8102 if (!TEST_true(SSL_set1_sigalgs_list(clientssl, in test_cert_cb_int()
8107 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_cert_cb_int()
8118 SSL_free(clientssl); in test_cert_cb_int()
8180 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_cb() local
8209 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_client_cert_cb()
8211 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_cb()
8219 SSL_free(clientssl); in test_client_cert_cb()
8237 SSL *clientssl = NULL, *serverssl = NULL; in test_ca_names_int() local
8292 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ca_names_int()
8294 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ca_names_int()
8321 sktmp = SSL_get0_peer_CA_list(clientssl); in test_ca_names_int()
8334 SSL_free(clientssl); in test_ca_names_int()
8387 SSL *clientssl = NULL, *serverssl = NULL; in test_multiblock_write() local
8422 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multiblock_write()
8431 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_multiblock_write()
8440 if (!TEST_true(SSL_read_ex(clientssl, p, MULTIBLOCK_FRAGSIZE, &readbytes))) in test_multiblock_write()
8451 SSL_free(clientssl); in test_multiblock_write()
8597 SSL *clientssl = NULL, *serverssl = NULL; in test_servername() local
8617 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_servername()
8628 if (!TEST_true(SSL_set_tlsext_host_name(clientssl, "goodhost"))) in test_servername()
8633 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
8636 if (!TEST_str_eq(SSL_get_servername(clientssl, TLSEXT_NAMETYPE_host_name), in test_servername()
8645 if (!TEST_int_eq(SSL_shutdown(clientssl), 0) in test_servername()
8646 || !TEST_ptr_ne(sess = SSL_get1_session(clientssl), NULL) in test_servername()
8651 SSL_free(clientssl); in test_servername()
8653 clientssl = serverssl = NULL; in test_servername()
8655 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_servername()
8659 if (!TEST_true(SSL_set_session(clientssl, sess))) in test_servername()
8665 if (!TEST_true(SSL_set_tlsext_host_name(clientssl, "altgoodhost"))) in test_servername()
8674 if (!TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
8686 if (!TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
8691 if (!TEST_true(SSL_set_tlsext_host_name(clientssl, "goodhost"))) in test_servername()
8705 if (!TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
8711 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
8714 if (!TEST_true(SSL_session_reused(clientssl)) in test_servername()
8716 || !TEST_str_eq(SSL_get_servername(clientssl, in test_servername()
8729 SSL_free(clientssl); in test_servername()
8751 SSL *clientssl = NULL, *serverssl = NULL; in test_sigalgs_available() local
8850 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_sigalgs_available()
8854 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_sigalgs_available()
8874 SSL_free(clientssl); in test_sigalgs_available()
8892 SSL *clientssl = NULL, *serverssl = NULL; in test_pluggable_group() local
8916 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pluggable_group()
8921 || !TEST_true(SSL_set1_groups_list(clientssl, group_name))) in test_pluggable_group()
8924 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pluggable_group()
8935 SSL_free(clientssl); in test_pluggable_group()
8949 SSL *clientssl = NULL, *serverssl = NULL, *client2ssl = NULL; in test_ssl_dup() local
8960 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_dup()
8964 if (!TEST_true(SSL_set_min_proto_version(clientssl, TLS1_2_VERSION)) in test_ssl_dup()
8965 || !TEST_true(SSL_set_max_proto_version(clientssl, TLS1_2_VERSION))) in test_ssl_dup()
8968 client2ssl = SSL_dup(clientssl); in test_ssl_dup()
8969 rbio = SSL_get_rbio(clientssl); in test_ssl_dup()
8976 wbio = SSL_get_wbio(clientssl); in test_ssl_dup()
8984 || !TEST_ptr_ne(clientssl, client2ssl)) in test_ssl_dup()
8994 SSL_free(clientssl); in test_ssl_dup()
8995 clientssl = SSL_dup(client2ssl); in test_ssl_dup()
8996 if (!TEST_ptr(clientssl) in test_ssl_dup()
8998 || !TEST_ptr_eq(clientssl, client2ssl)) in test_ssl_dup()
9005 SSL_free(clientssl); in test_ssl_dup()
9112 SSL *clientssl = NULL, *serverssl = NULL; in test_set_tmp_dh() local
9164 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_set_tmp_dh()
9195 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_tmp_dh()
9206 SSL_free(clientssl); in test_set_tmp_dh()
9221 SSL *clientssl = NULL, *serverssl = NULL; in test_dh_auto() local
9291 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_dh_auto()
9299 || !TEST_true(SSL_set_cipher_list(clientssl, ciphersuite))) in test_dh_auto()
9307 if (!TEST_int_le(SSL_connect(clientssl), 0) in test_dh_auto()
9316 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_dh_auto()
9323 SSL_free(clientssl); in test_dh_auto()
9343 SSL *clientssl = NULL, *serverssl = NULL; in test_sni_tls13() local
9369 &clientssl, NULL, NULL)) in test_sni_tls13()
9370 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_sni_tls13()
9382 SSL_free(clientssl); in test_sni_tls13()