Lines Matching refs:serverssl

351     SSL *clientssl = NULL, *serverssl = NULL;  in test_keylog()  local
390 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_keylog()
392 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog()
412 if (!TEST_true(test_keylog_output(server_log_buffer, serverssl, in test_keylog()
413 SSL_get_session(serverssl), &expected))) in test_keylog()
419 SSL_free(serverssl); in test_keylog()
432 SSL *clientssl = NULL, *serverssl = NULL; in test_keylog_no_master_key() local
469 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_keylog_no_master_key()
471 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog_no_master_key()
488 || !TEST_true(test_keylog_output(server_log_buffer, serverssl, in test_keylog_no_master_key()
489 SSL_get_session(serverssl), in test_keylog_no_master_key()
496 SSL_shutdown(serverssl); in test_keylog_no_master_key()
497 SSL_free(serverssl); in test_keylog_no_master_key()
499 serverssl = clientssl = NULL; in test_keylog_no_master_key()
507 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_keylog_no_master_key()
512 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_keylog_no_master_key()
515 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_keylog_no_master_key()
517 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_keylog_no_master_key()
527 || !TEST_true(test_keylog_output(server_log_buffer, serverssl, in test_keylog_no_master_key()
528 SSL_get_session(serverssl), in test_keylog_no_master_key()
536 SSL_free(serverssl); in test_keylog_no_master_key()
575 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_verify_cb() local
591 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_client_cert_verify_cb()
596 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_client_cert_verify_cb()
614 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_verify_cb()
627 if (serverssl != NULL) { in test_client_cert_verify_cb()
628 SSL_shutdown(serverssl); in test_client_cert_verify_cb()
629 SSL_free(serverssl); in test_client_cert_verify_cb()
755 SSL *clientssl = NULL, *serverssl = NULL; in test_client_hello_cb() local
769 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_client_hello_cb()
771 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_client_hello_cb()
777 || !TEST_int_eq(SSL_get_error(serverssl, -1), in test_client_hello_cb()
779 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_hello_cb()
786 SSL_free(serverssl); 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 if (!create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) { in test_no_ems()
819 if (SSL_get_extms_support(serverssl)) { in test_no_ems()
831 SSL_free(serverssl); in test_no_ems()
848 SSL *clientssl = NULL, *serverssl = NULL; in test_ccs_change_cipher() local
864 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
867 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
869 || !TEST_ptr(sesspre = SSL_get0_session(serverssl)) in test_ccs_change_cipher()
873 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
874 serverssl = clientssl = NULL; in test_ccs_change_cipher()
878 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
882 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
885 || !TEST_true(SSL_session_reused(serverssl)) in test_ccs_change_cipher()
886 || !TEST_ptr(sesspost = SSL_get0_session(serverssl)) in test_ccs_change_cipher()
891 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
892 serverssl = clientssl = NULL; in test_ccs_change_cipher()
898 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
901 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ccs_change_cipher()
903 || !TEST_ptr(sesspre = SSL_get0_session(serverssl)) in test_ccs_change_cipher()
917 if (SSL_read_ex(serverssl, &buf, sizeof(buf), &readbytes) > 0) { in test_ccs_change_cipher()
920 } else if (!TEST_int_eq(SSL_get_error(serverssl, 0), in test_ccs_change_cipher()
928 || !TEST_false(SSL_session_reused(serverssl)) in test_ccs_change_cipher()
929 || !TEST_ptr(sesspost = SSL_get0_session(serverssl)) in test_ccs_change_cipher()
935 shutdown_ssl_connection(serverssl, clientssl); in test_ccs_change_cipher()
936 serverssl = clientssl = NULL; in test_ccs_change_cipher()
941 SSL_free(serverssl); in test_ccs_change_cipher()
1002 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_large_message() local
1034 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_test_large_message()
1036 || !TEST_true(create_ssl_connection(serverssl, clientssl, in execute_test_large_message()
1044 if (!TEST_true(SSL_clear(serverssl))) in execute_test_large_message()
1049 SSL_free(serverssl); in execute_test_large_message()
1067 static int ping_pong_query(SSL *clientssl, SSL *serverssl) in ping_pong_query() argument
1085 memcpy(srec_wseq_before, &serverssl->rlayer.write_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1086 memcpy(srec_rseq_before, &serverssl->rlayer.read_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1091 while ((err = SSL_read(serverssl, &sbuf, sizeof(sbuf))) != sizeof(sbuf)) { in ping_pong_query()
1092 if (SSL_get_error(serverssl, err) != SSL_ERROR_WANT_READ) { in ping_pong_query()
1097 if (!TEST_true(SSL_write(serverssl, sbuf, sizeof(sbuf)) == sizeof(sbuf))) in ping_pong_query()
1108 memcpy(srec_wseq_after, &serverssl->rlayer.write_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1109 memcpy(srec_rseq_after, &serverssl->rlayer.read_sequence, SEQ_NUM_SIZE); in ping_pong_query()
1129 if (!BIO_get_ktls_send(serverssl->wbio)) { in ping_pong_query()
1149 if (!BIO_get_ktls_recv(serverssl->wbio)) { in ping_pong_query()
1168 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_ktls() local
1204 if (!TEST_true(create_ssl_objects2(sctx, cctx, &serverssl, in execute_test_ktls()
1214 if (!TEST_true(SSL_set_options(serverssl, SSL_OP_ENABLE_KTLS))) in execute_test_ktls()
1218 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in execute_test_ktls()
1235 if (!TEST_false(BIO_get_ktls_send(serverssl->wbio))) in execute_test_ktls()
1238 if (BIO_get_ktls_send(serverssl->wbio)) in execute_test_ktls()
1256 if (!TEST_false(BIO_get_ktls_recv(serverssl->rbio))) in execute_test_ktls()
1259 if (BIO_get_ktls_send(serverssl->rbio)) in execute_test_ktls()
1270 if (!TEST_true(ping_pong_query(clientssl, serverssl))) in execute_test_ktls()
1279 if (serverssl) { in execute_test_ktls()
1280 SSL_shutdown(serverssl); in execute_test_ktls()
1281 SSL_free(serverssl); in execute_test_ktls()
1285 serverssl = clientssl = NULL; in execute_test_ktls()
1300 SSL *clientssl = NULL, *serverssl = NULL; in execute_test_ktls_sendfile() local
1343 if (!TEST_true(create_ssl_objects2(sctx, cctx, &serverssl, in execute_test_ktls_sendfile()
1347 if (!TEST_true(SSL_set_options(serverssl, SSL_OP_ENABLE_KTLS))) in execute_test_ktls_sendfile()
1350 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in execute_test_ktls_sendfile()
1354 if (!BIO_get_ktls_send(serverssl->wbio)) { in execute_test_ktls_sendfile()
1379 while ((err = SSL_sendfile(serverssl, in execute_test_ktls_sendfile()
1384 if (SSL_get_error(serverssl, err) != SSL_ERROR_WANT_WRITE) in execute_test_ktls_sendfile()
1410 if (serverssl) { in execute_test_ktls_sendfile()
1411 SSL_shutdown(serverssl); in execute_test_ktls_sendfile()
1412 SSL_free(serverssl); in execute_test_ktls_sendfile()
1416 serverssl = clientssl = NULL; in execute_test_ktls_sendfile()
1534 SSL *clientssl = NULL, *serverssl = NULL; in test_large_app_data() local
1633 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_large_app_data()
1639 if (!TEST_true(SSL_set_options(serverssl, in test_large_app_data()
1651 if (!TEST_true(SSL_set_options(serverssl, SSL_OP_NO_ENCRYPT_THEN_MAC)) in test_large_app_data()
1657 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_large_app_data()
1666 if (!TEST_true(SSL_read_ex(serverssl, buf, SSL3_RT_MAX_PLAIN_LENGTH + 1, in test_large_app_data()
1677 SSL_free(serverssl); in test_large_app_data()
1692 SSL *clientssl = NULL, *serverssl = NULL; in execute_cleanse_plaintext() local
1725 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_cleanse_plaintext()
1729 if (!TEST_true(SSL_set_options(serverssl, SSL_OP_CLEANSE_PLAINTEXT))) in execute_cleanse_plaintext()
1732 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in execute_cleanse_plaintext()
1743 if (!TEST_int_eq(SSL_peek(serverssl, &sbuf, sizeof(sbuf)), sizeof(sbuf))) in execute_cleanse_plaintext()
1754 rr = serverssl->rlayer.rrec; in execute_cleanse_plaintext()
1767 if (!TEST_int_eq(SSL_read(serverssl, &sbuf, sizeof(sbuf)), sizeof(sbuf))) in execute_cleanse_plaintext()
1780 SSL_free(serverssl); in execute_cleanse_plaintext()
1875 SSL *clientssl = NULL, *serverssl = NULL; in test_tlsext_status_type() local
1920 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tlsext_status_type()
1922 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1927 SSL_free(serverssl); in test_tlsext_status_type()
1929 serverssl = NULL; in test_tlsext_status_type()
1936 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tlsext_status_type()
1939 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1944 SSL_free(serverssl); in test_tlsext_status_type()
1946 serverssl = NULL; in test_tlsext_status_type()
1956 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tlsext_status_type()
1980 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tlsext_status_type()
1989 SSL_free(serverssl); in test_tlsext_status_type()
2466 SSL *serverssl = NULL, *clientssl = NULL; in check_resumption() local
2472 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in check_resumption()
2479 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in check_resumption()
2500 && (!post_handshake_verify(serverssl, clientssl) in check_resumption()
2505 SSL_shutdown(serverssl); in check_resumption()
2506 SSL_free(serverssl); in check_resumption()
2508 serverssl = clientssl = NULL; in check_resumption()
2517 SSL_free(serverssl); in check_resumption()
2524 SSL *serverssl = NULL, *clientssl = NULL; in test_tickets() local
2536 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tickets()
2540 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2547 SSL_shutdown(serverssl); in test_tickets()
2548 SSL_free(serverssl); in test_tickets()
2552 clientssl = serverssl = NULL; in test_tickets()
2580 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tickets()
2586 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2593 if (!post_handshake_verify(serverssl, clientssl) in test_tickets()
2598 SSL_shutdown(serverssl); in test_tickets()
2599 SSL_free(serverssl); in test_tickets()
2601 serverssl = clientssl = NULL; in test_tickets()
2616 SSL_free(serverssl); in test_tickets()
2641 SSL *serverssl = NULL, *clientssl = NULL; in test_psk_tickets() local
2663 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_psk_tickets()
2671 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_psk_tickets()
2682 SSL_free(serverssl); in test_psk_tickets()
2696 SSL *serverssl = NULL, *clientssl = NULL; in test_extra_tickets() local
2718 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_extra_tickets()
2726 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_extra_tickets()
2730 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2731 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2737 if (!TEST_true(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2750 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2751 || !TEST_true(SSL_write_ex(serverssl, &c, sizeof(c), &nbytes)) in test_extra_tickets()
2763 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2764 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2765 || !TEST_true(SSL_write_ex(serverssl, &c, 0, &nbytes)) in test_extra_tickets()
2775 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2776 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2777 || !TEST_true(SSL_do_handshake(serverssl)) in test_extra_tickets()
2789 tmp = SSL_get_wbio(serverssl); in test_extra_tickets()
2794 SSL_set0_wbio(serverssl, bretry); in test_extra_tickets()
2796 if (!TEST_false(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2797 || !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_WANT_WRITE) in test_extra_tickets()
2801 SSL_set0_wbio(serverssl, tmp); in test_extra_tickets()
2807 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2808 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2810 || !TEST_true(SSL_do_handshake(serverssl)) in test_extra_tickets()
2814 if (!TEST_true(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2824 if (!TEST_true(SSL_do_handshake(serverssl)) in test_extra_tickets()
2829 if (!TEST_true(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2840 SSL_shutdown(serverssl); in test_extra_tickets()
2846 SSL_free(serverssl); in test_extra_tickets()
2850 clientssl = serverssl = NULL; in test_extra_tickets()
2910 SSL *serverssl = NULL, *clientssl = NULL; in test_ssl_set_bio() local
2949 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_set_bio()
2986 && !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_set_bio()
3021 SSL_free(serverssl); in test_ssl_set_bio()
3145 SSL *clientssl = NULL, *serverssl = NULL; in test_set_sigalgs() local
3186 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_set_sigalgs()
3208 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_sigalgs()
3216 SSL_free(serverssl); in test_set_sigalgs()
3403 SSL **serverssl, SSL_SESSION **sess, int idx, in setupearly_data_test() argument
3429 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, clientssl, in setupearly_data_test()
3474 if (!TEST_true(create_ssl_connection(*serverssl, *clientssl, in setupearly_data_test()
3480 SSL_shutdown(*serverssl); in setupearly_data_test()
3481 SSL_free(*serverssl); in setupearly_data_test()
3483 *serverssl = *clientssl = NULL; in setupearly_data_test()
3485 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, in setupearly_data_test()
3496 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_read_write() local
3504 &serverssl, &sess, idx, in test_early_data_read_write()
3512 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, in test_early_data_read_write()
3516 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_read_write()
3524 if (!TEST_true(SSL_write_early_data(serverssl, MSG2, strlen(MSG2), in test_early_data_read_write()
3538 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3545 if (!TEST_true(SSL_write_early_data(serverssl, MSG4, strlen(MSG4), in test_early_data_read_write()
3568 rbio = SSL_get_rbio(serverssl); in test_early_data_read_write()
3581 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3591 if (!TEST_true(SSL_write_early_data(serverssl, MSG6, strlen(MSG6), in test_early_data_read_write()
3603 if (!TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3612 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3634 if (!TEST_true(SSL_write_ex(serverssl, MSG7, strlen(MSG7), &written)) in test_early_data_read_write()
3646 SSL_shutdown(serverssl); in test_early_data_read_write()
3647 SSL_free(serverssl); in test_early_data_read_write()
3649 serverssl = clientssl = NULL; in test_early_data_read_write()
3650 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_early_data_read_write()
3659 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3666 || !TEST_int_gt(SSL_accept(serverssl), 0)) in test_early_data_read_write()
3674 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3683 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3694 SSL_free(serverssl); in test_early_data_read_write()
3727 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_replay_int() local
3762 &serverssl, &sess, idx, in test_early_data_replay_int()
3770 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3775 SSL_shutdown(serverssl); in test_early_data_replay_int()
3776 SSL_free(serverssl); in test_early_data_replay_int()
3778 serverssl = clientssl = NULL; in test_early_data_replay_int()
3780 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_early_data_replay_int()
3792 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_replay_int()
3799 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_replay_int()
3804 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_replay_int()
3813 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_replay_int()
3816 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_replay_int()
3822 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3834 SSL_free(serverssl); in test_early_data_replay_int()
3874 SSL *clientssl = NULL, *serverssl = NULL; in early_data_skip_helper() local
3899 &serverssl, &sess, idx, in early_data_skip_helper()
3907 if (!TEST_true(SSL_set1_groups_list(serverssl, "ffdhe3072"))) in early_data_skip_helper()
3910 if (!TEST_true(SSL_set1_groups_list(serverssl, "P-256"))) in early_data_skip_helper()
3930 && !TEST_true(SSL_set_recv_max_early_data(serverssl, 0))) in early_data_skip_helper()
3940 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in early_data_skip_helper()
3944 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in early_data_skip_helper()
3960 || !TEST_false(SSL_read_ex(serverssl, buf, sizeof(buf), in early_data_skip_helper()
3998 if (!TEST_false(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in early_data_skip_helper()
3999 || !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_SSL)) in early_data_skip_helper()
4020 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in early_data_skip_helper()
4038 SSL_free(serverssl); in early_data_skip_helper()
4097 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_sent() local
4104 &serverssl, &sess, idx, in test_early_data_not_sent()
4114 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_not_sent()
4118 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_not_sent()
4127 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_not_sent()
4129 || !SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written) in test_early_data_not_sent()
4144 SSL_free(serverssl); in test_early_data_not_sent()
4180 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk() local
4199 &serverssl, &sess, 2, in test_early_data_psk()
4328 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_psk()
4332 || !TEST_int_eq(SSL_get_early_data_status(serverssl), edstatus) in test_early_data_psk()
4344 SSL_free(serverssl); in test_early_data_psk()
4362 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk_with_all_ciphers() local
4399 &serverssl, &sess, 2, in test_early_data_psk_with_all_ciphers()
4404 || !TEST_true(SSL_set_ciphersuites(serverssl, cipher_str[idx]))) in test_early_data_psk_with_all_ciphers()
4423 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_psk_with_all_ciphers()
4427 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_psk_with_all_ciphers()
4430 || !TEST_int_eq(SSL_accept(serverssl), 1)) in test_early_data_psk_with_all_ciphers()
4438 if (!TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_psk_with_all_ciphers()
4450 if (serverssl != NULL) in test_early_data_psk_with_all_ciphers()
4451 SSL_shutdown(serverssl); in test_early_data_psk_with_all_ciphers()
4452 SSL_free(serverssl); in test_early_data_psk_with_all_ciphers()
4466 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_expected() local
4473 &serverssl, &sess, idx, in test_early_data_not_expected()
4486 if (!TEST_int_le(SSL_accept(serverssl), 0) in test_early_data_not_expected()
4488 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_not_expected()
4490 || !TEST_int_gt(SSL_accept(serverssl), 0) in test_early_data_not_expected()
4500 if (!TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_not_expected()
4511 SSL_free(serverssl); in test_early_data_not_expected()
4527 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_tls1_2() local
4533 &serverssl, NULL, idx, in test_early_data_tls1_2()
4548 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_tls1_2()
4558 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_tls1_2()
4562 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_tls1_2()
4571 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_tls1_2()
4573 || !TEST_true(SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written)) in test_early_data_tls1_2()
4585 SSL_free(serverssl); in test_early_data_tls1_2()
4611 SSL *clientssl = NULL, *serverssl = NULL; in test_set_ciphersuite() local
4639 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_set_ciphersuite()
4661 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_set_ciphersuite()
4667 SSL_free(serverssl); in test_set_ciphersuite()
4678 SSL *clientssl = NULL, *serverssl = NULL; in test_ciphersuite_change() local
4693 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4695 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4703 SSL_shutdown(serverssl); in test_ciphersuite_change()
4704 SSL_free(serverssl); in test_ciphersuite_change()
4706 serverssl = clientssl = NULL; in test_ciphersuite_change()
4711 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4714 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4722 SSL_shutdown(serverssl); in test_ciphersuite_change()
4723 SSL_free(serverssl); in test_ciphersuite_change()
4725 serverssl = clientssl = NULL; in test_ciphersuite_change()
4732 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4735 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4743 SSL_shutdown(serverssl); in test_ciphersuite_change()
4744 SSL_free(serverssl); in test_ciphersuite_change()
4746 serverssl = clientssl = NULL; in test_ciphersuite_change()
4750 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4752 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4758 SSL_shutdown(serverssl); in test_ciphersuite_change()
4759 SSL_free(serverssl); in test_ciphersuite_change()
4761 serverssl = clientssl = NULL; in test_ciphersuite_change()
4767 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4775 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4788 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4798 SSL_free(serverssl); in test_ciphersuite_change()
4834 SSL *serverssl = NULL, *clientssl = NULL; in test_key_exchange() local
4944 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_exchange()
4948 if (!TEST_true(SSL_set1_groups(serverssl, kexch_groups, kexch_groups_size)) in test_key_exchange()
4952 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_key_exchange()
4960 if (!TEST_int_eq(SSL_get_shared_group(serverssl, 0), in test_key_exchange()
4964 if (!TEST_str_eq(SSL_group_to_name(serverssl, kexch_groups[0]), in test_key_exchange()
4970 if (!TEST_int_eq(SSL_get_negotiated_group(serverssl), kexch_groups[0])) in test_key_exchange()
4978 SSL_free(serverssl); in test_key_exchange()
4988 static int set_ssl_groups(SSL *serverssl, SSL *clientssl, int clientmulti, in set_ssl_groups() argument
5003 if (!TEST_true(SSL_set1_groups(serverssl, kexch_groups, 1))) in set_ssl_groups()
5018 if (!TEST_true(SSL_set1_groups(serverssl, ecdhe_kexch_groups, in set_ssl_groups()
5022 if (!TEST_true(SSL_set1_groups(serverssl, ffdhe_kexch_groups, in set_ssl_groups()
5058 SSL *serverssl = NULL, *clientssl = NULL; in test_negotiated_group() local
5108 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5112 if (!TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, isecdhe, in test_negotiated_group()
5116 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_negotiated_group()
5121 || !TEST_uint_eq(SSL_get_negotiated_group(serverssl), expectednid)) in test_negotiated_group()
5128 SSL_shutdown(serverssl); in test_negotiated_group()
5129 SSL_free(serverssl); in test_negotiated_group()
5131 serverssl = clientssl = NULL; in test_negotiated_group()
5134 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5137 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
5141 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
5147 || !TEST_uint_eq(SSL_get_negotiated_group(serverssl), expectednid)) in test_negotiated_group()
5151 SSL_shutdown(serverssl); in test_negotiated_group()
5152 SSL_free(serverssl); in test_negotiated_group()
5154 serverssl = clientssl = NULL; in test_negotiated_group()
5180 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5183 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
5187 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
5193 || !TEST_uint_eq(SSL_get_negotiated_group(serverssl), expectednid)) in test_negotiated_group()
5198 SSL_free(serverssl); in test_negotiated_group()
5217 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_ciphersuite() local
5286 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tls13_ciphersuite()
5291 if (!TEST_true(SSL_set_ciphersuites(serverssl, t13_cipher)) in test_tls13_ciphersuite()
5295 if (!TEST_true(SSL_set_cipher_list(serverssl, t12_cipher)) in test_tls13_ciphersuite()
5302 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_ciphersuite()
5307 serverssl)); in test_tls13_ciphersuite()
5329 SSL_free(serverssl); in test_tls13_ciphersuite()
5330 serverssl = NULL; in test_tls13_ciphersuite()
5342 SSL_free(serverssl); in test_tls13_ciphersuite()
5359 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_psk() local
5423 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5425 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5428 || !TEST_false(SSL_session_reused(serverssl))) in test_tls13_psk()
5449 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5450 serverssl = clientssl = NULL; in test_tls13_psk()
5454 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5473 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5475 || !TEST_true(SSL_session_reused(serverssl))) in test_tls13_psk()
5492 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5493 serverssl = clientssl = NULL; in test_tls13_psk()
5497 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5503 if (!TEST_true(SSL_set1_groups_list(serverssl, "ffdhe3072"))) in test_tls13_psk()
5506 if (!TEST_true(SSL_set1_groups_list(serverssl, "P-256"))) in test_tls13_psk()
5514 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5516 || !TEST_true(SSL_session_reused(serverssl))) in test_tls13_psk()
5533 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5534 serverssl = clientssl = NULL; in test_tls13_psk()
5544 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5546 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5549 || !TEST_false(SSL_session_reused(serverssl))) in test_tls13_psk()
5570 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5571 serverssl = clientssl = NULL; in test_tls13_psk()
5579 SSL_free(serverssl); in test_tls13_psk()
5629 SSL *serverssl = NULL, *clientssl = NULL; in test_stateless() local
5640 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5643 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5649 || !TEST_int_eq(SSL_stateless(serverssl), -1)) in test_stateless()
5664 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5667 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5670 || !TEST_int_eq(SSL_stateless(serverssl), 0)) in test_stateless()
5681 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5684 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5687 || !TEST_int_eq(SSL_stateless(serverssl), 0) in test_stateless()
5689 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5692 || !TEST_int_eq(SSL_stateless(serverssl), 1) in test_stateless()
5694 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_stateless()
5698 shutdown_ssl_connection(serverssl, clientssl); in test_stateless()
5699 serverssl = clientssl = NULL; in test_stateless()
5703 SSL_free(serverssl); in test_stateless()
5844 SSL *clientssl = NULL, *serverssl = NULL; in test_custom_exts() local
5969 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_custom_exts()
5971 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
6006 SSL_shutdown(serverssl); in test_custom_exts()
6007 SSL_free(serverssl); in test_custom_exts()
6009 serverssl = clientssl = NULL; in test_custom_exts()
6017 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_custom_exts()
6020 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
6058 SSL_free(serverssl); in test_custom_exts()
6114 SSL *clientssl = NULL, *serverssl = NULL; in test_serverinfo_custom() local
6177 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_serverinfo_custom()
6179 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_serverinfo_custom()
6190 SSL_free(serverssl); in test_serverinfo_custom()
6210 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat() local
6257 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_export_key_mat()
6270 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_export_key_mat()
6306 || !TEST_int_eq(SSL_export_keying_material(serverssl, skeymat1, in test_export_key_mat()
6312 || !TEST_int_eq(SSL_export_keying_material(serverssl, skeymat2, in test_export_key_mat()
6317 || !TEST_int_eq(SSL_export_keying_material(serverssl, skeymat3, in test_export_key_mat()
6357 SSL_free(serverssl); in test_export_key_mat()
6379 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat_early() local
6387 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, &serverssl, in test_export_key_mat_early()
6393 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_export_key_mat_early()
6396 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_export_key_mat_early()
6407 serverssl, skeymat1, sizeof(skeymat1), label, in test_export_key_mat_early()
6410 serverssl, skeymat2, sizeof(skeymat2), label, in test_export_key_mat_early()
6436 SSL_free(serverssl); in test_export_key_mat_early()
6451 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update() local
6461 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update()
6463 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update()
6480 || !TEST_int_eq(SSL_read(serverssl, buf, sizeof(buf)), in test_key_update()
6484 if (!TEST_int_eq(SSL_write(serverssl, mess, strlen(mess)), strlen(mess)) in test_key_update()
6493 SSL_free(serverssl); in test_key_update()
6510 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_write() local
6524 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_write()
6526 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_write()
6530 peerupdate = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_write()
6531 peerwrite = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_write()
6576 SSL_free(serverssl); in test_key_update_peer_in_write()
6596 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_read() local
6608 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_read()
6610 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_read()
6614 local = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_read()
6615 peer = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_read()
6662 SSL_free(serverssl); in test_key_update_peer_in_read()
6679 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_write() local
6693 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_write()
6695 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_write()
6699 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_write()
6700 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_write()
6751 SSL_free(serverssl); in test_key_update_local_in_write()
6770 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_read() local
6782 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_read()
6784 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_read()
6788 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_read()
6789 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_read()
6836 SSL_free(serverssl); in test_key_update_local_in_read()
6848 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_clear() local
6863 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ssl_clear()
6865 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
6870 SSL_shutdown(serverssl); in test_ssl_clear()
6871 SSL_free(serverssl); in test_ssl_clear()
6872 serverssl = NULL; in test_ssl_clear()
6878 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_clear()
6880 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
6886 SSL_shutdown(serverssl); in test_ssl_clear()
6891 SSL_free(serverssl); in test_ssl_clear()
7015 SSL *clientssl = NULL, *serverssl = NULL; in test_pha_key_update() local
7031 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pha_key_update()
7035 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
7039 SSL_set_verify(serverssl, SSL_VERIFY_PEER, NULL); in test_pha_key_update()
7040 if (!TEST_true(SSL_verify_client_post_handshake(serverssl))) in test_pha_key_update()
7047 if (!TEST_int_eq(SSL_do_handshake(serverssl), 1)) in test_pha_key_update()
7051 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
7056 SSL_shutdown(serverssl); in test_pha_key_update()
7061 SSL_free(serverssl); in test_pha_key_update()
7219 SSL *clientssl = NULL, *serverssl = NULL; in test_srp() local
7261 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_srp()
7265 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_srp()
7279 SSL_free(serverssl); in test_srp()
7439 SSL *clientssl = NULL, *serverssl = NULL; in test_info_callback() local
7473 &serverssl, &sess, 0, in test_info_callback()
7480 SSL_set_info_callback((tst % 2) == 0 ? serverssl : clientssl, in test_info_callback()
7487 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, in test_info_callback()
7491 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_info_callback()
7493 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7519 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_info_callback()
7521 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7530 SSL_shutdown(serverssl); in test_info_callback()
7531 SSL_free(serverssl); in test_info_callback()
7533 serverssl = clientssl = NULL; in test_info_callback()
7536 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_info_callback()
7539 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7548 SSL_free(serverssl); in test_info_callback()
7559 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_pending() local
7599 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_pending()
7601 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_pending()
7607 || !TEST_int_eq(SSL_pending(serverssl), 0) in test_ssl_pending()
7608 || !TEST_false(SSL_has_pending(serverssl)) in test_ssl_pending()
7609 || !TEST_true(SSL_write_ex(serverssl, msg, sizeof(msg), &written)) in test_ssl_pending()
7620 SSL_free(serverssl); in test_ssl_pending()
7716 SSL *clientssl = NULL, *serverssl = NULL; in int_test_ssl_get_shared_ciphers() local
7761 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in int_test_ssl_get_shared_ciphers()
7763 || !TEST_true(create_ssl_connection(serverssl, clientssl, in int_test_ssl_get_shared_ciphers()
7767 if (!TEST_ptr(SSL_get_shared_ciphers(serverssl, buf, sizeof(buf))) in int_test_ssl_get_shared_ciphers()
7780 SSL_free(serverssl); in int_test_ssl_get_shared_ciphers()
7959 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_callbacks() local
8042 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ticket_callbacks()
8044 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
8063 SSL_shutdown(serverssl); in test_ticket_callbacks()
8064 SSL_free(serverssl); in test_ticket_callbacks()
8066 serverssl = clientssl = NULL; in test_ticket_callbacks()
8069 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_ticket_callbacks()
8072 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
8099 SSL_free(serverssl); in test_ticket_callbacks()
8119 SSL *clientssl = NULL, *serverssl = NULL; in test_incorrect_shutdown() local
8132 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_incorrect_shutdown()
8136 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_incorrect_shutdown()
8140 c2s = SSL_get_rbio(serverssl); in test_incorrect_shutdown()
8143 if (!TEST_false(SSL_read(serverssl, buf, sizeof(buf)))) in test_incorrect_shutdown()
8146 if (tst == 0 && !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_SSL) ) in test_incorrect_shutdown()
8148 if (tst == 1 && !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_ZERO_RETURN) ) in test_incorrect_shutdown()
8154 SSL_free(serverssl); in test_incorrect_shutdown()
8178 SSL *clientssl = NULL, *serverssl = NULL; in test_shutdown() local
8205 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_shutdown()
8210 if (!TEST_true(create_bare_ssl_connection(serverssl, clientssl, in test_shutdown()
8215 } else if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_shutdown()
8230 if (!TEST_false(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_shutdown()
8231 || !TEST_int_eq(SSL_get_error(serverssl, 0), in test_shutdown()
8233 || !TEST_int_eq(SSL_get_shutdown(serverssl), in test_shutdown()
8239 || !TEST_true(SSL_write(serverssl, msg, sizeof(msg)))) in test_shutdown()
8242 && !TEST_true(SSL_key_update(serverssl, in test_shutdown()
8246 SSL_set_verify(serverssl, SSL_VERIFY_PEER, NULL); in test_shutdown()
8247 if (!TEST_true(SSL_verify_client_post_handshake(serverssl))) in test_shutdown()
8251 && !TEST_true(SSL_write(serverssl, msg, sizeof(msg)))) in test_shutdown()
8253 if (!TEST_int_eq(SSL_shutdown(serverssl), 1)) in test_shutdown()
8279 if (!TEST_int_eq(SSL_shutdown(serverssl), 0) in test_shutdown()
8284 || !TEST_false(SSL_write_ex(serverssl, msg, sizeof(msg), &written)) in test_shutdown()
8288 || !TEST_int_eq(SSL_shutdown(serverssl), 1)) in test_shutdown()
8316 SSL_free(serverssl); in test_shutdown()
8429 SSL *clientssl = NULL, *serverssl = NULL; in test_cert_cb_int() local
8460 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_cert_cb_int()
8482 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_cert_cb_int()
8492 SSL_free(serverssl); in test_cert_cb_int()
8555 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_cb() local
8584 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_client_cert_cb()
8586 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_cb()
8593 SSL_free(serverssl); in test_client_cert_cb()
8612 SSL *clientssl = NULL, *serverssl = NULL; in test_ca_names_int() local
8667 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ca_names_int()
8669 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ca_names_int()
8677 sktmp = SSL_get0_peer_CA_list(serverssl); in test_ca_names_int()
8708 SSL_free(serverssl); in test_ca_names_int()
8762 SSL *clientssl = NULL, *serverssl = NULL; in test_multiblock_write() local
8797 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multiblock_write()
8802 SSL_set_options(serverssl, SSL_OP_NO_ENCRYPT_THEN_MAC); in test_multiblock_write()
8806 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_multiblock_write()
8809 if (!TEST_true(SSL_write_ex(serverssl, msg, sizeof(msg), &written)) in test_multiblock_write()
8825 SSL_free(serverssl); in test_multiblock_write()
8972 SSL *clientssl = NULL, *serverssl = NULL; in test_servername() local
8992 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_servername()
9008 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
9013 || !TEST_str_eq(SSL_get_servername(serverssl, in test_servername()
9023 || !TEST_int_eq(SSL_shutdown(serverssl), 0)) in test_servername()
9027 SSL_free(serverssl); in test_servername()
9028 clientssl = serverssl = NULL; in test_servername()
9030 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_servername()
9086 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
9090 || !TEST_true(SSL_session_reused(serverssl)) in test_servername()
9094 || !TEST_str_eq(SSL_get_servername(serverssl, in test_servername()
9103 SSL_free(serverssl); in test_servername()
9126 SSL *clientssl = NULL, *serverssl = NULL; in test_sigalgs_available() local
9225 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_sigalgs_available()
9229 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_sigalgs_available()
9233 if (!TEST_int_eq(SSL_get_shared_sigalgs(serverssl, 0, &sig, &hash, NULL, in test_sigalgs_available()
9248 SSL_free(serverssl); in test_sigalgs_available()
9267 SSL *clientssl = NULL, *serverssl = NULL; in test_pluggable_group() local
9291 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pluggable_group()
9295 if (!TEST_true(SSL_set1_groups_list(serverssl, group_name)) in test_pluggable_group()
9299 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pluggable_group()
9303 SSL_group_to_name(serverssl, SSL_get_shared_group(serverssl, 0)))) in test_pluggable_group()
9309 SSL_free(serverssl); in test_pluggable_group()
9324 SSL *clientssl = NULL, *serverssl = NULL, *client2ssl = NULL; in test_ssl_dup() local
9335 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_dup()
9366 if (!TEST_true(create_ssl_connection(serverssl, client2ssl, SSL_ERROR_NONE))) in test_ssl_dup()
9379 SSL_free(serverssl); in test_ssl_dup()
9487 SSL *clientssl = NULL, *serverssl = NULL; in test_set_tmp_dh() local
9539 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_set_tmp_dh()
9544 if (!TEST_true(SSL_set_dh_auto(serverssl, dhauto))) in test_set_tmp_dh()
9548 if (!TEST_true(SSL_set0_tmp_dh_pkey(serverssl, dhpkey))) in test_set_tmp_dh()
9554 if (!TEST_true(SSL_set_tmp_dh(serverssl, dh))) in test_set_tmp_dh()
9557 SSL_set_tmp_dh_callback(serverssl, tmp_dh_callback); in test_set_tmp_dh()
9561 if (!TEST_true(SSL_set_min_proto_version(serverssl, TLS1_2_VERSION)) in test_set_tmp_dh()
9562 || !TEST_true(SSL_set_max_proto_version(serverssl, TLS1_2_VERSION)) in test_set_tmp_dh()
9563 || !TEST_true(SSL_set_cipher_list(serverssl, "DHE-RSA-AES128-SHA"))) in test_set_tmp_dh()
9570 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_tmp_dh()
9580 SSL_free(serverssl); in test_set_tmp_dh()
9595 SSL *clientssl = NULL, *serverssl = NULL; in test_dh_auto() local
9656 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_dh_auto()
9660 if (!TEST_true(SSL_set_dh_auto(serverssl, 1)) in test_dh_auto()
9661 || !TEST_true(SSL_set_min_proto_version(serverssl, TLS1_2_VERSION)) in test_dh_auto()
9662 || !TEST_true(SSL_set_max_proto_version(serverssl, TLS1_2_VERSION)) in test_dh_auto()
9663 || !TEST_true(SSL_set_cipher_list(serverssl, ciphersuite)) in test_dh_auto()
9673 || !TEST_int_le(SSL_accept(serverssl), 0)) in test_dh_auto()
9676 if (!TEST_int_gt(SSL_get_tmp_key(serverssl, &tmpkey), 0)) in test_dh_auto()
9681 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_dh_auto()
9687 SSL_free(serverssl); in test_dh_auto()
9708 SSL *clientssl = NULL, *serverssl = NULL; in test_sni_tls13() local
9733 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_sni_tls13()
9735 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_sni_tls13()
9746 SSL_free(serverssl); in test_sni_tls13()
9762 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_lifetime() local
9782 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ticket_lifetime()
9791 SSL_get_default_timeout(serverssl))) in test_ticket_lifetime()
9794 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_ticket_lifetime()
9809 SSL_free(serverssl); in test_ticket_lifetime()
10173 SSL *clientssl = NULL, *serverssl = NULL, *peera, *peerb; in test_pipelining() local
10203 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_pipelining()
10212 peera = serverssl; in test_pipelining()
10217 peerb = serverssl; in test_pipelining()
10262 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pipelining()
10334 SSL_free(serverssl); in test_pipelining()
10370 SSL *clientssl = NULL, *serverssl = NULL; in test_handshake_retry() local
10408 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_handshake_retry()
10412 tmp = SSL_get_wbio(serverssl); in test_handshake_retry()
10417 SSL_set0_wbio(serverssl, bretry); in test_handshake_retry()
10423 if (!TEST_int_eq(SSL_accept(serverssl), -1) in test_handshake_retry()
10424 || !TEST_int_eq(SSL_get_error(serverssl, -1), SSL_ERROR_WANT_WRITE)) in test_handshake_retry()
10428 SSL_set0_wbio(serverssl, tmp); in test_handshake_retry()
10431 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_handshake_retry()
10436 SSL_free(serverssl); in test_handshake_retry()