Lines Matching refs:sctx

350     SSL_CTX *cctx = NULL, *sctx = NULL;  in test_keylog()  local
366 &sctx, &cctx, cert, privkey))) in test_keylog()
371 SSL_CTX_set_options(sctx, SSL_OP_NO_TLSv1_3); in test_keylog()
378 || !TEST_true(SSL_CTX_get_keylog_callback(sctx) == NULL)) in test_keylog()
384 SSL_CTX_set_keylog_callback(sctx, server_keylog_callback); in test_keylog()
385 if (!TEST_true(SSL_CTX_get_keylog_callback(sctx) in test_keylog()
390 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_keylog()
421 SSL_CTX_free(sctx); in test_keylog()
431 SSL_CTX *cctx = NULL, *sctx = NULL; in test_keylog_no_master_key() local
449 &sctx, &cctx, cert, privkey)) in test_keylog_no_master_key()
450 || !TEST_true(SSL_CTX_set_max_early_data(sctx, in test_keylog_no_master_key()
455 || !TEST_true(SSL_CTX_get_keylog_callback(sctx) == NULL)) in test_keylog_no_master_key()
463 SSL_CTX_set_keylog_callback(sctx, server_keylog_callback); in test_keylog_no_master_key()
464 if (!TEST_true(SSL_CTX_get_keylog_callback(sctx) in test_keylog_no_master_key()
469 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_keylog_no_master_key()
507 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_keylog_no_master_key()
538 SSL_CTX_free(sctx); in test_keylog_no_master_key()
574 SSL_CTX *cctx = NULL, *sctx = NULL; in test_client_cert_verify_cb() local
580 &sctx, &cctx, NULL, NULL))) in test_client_cert_verify_cb()
582 if (!TEST_int_eq(SSL_CTX_use_certificate_chain_file(sctx, leaf), 1) in test_client_cert_verify_cb()
583 || !TEST_int_eq(SSL_CTX_use_PrivateKey_file(sctx, skey, in test_client_cert_verify_cb()
585 || !TEST_int_eq(SSL_CTX_check_private_key(sctx), 1)) in test_client_cert_verify_cb()
591 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_client_cert_verify_cb()
631 SSL_CTX_free(sctx); in test_client_cert_verify_cb()
754 SSL_CTX *cctx = NULL, *sctx = NULL; in test_client_hello_cb() local
760 &sctx, &cctx, cert, privkey))) in test_client_hello_cb()
762 SSL_CTX_set_client_hello_cb(sctx, full_client_hello_callback, &testctr); in test_client_hello_cb()
769 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_client_hello_cb()
788 SSL_CTX_free(sctx); in test_client_hello_cb()
796 SSL_CTX *cctx = NULL, *sctx = NULL; in test_no_ems() local
802 &sctx, &cctx, cert, privkey)) { in test_no_ems()
807 SSL_CTX_set_options(sctx, SSL_OP_NO_EXTENDED_MASTER_SECRET); in test_no_ems()
809 if (!create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, NULL)) { in test_no_ems()
833 SSL_CTX_free(sctx); in test_no_ems()
847 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ccs_change_cipher() local
862 &sctx, &cctx, cert, privkey)) in test_ccs_change_cipher()
863 || !TEST_true(SSL_CTX_set_options(sctx, SSL_OP_NO_TICKET)) in test_ccs_change_cipher()
864 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
878 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
898 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ccs_change_cipher()
943 SSL_CTX_free(sctx); in test_ccs_change_cipher()
951 static int add_large_cert_chain(SSL_CTX *sctx) in add_large_cert_chain() argument
983 if (!SSL_CTX_add_extra_chain_cert(sctx, chaincert)) { in add_large_cert_chain()
1001 SSL_CTX *cctx = NULL, *sctx = NULL; in execute_test_large_message() local
1006 max_version, &sctx, &cctx, cert, in execute_test_large_message()
1016 if (!TEST_true(SSL_CTX_set_cipher_list(sctx, "DEFAULT:@SECLEVEL=0")) in execute_test_large_message()
1031 if (!add_large_cert_chain(sctx)) in execute_test_large_message()
1034 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_test_large_message()
1051 SSL_CTX_free(sctx); in execute_test_large_message()
1167 SSL_CTX *cctx = NULL, *sctx = NULL; in execute_test_ktls() local
1191 &sctx, &cctx, cert, privkey))) in execute_test_ktls()
1196 || !TEST_true(SSL_CTX_set_ciphersuites(sctx, cipher))) in execute_test_ktls()
1200 || !TEST_true(SSL_CTX_set_cipher_list(sctx, cipher))) in execute_test_ktls()
1204 if (!TEST_true(create_ssl_objects2(sctx, cctx, &serverssl, in execute_test_ktls()
1283 SSL_CTX_free(sctx); in execute_test_ktls()
1299 SSL_CTX *cctx = NULL, *sctx = NULL; in execute_test_ktls_sendfile() local
1330 &sctx, &cctx, cert, privkey))) in execute_test_ktls_sendfile()
1335 || !TEST_true(SSL_CTX_set_ciphersuites(sctx, cipher))) in execute_test_ktls_sendfile()
1339 || !TEST_true(SSL_CTX_set_cipher_list(sctx, cipher))) in execute_test_ktls_sendfile()
1343 if (!TEST_true(create_ssl_objects2(sctx, cctx, &serverssl, in execute_test_ktls_sendfile()
1414 SSL_CTX_free(sctx); in execute_test_ktls_sendfile()
1533 SSL_CTX *cctx = NULL, *sctx = NULL; in test_large_app_data() local
1622 &sctx, &cctx, cert, privkey))) in test_large_app_data()
1628 || !TEST_true(SSL_CTX_set_cipher_list(sctx, in test_large_app_data()
1633 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_large_app_data()
1679 SSL_CTX_free(sctx); in test_large_app_data()
1691 SSL_CTX *cctx = NULL, *sctx = NULL; in execute_cleanse_plaintext() local
1703 &sctx, &cctx, cert, in execute_cleanse_plaintext()
1718 if (!TEST_true(SSL_CTX_set_cipher_list(sctx, "DEFAULT:@SECLEVEL=0")) in execute_cleanse_plaintext()
1725 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in execute_cleanse_plaintext()
1782 SSL_CTX_free(sctx); in execute_cleanse_plaintext()
1874 SSL_CTX *cctx = NULL, *sctx = NULL; in test_tlsext_status_type() local
1883 &sctx, &cctx, cert, privkey)) in test_tlsext_status_type()
1918 SSL_CTX_set_tlsext_status_cb(sctx, ocsp_server_cb); in test_tlsext_status_type()
1919 SSL_CTX_set_tlsext_status_arg(sctx, &cdummyarg); in test_tlsext_status_type()
1920 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tlsext_status_type()
1936 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tlsext_status_type()
1956 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tlsext_status_type()
1991 SSL_CTX_free(sctx); in test_tlsext_status_type()
2035 SSL_CTX *sctx = NULL, *cctx = NULL; in execute_test_session() local
2052 &sctx, &cctx, cert, privkey))) in execute_test_session()
2077 SSL_CTX_set_options(sctx, s_options); in execute_test_session()
2080 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl1, &clientssl1, in execute_test_session()
2097 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl2, in execute_test_session()
2133 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl2, in execute_test_session()
2179 SSL_CTX_set_max_proto_version(sctx, TLS1_1_VERSION); in execute_test_session()
2180 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl3, in execute_test_session()
2202 SSL_CTX_sess_set_new_cb(sctx, new_session_cb); in execute_test_session()
2203 SSL_CTX_sess_set_remove_cb(sctx, remove_session_cb); in execute_test_session()
2204 SSL_CTX_sess_set_get_cb(sctx, get_session_cb); in execute_test_session()
2211 SSL_CTX_set_session_cache_mode(sctx, in execute_test_session()
2226 SSL_CTX_set_max_proto_version(sctx, maxprot); in execute_test_session()
2228 SSL_CTX_set_options(sctx, SSL_OP_NO_TICKET); in execute_test_session()
2230 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl1, &clientssl1, in execute_test_session()
2246 if (!TEST_false(SSL_CTX_remove_session(sctx, sess2))) in execute_test_session()
2250 if (!TEST_false(SSL_CTX_add_session(sctx, sess2))) in execute_test_session()
2271 || !TEST_true(SSL_CTX_remove_session(sctx, sess2))) in execute_test_session()
2280 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl2, in execute_test_session()
2316 if (!TEST_long_ne(SSL_CTX_sess_set_cache_size(sctx, 1), 0)) in execute_test_session()
2320 SSL_CTX_add_session(sctx, sess1); in execute_test_session()
2321 SSL_CTX_add_session(sctx, sess2); in execute_test_session()
2324 if (!TEST_true(SSL_CTX_add_session(sctx, sess1)) in execute_test_session()
2342 SSL_CTX_free(sctx); in execute_test_session()
2439 static int setup_ticket_test(int stateful, int idx, SSL_CTX **sctx, in setup_ticket_test() argument
2446 sctx, cctx, cert, privkey)) in setup_ticket_test()
2447 || !TEST_true(SSL_CTX_set_num_tickets(*sctx, idx)) in setup_ticket_test()
2448 || !TEST_true(SSL_CTX_set_session_id_context(*sctx, in setup_ticket_test()
2454 SSL_CTX_set_options(*sctx, SSL_OP_NO_TICKET); in setup_ticket_test()
2463 static int check_resumption(int idx, SSL_CTX *sctx, SSL_CTX *cctx, int succ) in check_resumption() argument
2471 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in check_resumption()
2522 SSL_CTX *sctx = NULL, *cctx = NULL; in test_tickets() local
2532 if (!setup_ticket_test(stateful, idx, &sctx, &cctx)) in test_tickets()
2535 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tickets()
2549 SSL_CTX_free(sctx); in test_tickets()
2552 sctx = cctx = NULL; in test_tickets()
2563 if (!setup_ticket_test(stateful, idx, &sctx, &cctx)) in test_tickets()
2566 if (!check_resumption(idx, sctx, cctx, 0)) in test_tickets()
2572 SSL_CTX_free(sctx); in test_tickets()
2574 sctx = cctx = NULL; in test_tickets()
2576 if (!setup_ticket_test(stateful, idx, &sctx, &cctx)) in test_tickets()
2579 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tickets()
2609 if (!check_resumption(idx, sctx, cctx, 1)) in test_tickets()
2621 SSL_CTX_free(sctx); in test_tickets()
2639 SSL_CTX *sctx = NULL, *cctx = NULL; in test_psk_tickets() local
2646 &sctx, &cctx, NULL, NULL)) in test_psk_tickets()
2647 || !TEST_true(SSL_CTX_set_session_id_context(sctx, in test_psk_tickets()
2655 SSL_CTX_set_psk_find_session_callback(sctx, find_session_cb); in test_psk_tickets()
2662 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_psk_tickets()
2683 SSL_CTX_free(sctx); in test_psk_tickets()
2694 SSL_CTX *sctx = NULL, *cctx = NULL; in test_extra_tickets() local
2711 if (!TEST_ptr(bretry) || !setup_ticket_test(stateful, idx, &sctx, &cctx)) in test_extra_tickets()
2713 SSL_CTX_sess_set_new_cb(sctx, new_session_cb); in test_extra_tickets()
2717 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_extra_tickets()
2847 SSL_CTX_free(sctx); in test_extra_tickets()
2850 sctx = cctx = NULL; in test_extra_tickets()
2905 SSL_CTX *sctx = NULL, *cctx = NULL; in test_ssl_set_bio() local
2934 &sctx, &cctx, cert, privkey))) in test_ssl_set_bio()
2944 SSL_CTX_set_min_proto_version(sctx, TLS1_3_VERSION); in test_ssl_set_bio()
2948 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_set_bio()
3022 SSL_CTX_free(sctx); in test_ssl_set_bio()
3143 SSL_CTX *cctx = NULL, *sctx = NULL; in test_set_sigalgs() local
3159 &sctx, &cctx, cert, privkey))) in test_set_sigalgs()
3185 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_set_sigalgs()
3217 SSL_CTX_free(sctx); in test_set_sigalgs()
3401 static int setupearly_data_test(SSL_CTX **cctx, SSL_CTX **sctx, SSL **clientssl, in setupearly_data_test() argument
3405 if (*sctx == NULL in setupearly_data_test()
3409 sctx, cctx, cert, privkey))) in setupearly_data_test()
3412 if (!TEST_true(SSL_CTX_set_max_early_data(*sctx, SSL3_RT_MAX_PLAIN_LENGTH))) in setupearly_data_test()
3418 SSL_CTX_set_read_ahead(*sctx, 1); in setupearly_data_test()
3422 SSL_CTX_set_psk_find_session_callback(*sctx, find_session_cb); in setupearly_data_test()
3428 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, clientssl, in setupearly_data_test()
3484 if (!TEST_true(create_ssl_objects(*sctx, *cctx, serverssl, in setupearly_data_test()
3513 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_read_write() local
3522 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_read_write()
3676 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_early_data_read_write()
3722 SSL_CTX_free(sctx); in test_early_data_read_write()
3752 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_replay_int() local
3764 &sctx, &cctx, cert, privkey))) in test_early_data_replay_int()
3769 SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY); in test_early_data_replay_int()
3777 SSL_CONF_CTX_set_ssl_ctx(confctx, sctx); in test_early_data_replay_int()
3785 SSL_CTX_set_allow_early_data_cb(sctx, allow_early_data_cb, &usecb); in test_early_data_replay_int()
3788 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_replay_int()
3807 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_early_data_replay_int()
3867 SSL_CTX_free(sctx); in test_early_data_replay_int()
3904 SSL_CTX *cctx = NULL, *sctx = NULL; in early_data_skip_helper() local
3917 &sctx, &cctx, cert, privkey))) in early_data_skip_helper()
3921 SSL_CTX_set_security_level(sctx, 0); in early_data_skip_helper()
3925 if (!TEST_true(SSL_CTX_set_ciphersuites(sctx, ciphersuites[cipher])) in early_data_skip_helper()
3929 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in early_data_skip_helper()
4071 SSL_CTX_free(sctx); in early_data_skip_helper()
4127 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_not_sent() local
4134 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_not_sent()
4177 SSL_CTX_free(sctx); in test_early_data_not_sent()
4210 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_psk() local
4229 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_psk()
4290 || !TEST_true(SSL_CTX_set_tlsext_servername_callback(sctx, in test_early_data_psk()
4318 SSL_CTX_set_alpn_select_cb(sctx, alpn_select_cb, NULL); in test_early_data_psk()
4335 SSL_CTX_set_alpn_select_cb(sctx, alpn_select_cb, NULL); in test_early_data_psk()
4383 SSL_CTX_free(sctx); in test_early_data_psk()
4398 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_psk_with_all_ciphers() local
4436 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_psk_with_all_ciphers()
4497 SSL_CTX_free(sctx); in test_early_data_psk_with_all_ciphers()
4508 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_not_expected() local
4515 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_not_expected()
4556 SSL_CTX_free(sctx); in test_early_data_not_expected()
4569 SSL_CTX *cctx = NULL, *sctx = NULL; in test_early_data_tls1_2() local
4575 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_early_data_tls1_2()
4630 SSL_CTX_free(sctx); in test_early_data_tls1_2()
4653 SSL_CTX *cctx = NULL, *sctx = NULL; in test_set_ciphersuite() local
4659 &sctx, &cctx, cert, privkey)) in test_set_ciphersuite()
4660 || !TEST_true(SSL_CTX_set_ciphersuites(sctx, in test_set_ciphersuite()
4682 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_set_ciphersuite()
4712 SSL_CTX_free(sctx); in test_set_ciphersuite()
4720 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ciphersuite_change() local
4729 &sctx, &cctx, cert, privkey)) in test_ciphersuite_change()
4730 || !TEST_true(SSL_CTX_set_ciphersuites(sctx, in test_ciphersuite_change()
4736 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4754 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4775 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4793 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ciphersuite_change()
4808 || !TEST_true(SSL_CTX_set_ciphersuites(sctx, in test_ciphersuite_change()
4810 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ciphersuite_change()
4843 SSL_CTX_free(sctx); in test_ciphersuite_change()
4876 SSL_CTX *sctx = NULL, *cctx = NULL; in test_key_exchange() local
4962 max_version, &sctx, &cctx, cert, in test_key_exchange()
4966 if (!TEST_true(SSL_CTX_set_ciphersuites(sctx, in test_key_exchange()
4974 if (!TEST_true(SSL_CTX_set_cipher_list(sctx, in test_key_exchange()
4977 || !TEST_true(SSL_CTX_set_dh_auto(sctx, 1))) in test_key_exchange()
4991 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_exchange()
5027 SSL_CTX_free(sctx); in test_key_exchange()
5104 SSL_CTX *sctx = NULL, *cctx = NULL; in test_negotiated_group() local
5140 max_version, &sctx, &cctx, cert, in test_negotiated_group()
5148 if (!TEST_true(SSL_CTX_set_cipher_list(sctx, in test_negotiated_group()
5151 || !TEST_true(SSL_CTX_set_dh_auto(sctx, 1))) in test_negotiated_group()
5158 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5184 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5230 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_negotiated_group()
5250 SSL_CTX_free(sctx); in test_negotiated_group()
5266 SSL_CTX *sctx = NULL, *cctx = NULL; in test_tls13_ciphersuite() local
5321 &sctx, &cctx, cert, privkey))) in test_tls13_ciphersuite()
5325 if (!TEST_true(SSL_CTX_set_ciphersuites(sctx, t13_cipher)) in test_tls13_ciphersuite()
5329 if (!TEST_true(SSL_CTX_set_cipher_list(sctx, t12_cipher)) in test_tls13_ciphersuite()
5336 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_tls13_ciphersuite()
5383 SSL_CTX_free(sctx); in test_tls13_ciphersuite()
5384 sctx = NULL; in test_tls13_ciphersuite()
5394 SSL_CTX_free(sctx); in test_tls13_ciphersuite()
5408 SSL_CTX *sctx = NULL, *cctx = NULL; in test_tls13_psk() local
5421 &sctx, &cctx, idx == 3 ? NULL : cert, in test_tls13_psk()
5454 SSL_CTX_set_psk_find_session_callback(sctx, find_session_cb); in test_tls13_psk()
5459 SSL_CTX_set_psk_server_callback(sctx, psk_server_cb); in test_tls13_psk()
5473 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5504 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5547 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5594 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_tls13_psk()
5631 SSL_CTX_free(sctx); in test_tls13_psk()
5678 SSL_CTX *sctx = NULL, *cctx = NULL; in test_stateless() local
5684 &sctx, &cctx, cert, privkey))) in test_stateless()
5690 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5707 SSL_CTX_set_stateless_cookie_generate_cb(sctx, generate_stateless_cookie_callback); in test_stateless()
5708 SSL_CTX_set_stateless_cookie_verify_cb(sctx, verify_stateless_cookie_callback); in test_stateless()
5714 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5731 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_stateless()
5755 SSL_CTX_free(sctx); in test_stateless()
5893 SSL_CTX *cctx = NULL, *sctx = NULL, *sctx2 = NULL; in test_custom_exts() local
5914 &sctx, &cctx, cert, privkey))) in test_custom_exts()
5926 SSL_CTX_set_options(sctx, SSL_OP_NO_TLSv1_3); in test_custom_exts()
5934 SSL_CTX_set_verify(sctx, in test_custom_exts()
5983 if (!TEST_true(SSL_CTX_add_server_custom_ext(sctx, TEST_EXT_TYPE1, in test_custom_exts()
5989 if (!TEST_true(SSL_CTX_add_custom_ext(sctx, TEST_EXT_TYPE1, context, in test_custom_exts()
6002 if (!TEST_false(SSL_CTX_add_server_custom_ext(sctx, TEST_EXT_TYPE1, in test_custom_exts()
6006 || !TEST_false(SSL_CTX_add_custom_ext(sctx, TEST_EXT_TYPE1, in test_custom_exts()
6014 if (!TEST_true(SSL_CTX_set_tlsext_servername_callback(sctx, sni_cb)) in test_custom_exts()
6015 || !TEST_true(SSL_CTX_set_tlsext_servername_arg(sctx, sctx2))) in test_custom_exts()
6019 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_custom_exts()
6067 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_custom_exts()
6111 SSL_CTX_free(sctx); in test_custom_exts()
6163 SSL_CTX *sctx = NULL, *cctx = NULL; in test_serverinfo_custom() local
6210 &sctx, &cctx, cert, privkey))) in test_serverinfo_custom()
6214 if (!TEST_true(SSL_CTX_use_serverinfo_ex(sctx, serverinfo_version, in test_serverinfo_custom()
6218 if (!TEST_true(SSL_CTX_use_serverinfo(sctx, si, si_len))) in test_serverinfo_custom()
6227 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_serverinfo_custom()
6242 SSL_CTX_free(sctx); in test_serverinfo_custom()
6259 SSL_CTX *cctx = NULL, *sctx = NULL, *sctx2 = NULL; in test_export_key_mat() local
6296 &sctx, &cctx, cert, privkey))) in test_export_key_mat()
6304 || !SSL_CTX_set_cipher_list(sctx, "DEFAULT:@SECLEVEL=0"))) in test_export_key_mat()
6307 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_export_key_mat()
6410 SSL_CTX_free(sctx); in test_export_key_mat()
6428 SSL_CTX *cctx = NULL, *sctx = 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()
6488 SSL_CTX_free(sctx); in test_export_key_mat_early()
6500 SSL_CTX *cctx = NULL, *sctx = NULL; in test_key_update() local
6510 &sctx, &cctx, cert, privkey)) in test_key_update()
6511 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update()
6545 SSL_CTX_free(sctx); in test_key_update()
6559 SSL_CTX *cctx = NULL, *sctx = NULL; in test_key_update_peer_in_write() local
6573 &sctx, &cctx, cert, privkey)) in test_key_update_peer_in_write()
6574 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_write()
6628 SSL_CTX_free(sctx); in test_key_update_peer_in_write()
6645 SSL_CTX *cctx = NULL, *sctx = NULL; in test_key_update_peer_in_read() local
6657 &sctx, &cctx, cert, privkey)) in test_key_update_peer_in_read()
6658 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_peer_in_read()
6714 SSL_CTX_free(sctx); in test_key_update_peer_in_read()
6728 SSL_CTX *cctx = NULL, *sctx = NULL; in test_key_update_local_in_write() local
6742 &sctx, &cctx, cert, privkey)) in test_key_update_local_in_write()
6743 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_write()
6803 SSL_CTX_free(sctx); in test_key_update_local_in_write()
6819 SSL_CTX *cctx = NULL, *sctx = NULL; in test_key_update_local_in_read() local
6831 &sctx, &cctx, cert, privkey)) in test_key_update_local_in_read()
6832 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_key_update_local_in_read()
6888 SSL_CTX_free(sctx); in test_key_update_local_in_read()
6897 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ssl_clear() local
6909 &sctx, &cctx, cert, privkey)) in test_ssl_clear()
6913 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ssl_clear()
6928 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_clear()
6943 SSL_CTX_free(sctx); in test_ssl_clear()
7064 SSL_CTX *cctx = NULL, *sctx = NULL; in test_pha_key_update() local
7070 &sctx, &cctx, cert, privkey))) in test_pha_key_update()
7073 if (!TEST_true(SSL_CTX_set_min_proto_version(sctx, TLS1_3_VERSION)) in test_pha_key_update()
7074 || !TEST_true(SSL_CTX_set_max_proto_version(sctx, TLS1_3_VERSION)) in test_pha_key_update()
7081 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pha_key_update()
7113 SSL_CTX_free(sctx); in test_pha_key_update()
7268 SSL_CTX *cctx = NULL, *sctx = NULL; in test_srp() local
7293 &sctx, &cctx, cert, privkey))) in test_srp()
7296 if (!TEST_int_gt(SSL_CTX_set_srp_username_callback(sctx, ssl_srp_cb), 0) in test_srp()
7298 || !TEST_true(SSL_CTX_set_max_proto_version(sctx, TLS1_2_VERSION)) in test_srp()
7311 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_srp()
7331 SSL_CTX_free(sctx); in test_srp()
7488 SSL_CTX *cctx = NULL, *sctx = NULL; in test_info_callback() local
7523 if (!TEST_true(setupearly_data_test(&cctx, &sctx, &clientssl, in test_info_callback()
7563 tlsvers, tlsvers, &sctx, &cctx, cert, in test_info_callback()
7567 if (!TEST_true(SSL_CTX_set_dh_auto(sctx, 1))) in test_info_callback()
7574 SSL_CTX_set_info_callback((tst % 2) == 0 ? sctx : cctx, in test_info_callback()
7577 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_info_callback()
7594 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_info_callback()
7609 SSL_CTX_free(sctx); in test_info_callback()
7616 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ssl_pending() local
7627 &sctx, &cctx, cert, privkey))) in test_ssl_pending()
7634 &sctx, &cctx, cert, privkey))) in test_ssl_pending()
7647 if (!TEST_true(SSL_CTX_set_cipher_list(sctx, "DEFAULT:@SECLEVEL=0")) in test_ssl_pending()
7657 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_pending()
7680 SSL_CTX_free(sctx); in test_ssl_pending()
7773 SSL_CTX *cctx = NULL, *sctx = NULL; in int_test_ssl_get_shared_ciphers() local
7794 sctx = SSL_CTX_new_ex(tmplibctx, NULL, TLS_server_method()); in int_test_ssl_get_shared_ciphers()
7795 if (!TEST_ptr(sctx)) in int_test_ssl_get_shared_ciphers()
7803 &sctx, &cctx, cert, privkey))) in int_test_ssl_get_shared_ciphers()
7811 || !TEST_true(SSL_CTX_set_cipher_list(sctx, in int_test_ssl_get_shared_ciphers()
7814 && !TEST_true(SSL_CTX_set_ciphersuites(sctx, in int_test_ssl_get_shared_ciphers()
7819 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in int_test_ssl_get_shared_ciphers()
7840 SSL_CTX_free(sctx); in int_test_ssl_get_shared_ciphers()
8016 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ticket_callbacks() local
8076 &sctx, &cctx, cert, privkey))) in test_ticket_callbacks()
8083 if (!TEST_true(SSL_CTX_set_session_cache_mode(sctx, SSL_SESS_CACHE_OFF))) in test_ticket_callbacks()
8086 if (!TEST_true(SSL_CTX_set_session_ticket_cb(sctx, gen_tick_cb, dec_tick_cb, in test_ticket_callbacks()
8091 if (!TEST_true(SSL_CTX_set_tlsext_ticket_key_evp_cb(sctx, tick_key_evp_cb))) in test_ticket_callbacks()
8095 if (!TEST_true(SSL_CTX_set_tlsext_ticket_key_cb(sctx, tick_key_cb))) in test_ticket_callbacks()
8100 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ticket_callbacks()
8127 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_ticket_callbacks()
8159 SSL_CTX_free(sctx); in test_ticket_callbacks()
8176 SSL_CTX *cctx = NULL, *sctx = NULL; in test_incorrect_shutdown() local
8184 &sctx, &cctx, cert, privkey))) in test_incorrect_shutdown()
8188 SSL_CTX_set_options(sctx, SSL_OP_IGNORE_UNEXPECTED_EOF); in test_incorrect_shutdown()
8190 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_incorrect_shutdown()
8214 SSL_CTX_free(sctx); in test_incorrect_shutdown()
8235 SSL_CTX *cctx = NULL, *sctx = NULL; in test_shutdown() local
8257 &sctx, &cctx, cert, privkey))) in test_shutdown()
8263 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_shutdown()
8376 SSL_CTX_free(sctx); in test_shutdown()
8486 SSL_CTX *cctx = NULL, *sctx = NULL, *snictx = NULL; in test_cert_cb_int() local
8500 &sctx, &cctx, NULL, NULL))) in test_cert_cb_int()
8516 SSL_CTX_set_cert_cb(sctx, cert_cb, snictx); in test_cert_cb_int()
8518 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_cert_cb_int()
8552 SSL_CTX_free(sctx); in test_cert_cb_int()
8612 SSL_CTX *cctx = NULL, *sctx = NULL; in test_client_cert_cb() local
8630 &sctx, &cctx, cert, privkey))) in test_client_cert_cb()
8638 SSL_CTX_set_verify(sctx, in test_client_cert_cb()
8642 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_client_cert_cb()
8653 SSL_CTX_free(sctx); in test_client_cert_cb()
8669 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ca_names_int() local
8693 &sctx, &cctx, cert, privkey))) in test_ca_names_int()
8696 SSL_CTX_set_verify(sctx, SSL_VERIFY_PEER, NULL); in test_ca_names_int()
8707 SSL_CTX_set0_CA_list(sctx, sk1); in test_ca_names_int()
8720 SSL_CTX_set_client_CA_list(sctx, sk1); in test_ca_names_int()
8725 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ca_names_int()
8768 SSL_CTX_free(sctx); in test_ca_names_int()
8819 SSL_CTX *cctx = NULL, *sctx = NULL; in test_multiblock_write() local
8848 max_version, &sctx, &cctx, cert, in test_multiblock_write()
8852 if (!TEST_true(SSL_CTX_set_max_send_fragment(sctx, MULTIBLOCK_FRAGSIZE))) in test_multiblock_write()
8855 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multiblock_write()
8885 SSL_CTX_free(sctx); in test_multiblock_write()
9025 SSL_CTX *sctx = NULL, *cctx = NULL; in test_session_cache_overflow() local
9045 &sctx, &cctx, cert, privkey)) in test_session_cache_overflow()
9046 || !TEST_true(SSL_CTX_set_options(sctx, SSL_OP_NO_TICKET))) in test_session_cache_overflow()
9049 SSL_CTX_sess_set_get_cb(sctx, get_session_cb); in test_session_cache_overflow()
9052 SSL_CTX_sess_set_cache_size(sctx, 1); in test_session_cache_overflow()
9054 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9088 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9112 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_session_cache_overflow()
9127 SSL_CTX_free(sctx); in test_session_cache_overflow()
9149 SSL_CTX *cctx = NULL, *sctx = NULL; in test_servername() local
9169 &sctx, &cctx, cert, privkey)) in test_servername()
9170 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_servername()
9175 if (!TEST_true(SSL_CTX_set_tlsext_servername_callback(sctx, in test_servername()
9208 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_servername()
9283 SSL_CTX_free(sctx); in test_servername()
9303 SSL_CTX *cctx = NULL, *sctx = NULL; in test_sigalgs_available() local
9348 sctx = SSL_CTX_new_ex(serverctx, NULL, TLS_server_method()); in test_sigalgs_available()
9349 if (!TEST_ptr(cctx) || !TEST_ptr(sctx)) in test_sigalgs_available()
9357 &sctx, &cctx, cert, privkey))) in test_sigalgs_available()
9364 &sctx, &cctx, cert2, privkey2))) in test_sigalgs_available()
9383 || !SSL_CTX_set1_sigalgs_list(sctx, in test_sigalgs_available()
9389 || !SSL_CTX_set1_sigalgs_list(sctx, in test_sigalgs_available()
9395 && (!TEST_int_eq(SSL_CTX_use_certificate_file(sctx, cert2, in test_sigalgs_available()
9397 || !TEST_int_eq(SSL_CTX_use_PrivateKey_file(sctx, in test_sigalgs_available()
9400 || !TEST_int_eq(SSL_CTX_check_private_key(sctx), 1))) in test_sigalgs_available()
9403 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_sigalgs_available()
9428 SSL_CTX_free(sctx); in test_sigalgs_available()
9444 SSL_CTX *cctx = NULL, *sctx = NULL; in test_pluggable_group() local
9459 &sctx, &cctx, cert, privkey)) in test_pluggable_group()
9460 || !TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_pluggable_group()
9482 SSL_CTX_free(sctx); in test_pluggable_group()
9494 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ssl_dup() local
9503 &sctx, &cctx, cert, privkey))) in test_ssl_dup()
9506 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_ssl_dup()
9553 SSL_CTX_free(sctx); in test_ssl_dup()
9657 SSL_CTX *cctx = NULL, *sctx = NULL; in test_set_tmp_dh() local
9688 &sctx, &cctx, cert, privkey))) in test_set_tmp_dh()
9692 if (!TEST_true(SSL_CTX_set_dh_auto(sctx, dhauto))) in test_set_tmp_dh()
9697 if (!TEST_true(SSL_CTX_set0_tmp_dh_pkey(sctx, dhpkey))) in test_set_tmp_dh()
9703 if (!TEST_true(SSL_CTX_set_tmp_dh(sctx, dh))) in test_set_tmp_dh()
9706 SSL_CTX_set_tmp_dh_callback(sctx, tmp_dh_callback); in test_set_tmp_dh()
9710 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_set_tmp_dh()
9753 SSL_CTX_free(sctx); in test_set_tmp_dh()
9765 SSL_CTX *cctx = NULL, *sctx = NULL; in test_dh_auto() local
9824 &sctx, &cctx, thiscert, thiskey))) in test_dh_auto()
9827 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_dh_auto()
9860 SSL_CTX_free(sctx); in test_dh_auto()
9878 SSL_CTX *cctx = NULL, *sctx = NULL, *sctx2 = NULL; in test_sni_tls13() local
9886 sctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method()); in test_sni_tls13()
9887 if (!TEST_ptr(sctx)) in test_sni_tls13()
9896 if (!TEST_true(SSL_CTX_set_tlsext_servername_callback(sctx, sni_cb)) in test_sni_tls13()
9897 || !TEST_true(SSL_CTX_set_tlsext_servername_arg(sctx, sctx2))) in test_sni_tls13()
9904 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_sni_tls13()
9920 SSL_CTX_free(sctx); in test_sni_tls13()
9932 SSL_CTX *cctx = NULL, *sctx = NULL; in test_ticket_lifetime() local
9950 &sctx, &cctx, cert, privkey))) in test_ticket_lifetime()
9953 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_ticket_lifetime()
9961 if (!TEST_long_eq(SSL_CTX_set_timeout(sctx, TWO_WEEK_SEC), in test_ticket_lifetime()
9982 SSL_CTX_free(sctx); in test_ticket_lifetime()
10322 SSL_CTX *cctx = NULL, *sctx = NULL; in test_pipelining() local
10341 TLS1_2_VERSION, &sctx, &cctx, cert, in test_pipelining()
10353 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_pipelining()
10486 SSL_CTX_free(sctx); in test_pipelining()
10519 SSL_CTX *cctx = NULL, *sctx = NULL; in test_handshake_retry() local
10538 &sctx, &cctx, cert, privkey))) in test_handshake_retry()
10545 if ((idx & 1) == 1 && !add_large_cert_chain(sctx)) in test_handshake_retry()
10553 SSL_CTX_set_verify(sctx, SSL_VERIFY_PEER, NULL); in test_handshake_retry()
10558 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, in test_handshake_retry()
10588 SSL_CTX_free(sctx); in test_handshake_retry()
10599 SSL_CTX *sctx; member
10622 if (!TEST_true(create_ssl_objects(cbdata->sctx, cbdata->cctx, &serverssl, in resume_servername_cb()
10656 SSL_CTX *sctx = NULL, *cctx = NULL; in test_multi_resume() local
10677 max_version, &sctx, &cctx, cert, in test_multi_resume()
10686 if (!TEST_true(SSL_CTX_set_max_early_data(sctx, 1024))) in test_multi_resume()
10690 SSL_CTX_set_options(sctx, SSL_OP_NO_TICKET); in test_multi_resume()
10692 SSL_CTX_sess_set_cache_size(sctx, 5); in test_multi_resume()
10695 SSL_CTX_set_tlsext_servername_callback(sctx, resume_servername_cb); in test_multi_resume()
10696 SSL_CTX_set_tlsext_servername_arg(sctx, &cbdata); in test_multi_resume()
10698 cbdata.sctx = sctx; in test_multi_resume()
10703 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, in test_multi_resume()
10755 if (!TEST_long_le(SSL_CTX_sess_number(sctx), 5)) in test_multi_resume()
10762 SSL_CTX_free(sctx); in test_multi_resume()
10967 SSL_CTX *sctx = NULL, *cctx = NULL; in test_npn() local
10973 &sctx, &cctx, cert, privkey))) in test_npn()
10976 SSL_CTX_set_next_protos_advertised_cb(sctx, npn_advert_cb, &idx); in test_npn()
10979 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_npn()
11021 SSL_CTX_free(sctx); in test_npn()
11065 SSL_CTX *sctx = NULL, *cctx = NULL; in test_alpn() local
11073 &sctx, &cctx, cert, privkey))) in test_alpn()
11076 SSL_CTX_set_alpn_select_cb(sctx, alpn_select_cb2, &idx); in test_alpn()
11078 if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, &clientssl, NULL, in test_alpn()
11124 SSL_CTX_free(sctx); in test_alpn()