Lines Matching refs:test_ctx
31 static int check_result(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_result() argument
33 if (!TEST_int_eq(result->result, test_ctx->expected_result)) { in check_result()
35 ssl_test_result_name(test_ctx->expected_result), in check_result()
42 static int check_alerts(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_alerts() argument
72 if (test_ctx->expected_client_alert in check_alerts()
78 && (result->client_alert_sent & 0xff) != test_ctx->expected_client_alert) { in check_alerts()
80 print_alert(test_ctx->expected_client_alert), in check_alerts()
85 if (test_ctx->expected_server_alert in check_alerts()
86 && (result->server_alert_sent & 0xff) != test_ctx->expected_server_alert) { in check_alerts()
88 print_alert(test_ctx->expected_server_alert), in check_alerts()
100 static int check_protocol(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_protocol() argument
109 if (test_ctx->expected_protocol) { in check_protocol()
111 test_ctx->expected_protocol)) { in check_protocol()
113 ssl_protocol_name(test_ctx->expected_protocol), in check_protocol()
121 static int check_servername(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_servername() argument
123 if (!TEST_int_eq(result->servername, test_ctx->expected_servername)) { in check_servername()
125 ssl_servername_name(test_ctx->expected_servername), in check_servername()
132 static int check_session_ticket(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_session_ticket() argument
134 if (test_ctx->session_ticket_expected == SSL_TEST_SESSION_TICKET_IGNORE) in check_session_ticket()
137 test_ctx->session_ticket_expected)) { in check_session_ticket()
139 ssl_session_ticket_name(test_ctx->session_ticket_expected), in check_session_ticket()
146 static int check_session_id(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_session_id() argument
148 if (test_ctx->session_id_expected == SSL_TEST_SESSION_ID_IGNORE) in check_session_id()
150 if (!TEST_int_eq(result->session_id, test_ctx->session_id_expected)) { in check_session_id()
152 ssl_session_id_name(test_ctx->session_id_expected), in check_session_id()
159 static int check_compression(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_compression() argument
161 if (!TEST_int_eq(result->compression, test_ctx->compression_expected)) in check_compression()
166 static int check_npn(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_npn() argument
172 if (!TEST_str_eq(test_ctx->expected_npn_protocol, in check_npn()
179 static int check_alpn(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_alpn() argument
185 if (!TEST_str_eq(test_ctx->expected_alpn_protocol, in check_alpn()
192 SSL_TEST_CTX *test_ctx) in check_session_ticket_app_data() argument
200 if (test_ctx->expected_session_ticket_app_data != NULL) in check_session_ticket_app_data()
201 expected_len = strlen(test_ctx->expected_session_ticket_app_data); in check_session_ticket_app_data()
206 test_ctx->expected_session_ticket_app_data)) in check_session_ticket_app_data()
212 static int check_resumption(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_resumption() argument
216 if (!TEST_int_eq(result->client_resumed, test_ctx->resumption_expected)) in check_resumption()
278 static int check_tmp_key(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_tmp_key() argument
280 return check_nid("Tmp key", test_ctx->expected_tmp_key_type, in check_tmp_key()
285 SSL_TEST_CTX *test_ctx) in check_server_cert_type() argument
287 return check_nid("Server certificate", test_ctx->expected_server_cert_type, in check_server_cert_type()
292 SSL_TEST_CTX *test_ctx) in check_server_sign_hash() argument
294 return check_nid("Server signing hash", test_ctx->expected_server_sign_hash, in check_server_sign_hash()
299 SSL_TEST_CTX *test_ctx) in check_server_sign_type() argument
301 return check_nid("Server signing", test_ctx->expected_server_sign_type, in check_server_sign_type()
306 SSL_TEST_CTX *test_ctx) in check_server_ca_names() argument
309 test_ctx->expected_server_ca_names, in check_server_ca_names()
314 SSL_TEST_CTX *test_ctx) in check_client_cert_type() argument
316 return check_nid("Client certificate", test_ctx->expected_client_cert_type, in check_client_cert_type()
321 SSL_TEST_CTX *test_ctx) in check_client_sign_hash() argument
323 return check_nid("Client signing hash", test_ctx->expected_client_sign_hash, in check_client_sign_hash()
328 SSL_TEST_CTX *test_ctx) in check_client_sign_type() argument
330 return check_nid("Client signing", test_ctx->expected_client_sign_type, in check_client_sign_type()
335 SSL_TEST_CTX *test_ctx) in check_client_ca_names() argument
338 test_ctx->expected_client_ca_names, in check_client_ca_names()
342 static int check_cipher(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_cipher() argument
344 if (test_ctx->expected_cipher == NULL) in check_cipher()
348 if (!TEST_str_eq(test_ctx->expected_cipher, in check_cipher()
359 static int check_test(HANDSHAKE_RESULT *result, SSL_TEST_CTX *test_ctx) in check_test() argument
362 ret &= check_result(result, test_ctx); in check_test()
363 ret &= check_alerts(result, test_ctx); in check_test()
365 ret &= check_protocol(result, test_ctx); in check_test()
366 ret &= check_servername(result, test_ctx); in check_test()
367 ret &= check_session_ticket(result, test_ctx); in check_test()
368 ret &= check_compression(result, test_ctx); in check_test()
369 ret &= check_session_id(result, test_ctx); in check_test()
372 ret &= check_npn(result, test_ctx); in check_test()
374 ret &= check_cipher(result, test_ctx); in check_test()
375 ret &= check_alpn(result, test_ctx); in check_test()
376 ret &= check_session_ticket_app_data(result, test_ctx); in check_test()
377 ret &= check_resumption(result, test_ctx); in check_test()
378 ret &= check_tmp_key(result, test_ctx); in check_test()
379 ret &= check_server_cert_type(result, test_ctx); in check_test()
380 ret &= check_server_sign_hash(result, test_ctx); in check_test()
381 ret &= check_server_sign_type(result, test_ctx); in check_test()
382 ret &= check_server_ca_names(result, test_ctx); in check_test()
383 ret &= check_client_cert_type(result, test_ctx); in check_test()
384 ret &= check_client_sign_hash(result, test_ctx); in check_test()
385 ret &= check_client_sign_type(result, test_ctx); in check_test()
386 ret &= check_client_ca_names(result, test_ctx); in check_test()
396 SSL_TEST_CTX *test_ctx = NULL; in test_handshake() local
402 test_ctx = SSL_TEST_CTX_create(conf, test_app); in test_handshake()
403 if (!TEST_ptr(test_ctx)) in test_handshake()
407 if (test_ctx->method == SSL_TEST_METHOD_DTLS) { in test_handshake()
412 if (test_ctx->extra.server.servername_callback != in test_handshake()
421 if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) { in test_handshake()
436 if (test_ctx->method == SSL_TEST_METHOD_TLS) { in test_handshake()
442 if (test_ctx->extra.server.servername_callback != in test_handshake()
455 if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) { in test_handshake()
495 resume_server_ctx, resume_client_ctx, test_ctx); in test_handshake()
498 ret = check_test(result, test_ctx); in test_handshake()
507 SSL_TEST_CTX_free(test_ctx); in test_handshake()