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