Lines Matching defs:config
120 static bool SetConfigPtr(SSL *ssl, const TestConfig *config) {
121 return SSL_set_ex_data(ssl, g_config_index, (void *)config) == 1;
295 const TestConfig *config = GetConfigPtr(ssl);
298 if (!config->digest_prefs.empty()) {
300 strdup(config->digest_prefs.c_str()));
319 if (!config->key_file.empty()) {
320 if (config->async) {
321 test_state->private_key = LoadPrivateKey(config->key_file.c_str());
326 } else if (!SSL_use_PrivateKey_file(ssl, config->key_file.c_str(),
331 if (!config->cert_file.empty() &&
332 !SSL_use_certificate_file(ssl, config->cert_file.c_str(),
336 if (!config->ocsp_response.empty() &&
338 (const uint8_t *)config->ocsp_response.data(),
339 config->ocsp_response.size())) {
346 const TestConfig *config = GetConfigPtr(ctx->ssl);
349 if (!config->expected_server_name.empty()) {
374 (const uint8_t*)config->expected_server_name.data(),
375 config->expected_server_name.size())) {
380 if (config->fail_early_callback) {
385 if (config->use_early_callback) {
386 if (config->async) {
400 const TestConfig *config = GetConfigPtr(ssl);
402 if (!config->expected_ocsp_response.empty()) {
422 const TestConfig *config = GetConfigPtr(ssl);
423 if (config->advertise_npn.empty()) {
427 *out = (const uint8_t*)config->advertise_npn.data();
428 *out_len = config->advertise_npn.size();
434 const TestConfig *config = GetConfigPtr(ssl);
435 if (config->select_next_proto.empty()) {
439 *out = (uint8_t*)config->select_next_proto.data();
440 *outlen = config->select_next_proto.size();
446 const TestConfig *config = GetConfigPtr(ssl);
447 if (config->select_alpn.empty()) {
451 if (!config->expected_advertised_alpn.empty() &&
452 (config->expected_advertised_alpn.size() != inlen ||
453 memcmp(config->expected_advertised_alpn.data(),
459 *out = (const uint8_t*)config->select_alpn.data();
460 *outlen = config->select_alpn.size();
468 const TestConfig *config = GetConfigPtr(ssl);
470 if (strcmp(hint ? hint : "", config->psk_identity.c_str()) != 0) {
476 if (config->psk_identity.size() >= max_identity_len ||
477 config->psk.size() > max_psk_len) {
482 BUF_strlcpy(out_identity, config->psk_identity.c_str(),
484 memcpy(out_psk, config->psk.data(), config->psk.size());
485 return config->psk.size();
490 const TestConfig *config = GetConfigPtr(ssl);
492 if (strcmp(identity, config->psk_identity.c_str()) != 0) {
497 if (config->psk.size() > max_psk_len) {
502 memcpy(out_psk, config->psk.data(), config->psk.size());
503 return config->psk.size();
538 const TestConfig *config = GetConfigPtr(early_context->ssl);
542 if (config->fail_ddos_callback ||
543 (config->fail_second_ddos_callback && callback_num == 2)) {
707 static ScopedSSL_CTX SetupCtx(const TestConfig *config) {
709 config->is_dtls ? DTLS_method() : TLS_method()));
715 if (!config->cipher.empty()) {
716 cipher_list = config->cipher;
723 if (!config->cipher_tls10.empty() &&
725 config->cipher_tls10.c_str())) {
728 if (!config->cipher_tls11.empty() &&
730 config->cipher_tls11.c_str())) {
736 if (config->use_sparse_dh_prime) {
757 if (config->async && config->is_server) {
771 if (!config->select_next_proto.empty()) {
776 if (!config->select_alpn.empty()) {
788 if (config->use_ticket_callback) {
792 if (config->enable_client_custom_extension &&
800 if (config->enable_server_custom_extension &&
808 if (config->verify_fail) {
814 if (!config->signed_cert_timestamps.empty() &&
816 ssl_ctx.get(), (const uint8_t *)config->signed_cert_timestamps.data(),
817 config->signed_cert_timestamps.size())) {
833 const TestConfig *config = GetConfigPtr(ssl);
846 if (config->async) {
850 if (config->async) {
898 const TestConfig *config = GetConfigPtr(ssl);
902 if (config->async) {
909 if (config->async) {
912 } while (config->async && RetryAsync(ssl, ret));
919 const TestConfig *config = GetConfigPtr(ssl);
927 } while ((config->async && RetryAsync(ssl, ret)) || (ret > 0 && in_len > 0));
934 const TestConfig *config = GetConfigPtr(ssl);
938 } while (config->async && RetryAsync(ssl, ret));
946 const TestConfig *config = GetConfigPtr(ssl);
954 (!!SSL_session_reused(ssl) == config->expect_session_miss)) {
960 bool expect_handshake_done = is_resume || !config->false_start;
967 if (expect_handshake_done && !config->is_server) {
969 !config->expect_no_session &&
970 (!SSL_session_reused(ssl) || config->expect_ticket_renewal);
979 if (config->is_server && !GetTestState(ssl)->early_callback_called) {
984 if (!config->expected_server_name.empty()) {
987 if (server_name != config->expected_server_name) {
989 server_name, config->expected_server_name.c_str());
994 if (!config->expected_certificate_types.empty()) {
998 if (certificate_types_len != config->expected_certificate_types.size() ||
1000 config->expected_certificate_types.data(),
1007 if (!config->expected_next_proto.empty()) {
1011 if (next_proto_len != config->expected_next_proto.size() ||
1012 memcmp(next_proto, config->expected_next_proto.data(),
1019 if (!config->expected_alpn.empty()) {
1023 if (alpn_proto_len != config->expected_alpn.size() ||
1024 config->expected_alpn.data(),
1031 if (!config->expected_channel_id.empty()) {
1037 if (config->expected_channel_id.size() != 64 ||
1038 memcmp(config->expected_channel_id.data(),
1045 if (config->expect_extended_master_secret) {
1052 if (!config->expected_ocsp_response.empty()) {
1056 if (config->expected_ocsp_response.size() != len ||
1057 memcmp(config->expected_ocsp_response.data(), data, len) != 0) {
1063 if (!config->expected_signed_cert_timestamps.empty()) {
1067 if (config->expected_signed_cert_timestamps.size() != len ||
1068 memcmp(config->expected_signed_cert_timestamps.data(),
1075 if (config->expect_verify_result) {
1076 int expected_verify_result = config->verify_fail ?
1086 if (config->expect_server_key_exchange_hash != 0 &&
1087 config->expect_server_key_exchange_hash !=
1091 config->expect_server_key_exchange_hash);
1095 if (config->expect_key_exchange_info != 0) {
1097 if (static_cast<uint32_t>(config->expect_key_exchange_info) != info) {
1099 info, static_cast<uint32_t>(config->expect_key_exchange_info));
1104 if (!config->is_server) {
1107 if (config->psk.empty()) {
1125 const TestConfig *config, bool is_resume,
1132 if (!SetConfigPtr(ssl.get(), config) ||
1137 if (config->fallback_scsv &&
1141 if (!config->use_early_callback) {
1142 if (config->async) {
1149 if (config->require_any_client_certificate) {
1153 if (config->verify_peer) {
1156 if (config->false_start) {
1159 if (config->cbc_record_splitting) {
1162 if (config->partial_write) {
1165 if (config->no_tls12) {
1168 if (config->no_tls11) {
1171 if (config->no_tls1) {
1174 if (config->no_ssl3) {
1177 if (!config->expected_channel_id.empty()) {
1180 if (!config->send_channel_id.empty()) {
1182 if (!config->async) {
1184 ScopedEVP_PKEY pkey = LoadPrivateKey(config->send_channel_id);
1190 if (!config->host_name.empty() &&
1191 !SSL_set_tlsext_host_name(ssl.get(), config->host_name.c_str())) {
1194 if (!config->advertise_alpn.empty() &&
1196 (const uint8_t *)config->advertise_alpn.data(),
1197 config->advertise_alpn.size()) != 0) {
1200 if (!config->psk.empty()) {
1204 if (!config->psk_identity.empty() &&
1205 !SSL_use_psk_identity_hint(ssl.get(), config->psk_identity.c_str())) {
1208 if (!config->srtp_profiles.empty() &&
1209 !SSL_set_srtp_profiles(ssl.get(), config->srtp_profiles.c_str())) {
1212 if (config->enable_ocsp_stapling &&
1216 if (config->enable_signed_cert_timestamps &&
1220 if (config->min_version != 0) {
1221 SSL_set_min_version(ssl.get(), (uint16_t)config->min_version);
1223 if (config->max_version != 0) {
1224 SSL_set_max_version(ssl.get(), (uint16_t)config->max_version);
1226 if (config->mtu != 0) {
1228 SSL_set_mtu(ssl.get(), config->mtu);
1230 if (config->install_ddos_callback) {
1233 if (config->renegotiate_once) {
1236 if (config->renegotiate_freely) {
1239 if (config->renegotiate_ignore) {
1242 if (!config->check_close_notify) {
1245 if (config->disable_npn) {
1248 if (config->p384_only) {
1254 if (config->enable_all_curves) {
1264 int sock = Connect(config->port);
1274 if (config->is_dtls) {
1280 if (config->async) {
1282 config->is_dtls ? AsyncBioCreateDatagram() : AsyncBioCreate();
1291 if (!config->is_server) {
1295 } else if (config->async) {
1309 if (config->implicit_handshake) {
1310 if (config->is_server) {
1317 if (config->is_server) {
1322 } while (config->async && RetryAsync(ssl.get(), ret));
1333 if (config->export_keying_material > 0) {
1335 static_cast<size_t>(config->export_keying_material));
1338 config->export_label.data(), config->export_label.size(),
1339 reinterpret_cast<const uint8_t*>(config->export_context.data()),
1340 config->export_context.size(), config->use_export_context)) {
1349 if (config->tls_unique) {
1369 if (config->write_different_record_sizes) {
1370 if (config->is_dtls) {
1393 if (config->shim_writes_first) {
1399 if (!config->shim_shuts_down) {
1406 int n = DoRead(ssl.get(), buf.get(), config->is_dtls ? kBufLen : 512);
1446 if (!config->is_server && !config->false_start &&
1447 !config->implicit_handshake &&
1459 if (config->shim_shuts_down && config->check_close_notify) {
1476 config->expect_total_renegotiations) {
1478 config->expect_total_renegotiations,
1511 TestConfig config;
1512 if (!ParseConfig(argc - 1, argv + 1, &config)) {
1516 ScopedSSL_CTX ssl_ctx = SetupCtx(&config);
1523 if (!DoExchange(&session, ssl_ctx.get(), &config, false /* is_resume */,
1529 if (config.resume &&
1530 !DoExchange(NULL, ssl_ctx.get(), &config, true /* is_resume */,