Lines Matching refs:test_ctx
34 static int check_result(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_result() argument
36 if (!TEST_int_eq(result->result, test_ctx->expected_result)) { in check_result()
38 ssl_test_result_name(test_ctx->expected_result), in check_result()
45 static int check_alerts(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_alerts() argument
75 if (test_ctx->expected_client_alert in check_alerts()
81 && (result->client_alert_sent & 0xff) != test_ctx->expected_client_alert) { in check_alerts()
83 print_alert(test_ctx->expected_client_alert), in check_alerts()
88 if (test_ctx->expected_server_alert in check_alerts()
89 && (result->server_alert_sent & 0xff) != test_ctx->expected_server_alert) { in check_alerts()
91 print_alert(test_ctx->expected_server_alert), in check_alerts()
103 static int check_protocol(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_protocol() argument
112 if (test_ctx->expected_protocol) { in check_protocol()
114 test_ctx->expected_protocol)) { in check_protocol()
116 ssl_protocol_name(test_ctx->expected_protocol), in check_protocol()
124 static int check_servername(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_servername() argument
126 if (!TEST_int_eq(result->servername, test_ctx->expected_servername)) { in check_servername()
128 ssl_servername_name(test_ctx->expected_servername), in check_servername()
135 static int check_session_ticket(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_session_ticket() argument
137 if (test_ctx->session_ticket_expected == SSL_TEST_SESSION_TICKET_IGNORE) in check_session_ticket()
140 test_ctx->session_ticket_expected)) { in check_session_ticket()
142 ssl_session_ticket_name(test_ctx->session_ticket_expected), in check_session_ticket()
149 static int check_session_id(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_session_id() argument
151 if (test_ctx->session_id_expected == SSL_TEST_SESSION_ID_IGNORE) in check_session_id()
153 if (!TEST_int_eq(result->session_id, test_ctx->session_id_expected)) { in check_session_id()
155 ssl_session_id_name(test_ctx->session_id_expected), in check_session_id()
162 static int check_compression(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_compression() argument
164 if (!TEST_int_eq(result->compression, test_ctx->compression_expected)) in check_compression()
169 static int check_npn(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_npn() argument
175 if (!TEST_str_eq(test_ctx->expected_npn_protocol, in check_npn()
182 static int check_alpn(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_alpn() argument
188 if (!TEST_str_eq(test_ctx->expected_alpn_protocol, in check_alpn()
195 SSL_TEST_CTX *test_ctx) in check_session_ticket_app_data() argument
203 if (test_ctx->expected_session_ticket_app_data != NULL) in check_session_ticket_app_data()
204 expected_len = strlen(test_ctx->expected_session_ticket_app_data); in check_session_ticket_app_data()
209 test_ctx->expected_session_ticket_app_data)) in check_session_ticket_app_data()
215 static int check_resumption(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_resumption() argument
219 if (!TEST_int_eq(result->client_resumed, test_ctx->resumption_expected)) in check_resumption()
281 static int check_tmp_key(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_tmp_key() argument
283 return check_nid("Tmp key", test_ctx->expected_tmp_key_type, in check_tmp_key()
288 SSL_TEST_CTX *test_ctx) in check_server_cert_type() argument
290 return check_nid("Server certificate", test_ctx->expected_server_cert_type, in check_server_cert_type()
295 SSL_TEST_CTX *test_ctx) in check_server_sign_hash() argument
297 return check_nid("Server signing hash", test_ctx->expected_server_sign_hash, in check_server_sign_hash()
302 SSL_TEST_CTX *test_ctx) in check_server_sign_type() argument
304 return check_nid("Server signing", test_ctx->expected_server_sign_type, in check_server_sign_type()
309 SSL_TEST_CTX *test_ctx) in check_server_ca_names() argument
312 test_ctx->expected_server_ca_names, in check_server_ca_names()
317 SSL_TEST_CTX *test_ctx) in check_client_cert_type() argument
319 return check_nid("Client certificate", test_ctx->expected_client_cert_type, in check_client_cert_type()
324 SSL_TEST_CTX *test_ctx) in check_client_sign_hash() argument
326 return check_nid("Client signing hash", test_ctx->expected_client_sign_hash, in check_client_sign_hash()
331 SSL_TEST_CTX *test_ctx) in check_client_sign_type() argument
333 return check_nid("Client signing", test_ctx->expected_client_sign_type, in check_client_sign_type()
338 SSL_TEST_CTX *test_ctx) in check_client_ca_names() argument
341 test_ctx->expected_client_ca_names, in check_client_ca_names()
345 static int check_cipher(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_cipher() argument
347 if (test_ctx->expected_cipher == NULL) in check_cipher()
351 if (!TEST_str_eq(test_ctx->expected_cipher, in check_cipher()
362 static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_test() argument
365 ret &= check_result(result, test_ctx); in check_test()
366 ret &= check_alerts(result, test_ctx); in check_test()
368 ret &= check_protocol(result, test_ctx); in check_test()
369 ret &= check_servername(result, test_ctx); in check_test()
370 ret &= check_session_ticket(result, test_ctx); in check_test()
371 ret &= check_compression(result, test_ctx); in check_test()
372 ret &= check_session_id(result, test_ctx); in check_test()
375 ret &= check_npn(result, test_ctx); in check_test()
377 ret &= check_cipher(result, test_ctx); in check_test()
378 ret &= check_alpn(result, test_ctx); in check_test()
379 ret &= check_session_ticket_app_data(result, test_ctx); in check_test()
380 ret &= check_resumption(result, test_ctx); in check_test()
381 ret &= check_tmp_key(result, test_ctx); in check_test()
382 ret &= check_server_cert_type(result, test_ctx); in check_test()
383 ret &= check_server_sign_hash(result, test_ctx); in check_test()
384 ret &= check_server_sign_type(result, test_ctx); in check_test()
385 ret &= check_server_ca_names(result, test_ctx); in check_test()
386 ret &= check_client_cert_type(result, test_ctx); in check_test()
387 ret &= check_client_sign_hash(result, test_ctx); in check_test()
388 ret &= check_client_sign_type(result, test_ctx); in check_test()
389 ret &= check_client_ca_names(result, test_ctx); in check_test()
399 SSL_TEST_CTX *test_ctx = NULL; in test_handshake() local
405 test_ctx = SSL_TEST_CTX_create(conf, test_app, libctx); in test_handshake()
406 if (!TEST_ptr(test_ctx)) in test_handshake()
410 if (test_ctx->fips_version != NULL in test_handshake()
411 && !fips_provider_version_match(libctx, test_ctx->fips_version)) { in test_handshake()
417 if (test_ctx->method == SSL_TEST_METHOD_DTLS) { in test_handshake()
423 if (test_ctx->extra.server.servername_callback != in test_handshake()
434 if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) { in test_handshake()
451 if (test_ctx->method == SSL_TEST_METHOD_TLS) { in test_handshake()
467 if (test_ctx->extra.server.servername_callback != in test_handshake()
482 if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) { in test_handshake()
526 resume_server_ctx, resume_client_ctx, test_ctx); in test_handshake()
529 ret = check_test(result, test_ctx); in test_handshake()
538 SSL_TEST_CTX_free(test_ctx); in test_handshake()