Lines Matching refs:test_ctx

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