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()
2465 SSL *serverssl = NULL, *clientssl = NULL; in check_resumption() local
2471 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in check_resumption()
2478 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in check_resumption()
2499 && (!post_handshake_verify(serverssl, clientssl) in check_resumption()
2504 SSL_shutdown(serverssl); in check_resumption()
2505 SSL_free(serverssl); in check_resumption()
2507 serverssl = clientssl = NULL; in check_resumption()
2516 SSL_free(serverssl); in check_resumption()
2523 SSL *serverssl = NULL, *clientssl = NULL; in test_tickets() local
2535 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tickets()
2539 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2546 SSL_shutdown(serverssl); in test_tickets()
2547 SSL_free(serverssl); in test_tickets()
2551 clientssl = serverssl = NULL; in test_tickets()
2579 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tickets()
2585 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tickets()
2592 if (!post_handshake_verify(serverssl, clientssl) in test_tickets()
2597 SSL_shutdown(serverssl); in test_tickets()
2598 SSL_free(serverssl); in test_tickets()
2600 serverssl = clientssl = NULL; in test_tickets()
2615 SSL_free(serverssl); in test_tickets()
2640 SSL *serverssl = NULL, *clientssl = NULL; in test_psk_tickets() local
2662 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_psk_tickets()
2670 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_psk_tickets()
2681 SSL_free(serverssl); in test_psk_tickets()
2695 SSL *serverssl = NULL, *clientssl = NULL; in test_extra_tickets() local
2717 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_extra_tickets()
2725 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_extra_tickets()
2729 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2730 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2736 if (!TEST_true(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2749 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2750 || !TEST_true(SSL_write_ex(serverssl, &c, sizeof(c), &nbytes)) in test_extra_tickets()
2762 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2763 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2764 || !TEST_true(SSL_write_ex(serverssl, &c, 0, &nbytes)) in test_extra_tickets()
2774 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2775 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2776 || !TEST_true(SSL_do_handshake(serverssl)) in test_extra_tickets()
2788 tmp = SSL_get_wbio(serverssl); in test_extra_tickets()
2793 SSL_set0_wbio(serverssl, bretry); in test_extra_tickets()
2795 if (!TEST_false(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2796 || !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_WANT_WRITE) in test_extra_tickets()
2800 SSL_set0_wbio(serverssl, tmp); in test_extra_tickets()
2806 if (!TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2807 || !TEST_true(SSL_new_session_ticket(serverssl)) in test_extra_tickets()
2809 || !TEST_true(SSL_do_handshake(serverssl)) in test_extra_tickets()
2813 if (!TEST_true(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2823 if (!TEST_true(SSL_do_handshake(serverssl)) in test_extra_tickets()
2828 if (!TEST_true(SSL_write_ex(serverssl, &c, 1, &nbytes)) in test_extra_tickets()
2839 SSL_shutdown(serverssl); in test_extra_tickets()
2845 SSL_free(serverssl); in test_extra_tickets()
2849 clientssl = serverssl = NULL; in test_extra_tickets()
2909 SSL *serverssl = NULL, *clientssl = NULL; in test_ssl_set_bio() local
2948 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_set_bio()
2985 && !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_set_bio()
3020 SSL_free(serverssl); in test_ssl_set_bio()
3144 SSL *clientssl = NULL, *serverssl = NULL; in test_set_sigalgs() local
3185 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_set_sigalgs()
3207 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_sigalgs()
3215 SSL_free(serverssl); in test_set_sigalgs()
3402 SSL **serverssl, SSL_SESSION **sess, int idx, in setupearly_data_test() argument
3428 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, clientssl, in setupearly_data_test()
3473 if (!TEST_true(create_ssl_connection(*serverssl, *clientssl, in setupearly_data_test()
3479 SSL_shutdown(*serverssl); in setupearly_data_test()
3480 SSL_free(*serverssl); in setupearly_data_test()
3482 *serverssl = *clientssl = NULL; in setupearly_data_test()
3484 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, in setupearly_data_test()
3514 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_read_write() local
3523 &serverssl, &sess, idx, in test_early_data_read_write()
3534 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3542 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_read_write()
3550 if (!TEST_true(SSL_write_early_data(serverssl, MSG2, strlen(MSG2), in test_early_data_read_write()
3564 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3571 if (!TEST_true(SSL_write_early_data(serverssl, MSG4, strlen(MSG4), in test_early_data_read_write()
3594 rbio = SSL_get_rbio(serverssl); in test_early_data_read_write()
3607 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3617 if (!TEST_true(SSL_write_early_data(serverssl, MSG6, strlen(MSG6), in test_early_data_read_write()
3629 if (!TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3638 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3660 if (!TEST_true(SSL_write_ex(serverssl, MSG7, strlen(MSG7), &written)) in test_early_data_read_write()
3672 SSL_shutdown(serverssl); in test_early_data_read_write()
3673 SSL_free(serverssl); in test_early_data_read_write()
3675 serverssl = clientssl = NULL; in test_early_data_read_write()
3676 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_early_data_read_write()
3685 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3692 || !TEST_int_gt(SSL_accept(serverssl), 0)) in test_early_data_read_write()
3700 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_read_write()
3709 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_read_write()
3720 SSL_free(serverssl); in test_early_data_read_write()
3753 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_replay_int() local
3789 &serverssl, &sess, idx, in test_early_data_replay_int()
3797 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3802 SSL_shutdown(serverssl); in test_early_data_replay_int()
3803 SSL_free(serverssl); in test_early_data_replay_int()
3805 serverssl = clientssl = NULL; in test_early_data_replay_int()
3807 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_early_data_replay_int()
3820 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_replay_int()
3827 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_replay_int()
3832 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_replay_int()
3844 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_replay_int()
3847 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_replay_int()
3853 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_early_data_replay_int()
3865 SSL_free(serverssl); in test_early_data_replay_int()
3905 SSL *clientssl = NULL, *serverssl = NULL; in early_data_skip_helper() local
3930 &serverssl, &sess, idx, in early_data_skip_helper()
3938 if (!TEST_true(SSL_set1_groups_list(serverssl, "ffdhe3072"))) in early_data_skip_helper()
3941 if (!TEST_true(SSL_set1_groups_list(serverssl, "P-384"))) in early_data_skip_helper()
3961 && !TEST_true(SSL_set_recv_max_early_data(serverssl, 0))) in early_data_skip_helper()
3971 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in early_data_skip_helper()
3975 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in early_data_skip_helper()
3991 || !TEST_false(SSL_read_ex(serverssl, buf, sizeof(buf), in early_data_skip_helper()
4029 if (!TEST_false(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in early_data_skip_helper()
4030 || !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_SSL)) in early_data_skip_helper()
4051 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in early_data_skip_helper()
4069 SSL_free(serverssl); in early_data_skip_helper()
4128 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_sent() local
4135 &serverssl, &sess, idx, in test_early_data_not_sent()
4145 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_not_sent()
4149 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_not_sent()
4158 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_not_sent()
4160 || !SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written) in test_early_data_not_sent()
4175 SSL_free(serverssl); in test_early_data_not_sent()
4211 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk() local
4230 &serverssl, &sess, 2, in test_early_data_psk()
4361 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_psk()
4369 || !TEST_int_eq(SSL_get_early_data_status(serverssl), edstatus) in test_early_data_psk()
4381 SSL_free(serverssl); in test_early_data_psk()
4399 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_psk_with_all_ciphers() local
4437 &serverssl, &sess, 2, in test_early_data_psk_with_all_ciphers()
4442 || !TEST_true(SSL_set_ciphersuites(serverssl, cipher_str[idx]))) in test_early_data_psk_with_all_ciphers()
4462 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_psk_with_all_ciphers()
4470 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_psk_with_all_ciphers()
4473 || !TEST_int_eq(SSL_accept(serverssl), 1)) in test_early_data_psk_with_all_ciphers()
4481 if (!TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_psk_with_all_ciphers()
4493 if (serverssl != NULL) in test_early_data_psk_with_all_ciphers()
4494 SSL_shutdown(serverssl); in test_early_data_psk_with_all_ciphers()
4495 SSL_free(serverssl); in test_early_data_psk_with_all_ciphers()
4509 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_not_expected() local
4516 &serverssl, &sess, idx, in test_early_data_not_expected()
4529 if (!TEST_int_le(SSL_accept(serverssl), 0) in test_early_data_not_expected()
4531 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_not_expected()
4533 || !TEST_int_gt(SSL_accept(serverssl), 0) in test_early_data_not_expected()
4543 if (!TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_not_expected()
4554 SSL_free(serverssl); in test_early_data_not_expected()
4570 SSL *clientssl = NULL, *serverssl = NULL; in test_early_data_tls1_2() local
4576 &serverssl, NULL, idx, in test_early_data_tls1_2()
4591 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_tls1_2()
4601 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_early_data_tls1_2()
4605 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_early_data_tls1_2()
4614 || !TEST_true(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_early_data_tls1_2()
4616 || !TEST_true(SSL_write_ex(serverssl, MSG2, strlen(MSG2), &written)) in test_early_data_tls1_2()
4628 SSL_free(serverssl); in test_early_data_tls1_2()
4654 SSL *clientssl = NULL, *serverssl = NULL; in test_set_ciphersuite() local
4682 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_set_ciphersuite()
4704 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_set_ciphersuite()
4710 SSL_free(serverssl); in test_set_ciphersuite()
4721 SSL *clientssl = NULL, *serverssl = NULL; in test_ciphersuite_change() local
4736 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4738 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4746 SSL_shutdown(serverssl); in test_ciphersuite_change()
4747 SSL_free(serverssl); in test_ciphersuite_change()
4749 serverssl = clientssl = NULL; in test_ciphersuite_change()
4754 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4757 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4765 SSL_shutdown(serverssl); in test_ciphersuite_change()
4766 SSL_free(serverssl); in test_ciphersuite_change()
4768 serverssl = clientssl = NULL; in test_ciphersuite_change()
4775 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4778 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4786 SSL_shutdown(serverssl); in test_ciphersuite_change()
4787 SSL_free(serverssl); in test_ciphersuite_change()
4789 serverssl = clientssl = NULL; in test_ciphersuite_change()
4793 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4795 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4801 SSL_shutdown(serverssl); in test_ciphersuite_change()
4802 SSL_free(serverssl); in test_ciphersuite_change()
4804 serverssl = clientssl = NULL; in test_ciphersuite_change()
4810 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4818 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4831 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_ciphersuite_change()
4841 SSL_free(serverssl); in test_ciphersuite_change()
4877 SSL *serverssl = NULL, *clientssl = NULL; in test_key_exchange() local
4991 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_exchange()
4995 if (!TEST_true(SSL_set1_groups(serverssl, kexch_groups, kexch_groups_size)) in test_key_exchange()
4999 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_key_exchange()
5007 if (!TEST_int_eq(SSL_get_shared_group(serverssl, 0), in test_key_exchange()
5011 if (!TEST_str_eq(SSL_group_to_name(serverssl, kexch_groups[0]), in test_key_exchange()
5017 if (!TEST_int_eq(SSL_get_negotiated_group(serverssl), kexch_groups[0])) in test_key_exchange()
5025 SSL_free(serverssl); in test_key_exchange()
5035 static int set_ssl_groups(SSL *serverssl, SSL *clientssl, int clientmulti, in set_ssl_groups() argument
5050 if (!TEST_true(SSL_set1_groups(serverssl, kexch_groups, 1))) in set_ssl_groups()
5065 if (!TEST_true(SSL_set1_groups(serverssl, ecdhe_kexch_groups, in set_ssl_groups()
5069 if (!TEST_true(SSL_set1_groups(serverssl, ffdhe_kexch_groups, in set_ssl_groups()
5105 SSL *serverssl = NULL, *clientssl = NULL; in test_negotiated_group() local
5158 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5162 if (!TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, isecdhe, in test_negotiated_group()
5166 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_negotiated_group()
5171 || !TEST_uint_eq(SSL_get_negotiated_group(serverssl), expectednid)) in test_negotiated_group()
5178 SSL_shutdown(serverssl); in test_negotiated_group()
5179 SSL_free(serverssl); in test_negotiated_group()
5181 serverssl = clientssl = NULL; in test_negotiated_group()
5184 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5187 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
5191 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
5197 || !TEST_uint_eq(SSL_get_negotiated_group(serverssl), expectednid)) in test_negotiated_group()
5201 SSL_shutdown(serverssl); in test_negotiated_group()
5202 SSL_free(serverssl); in test_negotiated_group()
5204 serverssl = clientssl = NULL; in test_negotiated_group()
5230 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5233 || !TEST_true(set_ssl_groups(serverssl, clientssl, clientmulti, in test_negotiated_group()
5237 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_negotiated_group()
5243 || !TEST_uint_eq(SSL_get_negotiated_group(serverssl), expectednid)) in test_negotiated_group()
5248 SSL_free(serverssl); in test_negotiated_group()
5267 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_ciphersuite() local
5336 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tls13_ciphersuite()
5341 if (!TEST_true(SSL_set_ciphersuites(serverssl, t13_cipher)) in test_tls13_ciphersuite()
5345 if (!TEST_true(SSL_set_cipher_list(serverssl, t12_cipher)) in test_tls13_ciphersuite()
5352 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_ciphersuite()
5357 serverssl)); in test_tls13_ciphersuite()
5379 SSL_free(serverssl); in test_tls13_ciphersuite()
5380 serverssl = NULL; in test_tls13_ciphersuite()
5392 SSL_free(serverssl); in test_tls13_ciphersuite()
5409 SSL *serverssl = NULL, *clientssl = NULL; in test_tls13_psk() local
5473 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5475 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5478 || !TEST_false(SSL_session_reused(serverssl))) in test_tls13_psk()
5499 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5500 serverssl = clientssl = NULL; in test_tls13_psk()
5504 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5523 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5525 || !TEST_true(SSL_session_reused(serverssl))) in test_tls13_psk()
5542 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5543 serverssl = clientssl = NULL; in test_tls13_psk()
5547 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5553 if (!TEST_true(SSL_set1_groups_list(serverssl, "ffdhe3072"))) in test_tls13_psk()
5556 if (!TEST_true(SSL_set1_groups_list(serverssl, "P-384"))) in test_tls13_psk()
5564 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE)) in test_tls13_psk()
5566 || !TEST_true(SSL_session_reused(serverssl))) in test_tls13_psk()
5583 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5584 serverssl = clientssl = NULL; in test_tls13_psk()
5594 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5596 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_tls13_psk()
5599 || !TEST_false(SSL_session_reused(serverssl))) in test_tls13_psk()
5620 shutdown_ssl_connection(serverssl, clientssl); in test_tls13_psk()
5621 serverssl = clientssl = NULL; in test_tls13_psk()
5629 SSL_free(serverssl); in test_tls13_psk()
5679 SSL *serverssl = NULL, *clientssl = NULL; in test_stateless() local
5690 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5693 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5699 || !TEST_int_eq(SSL_stateless(serverssl), -1)) in test_stateless()
5714 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5717 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5720 || !TEST_int_eq(SSL_stateless(serverssl), 0)) in test_stateless()
5731 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5734 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5737 || !TEST_int_eq(SSL_stateless(serverssl), 0) in test_stateless()
5739 || !TEST_false(create_ssl_connection(serverssl, clientssl, in test_stateless()
5742 || !TEST_int_eq(SSL_stateless(serverssl), 1) in test_stateless()
5744 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_stateless()
5748 shutdown_ssl_connection(serverssl, clientssl); in test_stateless()
5749 serverssl = clientssl = NULL; in test_stateless()
5753 SSL_free(serverssl); in test_stateless()
5894 SSL *clientssl = NULL, *serverssl = NULL; in test_custom_exts() local
6019 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_custom_exts()
6021 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
6056 SSL_shutdown(serverssl); in test_custom_exts()
6057 SSL_free(serverssl); in test_custom_exts()
6059 serverssl = clientssl = NULL; in test_custom_exts()
6067 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_custom_exts()
6070 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_custom_exts()
6108 SSL_free(serverssl); in test_custom_exts()
6164 SSL *clientssl = NULL, *serverssl = NULL; in test_serverinfo_custom() local
6227 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_serverinfo_custom()
6229 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_serverinfo_custom()
6240 SSL_free(serverssl); in test_serverinfo_custom()
6260 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat() local
6307 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_export_key_mat()
6320 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_export_key_mat()
6356 || !TEST_int_eq(SSL_export_keying_material(serverssl, skeymat1, in test_export_key_mat()
6362 || !TEST_int_eq(SSL_export_keying_material(serverssl, skeymat2, in test_export_key_mat()
6367 || !TEST_int_eq(SSL_export_keying_material(serverssl, skeymat3, in test_export_key_mat()
6407 SSL_free(serverssl); in test_export_key_mat()
6429 SSL *clientssl = NULL, *serverssl = NULL; in test_export_key_mat_early() local
6437 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, &serverssl, in test_export_key_mat_early()
6443 || !TEST_int_eq(SSL_read_early_data(serverssl, buf, sizeof(buf), in test_export_key_mat_early()
6446 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_export_key_mat_early()
6457 serverssl, skeymat1, sizeof(skeymat1), label, in test_export_key_mat_early()
6460 serverssl, skeymat2, sizeof(skeymat2), label, in test_export_key_mat_early()
6486 SSL_free(serverssl); in test_export_key_mat_early()
6501 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update() local
6511 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update()
6513 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update()
6530 || !TEST_int_eq(SSL_read(serverssl, buf, sizeof(buf)), in test_key_update()
6534 if (!TEST_int_eq(SSL_write(serverssl, mess, strlen(mess)), strlen(mess)) in test_key_update()
6543 SSL_free(serverssl); in test_key_update()
6560 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_write() local
6574 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_write()
6576 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_write()
6580 peerupdate = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_write()
6581 peerwrite = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_write()
6626 SSL_free(serverssl); in test_key_update_peer_in_write()
6646 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_peer_in_read() local
6658 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_read()
6660 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_peer_in_read()
6664 local = tst == 0 ? clientssl : serverssl; in test_key_update_peer_in_read()
6665 peer = tst == 0 ? serverssl : clientssl; in test_key_update_peer_in_read()
6712 SSL_free(serverssl); in test_key_update_peer_in_read()
6729 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_write() local
6743 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_write()
6745 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_write()
6749 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_write()
6750 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_write()
6801 SSL_free(serverssl); in test_key_update_local_in_write()
6820 SSL *clientssl = NULL, *serverssl = NULL; in test_key_update_local_in_read() local
6832 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_read()
6834 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_key_update_local_in_read()
6838 local = tst == 0 ? clientssl : serverssl; in test_key_update_local_in_read()
6839 peer = tst == 0 ? serverssl : clientssl; in test_key_update_local_in_read()
6886 SSL_free(serverssl); in test_key_update_local_in_read()
6898 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_clear() local
6913 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ssl_clear()
6915 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
6920 SSL_shutdown(serverssl); in test_ssl_clear()
6921 SSL_free(serverssl); in test_ssl_clear()
6922 serverssl = NULL; in test_ssl_clear()
6928 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_clear()
6930 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_clear()
6936 SSL_shutdown(serverssl); in test_ssl_clear()
6941 SSL_free(serverssl); in test_ssl_clear()
7065 SSL *clientssl = NULL, *serverssl = NULL; in test_pha_key_update() local
7081 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pha_key_update()
7085 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
7089 SSL_set_verify(serverssl, SSL_VERIFY_PEER, NULL); in test_pha_key_update()
7090 if (!TEST_true(SSL_verify_client_post_handshake(serverssl))) in test_pha_key_update()
7097 if (!TEST_int_eq(SSL_do_handshake(serverssl), 1)) in test_pha_key_update()
7101 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_pha_key_update()
7106 SSL_shutdown(serverssl); in test_pha_key_update()
7111 SSL_free(serverssl); in test_pha_key_update()
7269 SSL *clientssl = NULL, *serverssl = NULL; in test_srp() local
7311 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_srp()
7315 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_srp()
7329 SSL_free(serverssl); in test_srp()
7489 SSL *clientssl = NULL, *serverssl = NULL; in test_info_callback() local
7524 &serverssl, &sess, 0, in test_info_callback()
7531 SSL_set_info_callback((tst % 2) == 0 ? serverssl : clientssl, in test_info_callback()
7541 if (!TEST_int_eq(SSL_read_early_data(serverssl, buf, in test_info_callback()
7549 || !TEST_int_eq(SSL_get_early_data_status(serverssl), in test_info_callback()
7551 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7577 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_info_callback()
7579 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7588 SSL_shutdown(serverssl); in test_info_callback()
7589 SSL_free(serverssl); in test_info_callback()
7591 serverssl = clientssl = NULL; in test_info_callback()
7594 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_info_callback()
7597 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_info_callback()
7606 SSL_free(serverssl); in test_info_callback()
7617 SSL *clientssl = NULL, *serverssl = NULL; in test_ssl_pending() local
7657 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_pending()
7659 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ssl_pending()
7665 || !TEST_int_eq(SSL_pending(serverssl), 0) in test_ssl_pending()
7666 || !TEST_false(SSL_has_pending(serverssl)) in test_ssl_pending()
7667 || !TEST_true(SSL_write_ex(serverssl, msg, sizeof(msg), &written)) in test_ssl_pending()
7678 SSL_free(serverssl); in test_ssl_pending()
7774 SSL *clientssl = NULL, *serverssl = NULL; in int_test_ssl_get_shared_ciphers() local
7819 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in int_test_ssl_get_shared_ciphers()
7821 || !TEST_true(create_ssl_connection(serverssl, clientssl, in int_test_ssl_get_shared_ciphers()
7825 if (!TEST_ptr(SSL_get_shared_ciphers(serverssl, buf, sizeof(buf))) in int_test_ssl_get_shared_ciphers()
7838 SSL_free(serverssl); in int_test_ssl_get_shared_ciphers()
8017 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_callbacks() local
8100 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ticket_callbacks()
8102 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
8121 SSL_shutdown(serverssl); in test_ticket_callbacks()
8122 SSL_free(serverssl); in test_ticket_callbacks()
8124 serverssl = clientssl = NULL; in test_ticket_callbacks()
8127 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_ticket_callbacks()
8130 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ticket_callbacks()
8157 SSL_free(serverssl); in test_ticket_callbacks()
8177 SSL *clientssl = NULL, *serverssl = NULL; in test_incorrect_shutdown() local
8190 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_incorrect_shutdown()
8194 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_incorrect_shutdown()
8198 c2s = SSL_get_rbio(serverssl); in test_incorrect_shutdown()
8201 if (!TEST_false(SSL_read(serverssl, buf, sizeof(buf)))) in test_incorrect_shutdown()
8204 if (tst == 0 && !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_SSL) ) in test_incorrect_shutdown()
8206 if (tst == 1 && !TEST_int_eq(SSL_get_error(serverssl, 0), SSL_ERROR_ZERO_RETURN) ) in test_incorrect_shutdown()
8212 SSL_free(serverssl); in test_incorrect_shutdown()
8236 SSL *clientssl = NULL, *serverssl = NULL; in test_shutdown() local
8263 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_shutdown()
8268 if (!TEST_true(create_bare_ssl_connection(serverssl, clientssl, in test_shutdown()
8273 } else if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_shutdown()
8288 if (!TEST_false(SSL_read_ex(serverssl, buf, sizeof(buf), &readbytes)) in test_shutdown()
8289 || !TEST_int_eq(SSL_get_error(serverssl, 0), in test_shutdown()
8291 || !TEST_int_eq(SSL_get_shutdown(serverssl), in test_shutdown()
8297 || !TEST_true(SSL_write(serverssl, msg, sizeof(msg)))) in test_shutdown()
8300 && !TEST_true(SSL_key_update(serverssl, in test_shutdown()
8304 SSL_set_verify(serverssl, SSL_VERIFY_PEER, NULL); in test_shutdown()
8305 if (!TEST_true(SSL_verify_client_post_handshake(serverssl))) in test_shutdown()
8309 && !TEST_true(SSL_write(serverssl, msg, sizeof(msg)))) in test_shutdown()
8311 if (!TEST_int_eq(SSL_shutdown(serverssl), 1)) in test_shutdown()
8337 if (!TEST_int_eq(SSL_shutdown(serverssl), 0) in test_shutdown()
8342 || !TEST_false(SSL_write_ex(serverssl, msg, sizeof(msg), &written)) in test_shutdown()
8346 || !TEST_int_eq(SSL_shutdown(serverssl), 1)) in test_shutdown()
8374 SSL_free(serverssl); in test_shutdown()
8487 SSL *clientssl = NULL, *serverssl = NULL; in test_cert_cb_int() local
8518 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_cert_cb_int()
8540 ret = create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE); in test_cert_cb_int()
8550 SSL_free(serverssl); in test_cert_cb_int()
8613 SSL *clientssl = NULL, *serverssl = NULL; in test_client_cert_cb() local
8642 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_client_cert_cb()
8644 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_client_cert_cb()
8651 SSL_free(serverssl); in test_client_cert_cb()
8670 SSL *clientssl = NULL, *serverssl = NULL; in test_ca_names_int() local
8725 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ca_names_int()
8727 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_ca_names_int()
8735 sktmp = SSL_get0_peer_CA_list(serverssl); in test_ca_names_int()
8766 SSL_free(serverssl); in test_ca_names_int()
8820 SSL *clientssl = NULL, *serverssl = NULL; in test_multiblock_write() local
8855 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multiblock_write()
8860 SSL_set_options(serverssl, SSL_OP_NO_ENCRYPT_THEN_MAC); in test_multiblock_write()
8864 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_multiblock_write()
8867 if (!TEST_true(SSL_write_ex(serverssl, msg, sizeof(msg), &written)) in test_multiblock_write()
8883 SSL_free(serverssl); in test_multiblock_write()
9026 SSL *serverssl = NULL, *clientssl = NULL; in test_session_cache_overflow() local
9054 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9058 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_cache_overflow()
9062 sess = SSL_get_session(serverssl); in test_session_cache_overflow()
9077 SSL_shutdown(serverssl); in test_session_cache_overflow()
9079 SSL_free(serverssl); in test_session_cache_overflow()
9081 serverssl = clientssl = NULL; in test_session_cache_overflow()
9088 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9092 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_cache_overflow()
9099 get_sess_val = SSL_get_session(serverssl); in test_session_cache_overflow()
9106 SSL_shutdown(serverssl); in test_session_cache_overflow()
9108 SSL_free(serverssl); in test_session_cache_overflow()
9110 serverssl = clientssl = NULL; in test_session_cache_overflow()
9112 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9119 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_session_cache_overflow()
9125 SSL_free(serverssl); in test_session_cache_overflow()
9150 SSL *clientssl = NULL, *serverssl = NULL; in test_servername() local
9170 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_servername()
9186 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
9191 || !TEST_str_eq(SSL_get_servername(serverssl, in test_servername()
9201 || !TEST_int_eq(SSL_shutdown(serverssl), 0)) in test_servername()
9205 SSL_free(serverssl); in test_servername()
9206 clientssl = serverssl = NULL; in test_servername()
9208 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_servername()
9264 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_servername()
9268 || !TEST_true(SSL_session_reused(serverssl)) in test_servername()
9272 || !TEST_str_eq(SSL_get_servername(serverssl, in test_servername()
9281 SSL_free(serverssl); in test_servername()
9304 SSL *clientssl = NULL, *serverssl = NULL; in test_sigalgs_available() local
9403 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_sigalgs_available()
9407 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_sigalgs_available()
9411 if (!TEST_int_eq(SSL_get_shared_sigalgs(serverssl, 0, &sig, &hash, NULL, in test_sigalgs_available()
9426 SSL_free(serverssl); in test_sigalgs_available()
9445 SSL *clientssl = NULL, *serverssl = NULL; in test_pluggable_group() local
9460 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pluggable_group()
9465 …if (!TEST_true(SSL_set1_groups_list(serverssl, "xorgroup:xorkemgroup:dummy1:dummy2:dummy3:dummy4:d… in test_pluggable_group()
9470 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pluggable_group()
9474 SSL_group_to_name(serverssl, SSL_get_shared_group(serverssl, 0)))) in test_pluggable_group()
9480 SSL_free(serverssl); in test_pluggable_group()
9495 SSL *clientssl = NULL, *serverssl = NULL, *client2ssl = NULL; in test_ssl_dup() local
9506 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_dup()
9537 if (!TEST_true(create_ssl_connection(serverssl, client2ssl, SSL_ERROR_NONE))) in test_ssl_dup()
9550 SSL_free(serverssl); in test_ssl_dup()
9658 SSL *clientssl = NULL, *serverssl = NULL; in test_set_tmp_dh() local
9710 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_set_tmp_dh()
9715 if (!TEST_true(SSL_set_dh_auto(serverssl, dhauto))) in test_set_tmp_dh()
9719 if (!TEST_true(SSL_set0_tmp_dh_pkey(serverssl, dhpkey))) in test_set_tmp_dh()
9725 if (!TEST_true(SSL_set_tmp_dh(serverssl, dh))) in test_set_tmp_dh()
9728 SSL_set_tmp_dh_callback(serverssl, tmp_dh_callback); in test_set_tmp_dh()
9732 if (!TEST_true(SSL_set_min_proto_version(serverssl, TLS1_2_VERSION)) in test_set_tmp_dh()
9733 || !TEST_true(SSL_set_max_proto_version(serverssl, TLS1_2_VERSION)) in test_set_tmp_dh()
9734 || !TEST_true(SSL_set_cipher_list(serverssl, "DHE-RSA-AES128-SHA"))) in test_set_tmp_dh()
9741 if (!TEST_int_eq(create_ssl_connection(serverssl, clientssl, in test_set_tmp_dh()
9751 SSL_free(serverssl); in test_set_tmp_dh()
9766 SSL *clientssl = NULL, *serverssl = NULL; in test_dh_auto() local
9827 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_dh_auto()
9831 if (!TEST_true(SSL_set_dh_auto(serverssl, 1)) in test_dh_auto()
9832 || !TEST_true(SSL_set_min_proto_version(serverssl, TLS1_2_VERSION)) in test_dh_auto()
9833 || !TEST_true(SSL_set_max_proto_version(serverssl, TLS1_2_VERSION)) in test_dh_auto()
9834 || !TEST_true(SSL_set_cipher_list(serverssl, ciphersuite)) in test_dh_auto()
9844 || !TEST_int_le(SSL_accept(serverssl), 0)) in test_dh_auto()
9847 if (!TEST_int_gt(SSL_get_tmp_key(serverssl, &tmpkey), 0)) in test_dh_auto()
9852 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_dh_auto()
9858 SSL_free(serverssl); in test_dh_auto()
9879 SSL *clientssl = NULL, *serverssl = NULL; in test_sni_tls13() local
9904 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_sni_tls13()
9906 || !TEST_true(create_ssl_connection(serverssl, clientssl, in test_sni_tls13()
9917 SSL_free(serverssl); in test_sni_tls13()
9933 SSL *clientssl = NULL, *serverssl = NULL; in test_ticket_lifetime() local
9953 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ticket_lifetime()
9962 SSL_get_default_timeout(serverssl))) in test_ticket_lifetime()
9965 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_ticket_lifetime()
9980 SSL_free(serverssl); in test_ticket_lifetime()
10323 SSL *clientssl = NULL, *serverssl = NULL, *peera, *peerb; in test_pipelining() local
10353 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_pipelining()
10362 peera = serverssl; in test_pipelining()
10367 peerb = serverssl; in test_pipelining()
10412 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_pipelining()
10484 SSL_free(serverssl); in test_pipelining()
10520 SSL *clientssl = NULL, *serverssl = NULL; in test_handshake_retry() local
10558 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_handshake_retry()
10562 tmp = SSL_get_wbio(serverssl); in test_handshake_retry()
10567 SSL_set0_wbio(serverssl, bretry); in test_handshake_retry()
10573 if (!TEST_int_eq(SSL_accept(serverssl), -1) in test_handshake_retry()
10574 || !TEST_int_eq(SSL_get_error(serverssl, -1), SSL_ERROR_WANT_WRITE)) in test_handshake_retry()
10578 SSL_set0_wbio(serverssl, tmp); in test_handshake_retry()
10581 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_handshake_retry()
10586 SSL_free(serverssl); in test_handshake_retry()
10611 SSL *serverssl = NULL, *clientssl = NULL; in resume_servername_cb() local
10622 if (!TEST_true(create_ssl_objects(cbdata->sctx, cbdata->cctx, &serverssl, in resume_servername_cb()
10632 if (!TEST_false(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) { in resume_servername_cb()
10640 SSL_free(serverssl); in resume_servername_cb()
10657 SSL *serverssl = NULL, *clientssl = NULL; in test_multi_resume() local
10703 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multi_resume()
10725 SSL_set_max_early_data(serverssl, 0); in test_multi_resume()
10727 if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) in test_multi_resume()
10748 SSL_shutdown(serverssl); in test_multi_resume()
10749 SSL_free(serverssl); in test_multi_resume()
10751 serverssl = clientssl = NULL; in test_multi_resume()
10760 SSL_free(serverssl); in test_multi_resume()
10968 SSL *serverssl = NULL, *clientssl = NULL; in test_npn() local
10979 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_npn()
10985 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_npn()
10992 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_npn()
10996 SSL_get0_next_proto_negotiated(serverssl, &prot, &protlen); in test_npn()
11019 SSL_free(serverssl); in test_npn()
11066 SSL *serverssl = NULL, *clientssl = NULL; in test_alpn() local
11078 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_alpn()
11093 if (!TEST_false(create_ssl_connection(serverssl, clientssl, in test_alpn()
11100 if (!TEST_true(create_ssl_connection(serverssl, clientssl, in test_alpn()
11122 SSL_free(serverssl); in test_alpn()