Lines Matching refs:config
180 const TestConfig *config = GetTestConfig(ssl); in DoRead() local
184 if (config->async) { in DoRead()
191 return config->peek_then_read ? SSL_peek(ssl, out, max_out) in DoRead()
194 if (config->async) { in DoRead()
200 if (config->use_exporter_between_reads) { in DoRead()
207 } while (config->async && RetryAsync(ssl, ret)); in DoRead()
209 if (config->peek_then_read && ret > 0) { in DoRead()
236 const TestConfig *config = GetTestConfig(ssl); in WriteAll() local
244 } while ((config->async && RetryAsync(ssl, ret)) || (ret > 0 && in_len > 0)); in WriteAll()
251 const TestConfig *config = GetTestConfig(ssl); in DoShutdown() local
255 } while (config->async && RetryAsync(ssl, ret)); in DoShutdown()
262 const TestConfig *config = GetTestConfig(ssl); in DoSendFatalAlert() local
266 } while (config->async && RetryAsync(ssl, ret)); in DoSendFatalAlert()
281 const TestConfig *config) { in CheckAuthProperties() argument
282 if (!config->expected_ocsp_response.empty()) { in CheckAuthProperties()
286 if (config->expected_ocsp_response.size() != len || in CheckAuthProperties()
287 OPENSSL_memcmp(config->expected_ocsp_response.data(), data, len) != 0) { in CheckAuthProperties()
293 if (!config->expected_signed_cert_timestamps.empty()) { in CheckAuthProperties()
297 if (config->expected_signed_cert_timestamps.size() != len || in CheckAuthProperties()
298 OPENSSL_memcmp(config->expected_signed_cert_timestamps.data(), data, in CheckAuthProperties()
305 if (config->expect_verify_result) { in CheckAuthProperties()
306 int expected_verify_result = config->verify_fail ? in CheckAuthProperties()
316 if (!config->expect_peer_cert_file.empty()) { in CheckAuthProperties()
320 config->expect_peer_cert_file)) { in CheckAuthProperties()
326 if (!config->is_server) { in CheckAuthProperties()
357 config->expect_sha256_client_cert) { in CheckAuthProperties()
360 config->expect_sha256_client_cert, is_resume); in CheckAuthProperties()
364 if (config->expect_sha256_client_cert && in CheckAuthProperties()
396 const TestConfig *config) { in CheckHandshakeProperties() argument
397 if (!CheckAuthProperties(ssl, is_resume, config)) { in CheckHandshakeProperties()
406 if (config->expect_version != 0 && in CheckHandshakeProperties()
407 SSL_version(ssl) != config->expect_version) { in CheckHandshakeProperties()
408 fprintf(stderr, "want version %04x, got %04x\n", config->expect_version, in CheckHandshakeProperties()
414 is_resume && (!config->expect_session_miss || SSL_in_early_data(ssl)); in CheckHandshakeProperties()
422 (is_resume || !config->false_start) && !SSL_in_early_data(ssl); in CheckHandshakeProperties()
429 if (expect_handshake_done && !config->is_server) { in CheckHandshakeProperties()
431 !config->expect_no_session && in CheckHandshakeProperties()
432 (!SSL_session_reused(ssl) || config->expect_ticket_renewal) && in CheckHandshakeProperties()
444 if (config->expect_session_id && !GetTestState(ssl)->got_new_session) { in CheckHandshakeProperties()
448 if (config->expect_no_session_id && GetTestState(ssl)->got_new_session) { in CheckHandshakeProperties()
456 if (!config->handoff && config->is_server && in CheckHandshakeProperties()
462 if (!config->expected_server_name.empty()) { in CheckHandshakeProperties()
466 server_name != config->expected_server_name) { in CheckHandshakeProperties()
468 server_name, config->expected_server_name.c_str()); in CheckHandshakeProperties()
473 if (!config->expected_next_proto.empty()) { in CheckHandshakeProperties()
477 if (next_proto_len != config->expected_next_proto.size() || in CheckHandshakeProperties()
478 OPENSSL_memcmp(next_proto, config->expected_next_proto.data(), in CheckHandshakeProperties()
485 if (!config->is_server) { in CheckHandshakeProperties()
489 if (alpn_proto_len != config->expected_alpn.size() || in CheckHandshakeProperties()
490 OPENSSL_memcmp(alpn_proto, config->expected_alpn.data(), in CheckHandshakeProperties()
497 if (!config->expected_quic_transport_params.empty()) { in CheckHandshakeProperties()
501 if (peer_params_len != config->expected_quic_transport_params.size() || in CheckHandshakeProperties()
503 config->expected_quic_transport_params.data(), in CheckHandshakeProperties()
510 if (!config->expected_channel_id.empty()) { in CheckHandshakeProperties()
516 if (config->expected_channel_id.size() != 64 || in CheckHandshakeProperties()
517 OPENSSL_memcmp(config->expected_channel_id.data(), channel_id, 64) != in CheckHandshakeProperties()
524 if (config->expected_token_binding_param != -1) { in CheckHandshakeProperties()
530 static_cast<uint8_t>(config->expected_token_binding_param)) { in CheckHandshakeProperties()
536 if (config->expect_extended_master_secret && !SSL_get_extms_support(ssl)) { in CheckHandshakeProperties()
541 if (config->expect_secure_renegotiation && in CheckHandshakeProperties()
547 if (config->expect_no_secure_renegotiation && in CheckHandshakeProperties()
554 if (config->expect_peer_signature_algorithm != 0 && in CheckHandshakeProperties()
555 config->expect_peer_signature_algorithm != in CheckHandshakeProperties()
559 config->expect_peer_signature_algorithm); in CheckHandshakeProperties()
563 if (config->expect_curve_id != 0) { in CheckHandshakeProperties()
565 if (static_cast<uint16_t>(config->expect_curve_id) != curve_id) { in CheckHandshakeProperties()
567 static_cast<uint16_t>(config->expect_curve_id)); in CheckHandshakeProperties()
574 if (config->expect_cipher_aes != 0 && in CheckHandshakeProperties()
576 static_cast<uint16_t>(config->expect_cipher_aes) != cipher_id) { in CheckHandshakeProperties()
578 cipher_id, static_cast<uint16_t>(config->expect_cipher_aes)); in CheckHandshakeProperties()
582 if (config->expect_cipher_no_aes != 0 && in CheckHandshakeProperties()
584 static_cast<uint16_t>(config->expect_cipher_no_aes) != cipher_id) { in CheckHandshakeProperties()
586 cipher_id, static_cast<uint16_t>(config->expect_cipher_no_aes)); in CheckHandshakeProperties()
591 if ((config->expect_accept_early_data && !SSL_early_data_accepted(ssl)) || in CheckHandshakeProperties()
592 (config->expect_reject_early_data && SSL_early_data_accepted(ssl))) { in CheckHandshakeProperties()
600 if (!config->psk.empty()) { in CheckHandshakeProperties()
605 } else if (!config->is_server || config->require_any_client_certificate) { in CheckHandshakeProperties()
612 if (is_resume && config->expect_ticket_age_skew != 0 && in CheckHandshakeProperties()
613 SSL_get_ticket_age_skew(ssl) != config->expect_ticket_age_skew) { in CheckHandshakeProperties()
615 SSL_get_ticket_age_skew(ssl), config->expect_ticket_age_skew); in CheckHandshakeProperties()
619 if (config->expect_tls13_downgrade != !!SSL_is_tls13_downgrade(ssl)) { in CheckHandshakeProperties()
630 const TestConfig *config, bool is_resume, bool is_retry,
638 SSL_CTX *ssl_ctx, const TestConfig *config, in DoConnection() argument
641 bssl::UniquePtr<SSL> ssl = config->NewSSL( in DoConnection()
646 if (config->is_server) { in DoConnection()
652 int sock = Connect(config->port); in DoConnection()
662 if (config->is_dtls) { in DoConnection()
671 if (config->async) { in DoConnection()
673 config->is_dtls ? AsyncBioCreateDatagram() : AsyncBioCreate(); in DoConnection()
684 bool ret = DoExchange(out_session, &ssl, config, is_resume, false, writer); in DoConnection()
685 if (!config->is_server && is_resume && config->expect_reject_early_data) { in DoConnection()
699 !CheckHandshakeProperties(ssl.get(), is_resume, config)) { in DoConnection()
719 assert(!config->handoff); in DoConnection()
731 if (!config->expect_msg_callback.empty() && in DoConnection()
733 config->expect_msg_callback) { in DoConnection()
735 config->expect_msg_callback.c_str(), in DoConnection()
745 const TestConfig *config, bool is_resume, bool is_retry, in DoExchange() argument
751 if (!config->implicit_handshake) { in DoExchange()
752 if (config->handoff) { in DoExchange()
768 } while (config->async && RetryAsync(ssl, ret)); in DoExchange()
770 if (config->forbid_renegotiation_after_handshake) { in DoExchange()
774 if (ret != 1 || !CheckHandshakeProperties(ssl, is_resume, config)) { in DoExchange()
780 if (is_resume && !is_retry && !config->is_server && in DoExchange()
781 config->expect_no_offer_early_data && SSL_in_early_data(ssl)) { in DoExchange()
786 if (config->handshake_twice) { in DoExchange()
789 } while (config->async && RetryAsync(ssl, ret)); in DoExchange()
796 if (config->no_op_extra_handshake && in DoExchange()
807 if (config->export_early_keying_material > 0) { in DoExchange()
809 static_cast<size_t>(config->export_early_keying_material)); in DoExchange()
811 ssl, result.data(), result.size(), config->export_label.data(), in DoExchange()
812 config->export_label.size(), in DoExchange()
813 reinterpret_cast<const uint8_t *>(config->export_context.data()), in DoExchange()
814 config->export_context.size())) { in DoExchange()
823 if (config->export_keying_material > 0) { in DoExchange()
825 static_cast<size_t>(config->export_keying_material)); in DoExchange()
827 ssl, result.data(), result.size(), config->export_label.data(), in DoExchange()
828 config->export_label.size(), in DoExchange()
829 reinterpret_cast<const uint8_t *>(config->export_context.data()), in DoExchange()
830 config->export_context.size(), config->use_export_context)) { in DoExchange()
839 if (config->export_traffic_secrets) { in DoExchange()
856 if (config->tls_unique) { in DoExchange()
876 if (config->send_alert) { in DoExchange()
883 if (config->write_different_record_sizes) { in DoExchange()
884 if (config->is_dtls) { in DoExchange()
908 if (config->read_with_unfinished_write) { in DoExchange()
909 if (!config->async) { in DoExchange()
923 } else if (config->shim_writes_first) { in DoExchange()
928 if (!config->shim_shuts_down) { in DoExchange()
932 size_t read_size = config->is_dtls ? 16384 : 512; in DoExchange()
933 if (config->read_size > 0) { in DoExchange()
934 read_size = config->read_size; in DoExchange()
961 if (!config->is_server && is_resume && !is_retry && in DoExchange()
962 config->expect_reject_early_data) { in DoExchange()
984 if (config->key_update && in DoExchange()
1000 if (!config->is_server && !config->false_start && in DoExchange()
1001 !config->implicit_handshake && in DoExchange()
1009 if (GetProtocolVersion(ssl) >= TLS1_3_VERSION && !config->is_server) { in DoExchange()
1011 !config->expect_no_session && !config->shim_shuts_down; in DoExchange()
1022 if (config->expect_ticket_supports_early_data != got_early_data) { in DoExchange()
1038 if (config->shim_shuts_down && config->check_close_notify) { in DoExchange()
1069 if (!CheckAuthProperties(ssl, is_resume, config)) { in DoExchange()
1074 if (SSL_total_renegotiations(ssl) != config->expect_total_renegotiations) { in DoExchange()
1076 config->expect_total_renegotiations, SSL_total_renegotiations(ssl)); in DoExchange()
1132 TestConfig *config = is_resume ? &resume_config : &initial_config; in main() local
1133 ssl_ctx = config->SetupCtx(ssl_ctx.get()); in main()
1146 if (!writer.Init(i, config, offer_session.get())) { in main()
1150 bool ok = DoConnection(&session, ssl_ctx.get(), config, &retry_config, in main()
1162 if (config->resumption_delay != 0) { in main()
1163 AdvanceClock(config->resumption_delay); in main()