Lines Matching refs:idx
548 int idx = SSL_get_ex_data_X509_STORE_CTX_idx();
552 if (idx < 0
553 || (ssl = X509_STORE_CTX_get_ex_data(ctx, idx)) == NULL)
2423 static int setup_ticket_test(int stateful, int idx, SSL_CTX **sctx,
2431 || !TEST_true(SSL_CTX_set_num_tickets(*sctx, idx))
2447 static int check_resumption(int idx, SSL_CTX *sctx, SSL_CTX *cctx, int succ)
2453 for (i = 0; i < idx * 2; i++) {
2468 * failed one we should get idx tickets.
2476 || !TEST_int_eq(new_called, idx))
2504 static int test_tickets(int stateful, int idx)
2511 /* idx is the test number, but also the number of tickets we want */
2516 if (!setup_ticket_test(stateful, idx, &sctx, &cctx))
2526 || !TEST_int_eq(idx, new_called))
2541 * SSL_CTX). We should see idx number of tickets issued again.
2547 if (!setup_ticket_test(stateful, idx, &sctx, &cctx))
2550 if (!check_resumption(idx, sctx, cctx, 0))
2560 if (!setup_ticket_test(stateful, idx, &sctx, &cctx))
2572 || !TEST_int_eq(idx, new_called))
2577 || !TEST_int_eq(idx * 2, new_called))
2593 if (!check_resumption(idx, sctx, cctx, 1))
2611 static int test_stateless_tickets(int idx)
2613 return test_tickets(0, idx);
2616 static int test_stateful_tickets(int idx)
2618 return test_tickets(1, idx);
2676 static int test_extra_tickets(int idx)
2690 if (idx >= 3) {
2691 idx -= 3;
2695 if (!TEST_ptr(bretry) || !setup_ticket_test(stateful, idx, &sctx, &cctx))
2712 || !TEST_int_eq(idx * 2, new_called)
2715 || !TEST_int_eq(idx * 2, new_called))
2722 || !TEST_int_eq(idx * 2 + 2, new_called)
2724 || !TEST_int_eq(idx * 2 + 4, new_called)
2887 static int test_ssl_set_bio(int idx)
2897 if (idx < TOTAL_NO_CONN_SSL_SET_BIO_TESTS) {
2898 initrbio = idx % 3;
2899 idx /= 3;
2900 initwbio = idx % 3;
2901 idx /= 3;
2902 newrbio = idx % 3;
2903 idx /= 3;
2904 newwbio = idx % 3;
2907 idx -= TOTAL_NO_CONN_SSL_SET_BIO_TESTS;
2909 newrbio = idx % 2;
2910 idx /= 2;
2911 newwbio = idx % 2;
2912 idx /= 2;
2913 conntype = idx % 2;
3125 static int test_set_sigalgs(int idx)
3134 if (!TEST_size_t_le((size_t)idx, OSSL_NELEM(testsigalgs) * 2))
3137 testctx = ((size_t)idx < OSSL_NELEM(testsigalgs));
3138 curr = testctx ? &testsigalgs[idx]
3139 : &testsigalgs[idx - OSSL_NELEM(testsigalgs)];
3158 TEST_info("Failure setting sigalgs in SSL_CTX (%d)\n", idx);
3164 TEST_info("Not-failed setting sigalgs in SSL_CTX (%d)\n", idx);
3182 TEST_info("Failure setting sigalgs in SSL (%d)\n", idx);
3386 SSL **serverssl, SSL_SESSION **sess, int idx,
3399 if (idx == 1) {
3400 /* When idx == 1 we repeat the tests with read_ahead set */
3403 } else if (idx == 2) {
3404 /* When idx == 2 we are doing early_data with a PSK. Set up callbacks */
3422 if (idx == 1
3426 if (idx == 2) {
3476 static int test_early_data_read_write(int idx)
3487 &serverssl, &sess, idx,
3699 * idx == 0: Standard early_data setup
3700 * idx == 1: early_data setup using read_ahead
3707 static int test_early_data_replay_int(int idx, int usecb, int confopt)
3745 &serverssl, &sess, idx,
3824 static int test_early_data_replay(int idx)
3830 ret &= test_early_data_replay_int(idx, usecb, confopt);
3854 static int early_data_skip_helper(int testtype, int cipher, int idx)
3882 &serverssl, &sess, idx,
3896 } else if (idx == 2) {
4032 static int test_early_data_skip(int idx)
4035 idx % OSSL_NELEM(ciphersuites),
4036 idx / OSSL_NELEM(ciphersuites));
4043 static int test_early_data_skip_hrr(int idx)
4046 idx % OSSL_NELEM(ciphersuites),
4047 idx / OSSL_NELEM(ciphersuites));
4055 static int test_early_data_skip_hrr_fail(int idx)
4058 idx % OSSL_NELEM(ciphersuites),
4059 idx / OSSL_NELEM(ciphersuites));
4066 static int test_early_data_skip_abort(int idx)
4069 idx % OSSL_NELEM(ciphersuites),
4070 idx / OSSL_NELEM(ciphersuites));
4077 static int test_early_data_not_sent(int idx)
4087 &serverssl, &sess, idx,
4160 static int test_early_data_psk(int idx)
4194 switch (idx) {
4336 * idx == 0: Test with TLS1_3_RFC_AES_128_GCM_SHA256
4337 * idx == 1: Test with TLS1_3_RFC_AES_256_GCM_SHA384
4338 * idx == 2: Test with TLS1_3_RFC_CHACHA20_POLY1305_SHA256,
4339 * idx == 3: Test with TLS1_3_RFC_AES_128_CCM_SHA256
4340 * idx == 4: Test with TLS1_3_RFC_AES_128_CCM_8_SHA256
4342 static int test_early_data_psk_with_all_ciphers(int idx)
4374 if (cipher_str[idx] == NULL)
4377 if (idx == 2 && is_fips == 1)
4386 if (!TEST_true(SSL_set_ciphersuites(clientssl, cipher_str[idx]))
4387 || !TEST_true(SSL_set_ciphersuites(serverssl, cipher_str[idx])))
4397 cipher = SSL_CIPHER_find(clientssl, cipher_bytes[idx]);
4446 static int test_early_data_not_expected(int idx)
4456 &serverssl, &sess, idx,
4507 static int test_early_data_tls1_2(int idx)
4516 &serverssl, NULL, idx,
4591 static int test_set_ciphersuite(int idx)
4604 if (idx >=4 && idx <= 7) {
4610 if (idx == 0 || idx == 4) {
4615 } else if (idx == 1 || idx == 5) {
4626 if (idx == 8 || idx == 9) {
4632 if (idx == 2 || idx == 6 || idx == 8) {
4637 } else if (idx == 3 || idx == 7 || idx == 9) {
4814 static int test_key_exchange(int idx)
4825 switch (idx) {
4940 * configured, except in the case of FFDHE groups (idx 13), which are
4944 idx == 13 ? 0 : kexch_groups[0]))
4952 if (idx != 13) {
4972 int isecdhe, int idx)
4981 kexch_alg = ecdhe_kexch_groups[idx];
4983 kexch_alg = ffdhe_kexch_groups[idx];
5036 static int test_negotiated_group(int idx)
5050 clientmulti = (idx < 2 * numgroups);
5051 idx = idx % (2 * numgroups);
5052 istls13 = (idx < numgroups);
5053 idx = idx % numgroups;
5054 isecdhe = (idx < numec);
5056 idx -= numec;
5057 /* Now 'idx' is an index into ecdhe_kexch_groups or ffdhe_kexch_groups */
5059 kexch_alg = ecdhe_kexch_groups[idx];
5061 kexch_alg = ffdhe_kexch_groups[idx];
5096 idx)))
5121 isecdhe, idx)))
5142 * changing 'idx' and updating what we expect.
5144 if (idx == 0)
5145 idx = 1;
5147 idx--;
5150 expectednid = ecdhe_kexch_groups[idx];
5152 expectednid = ffdhe_kexch_groups[idx];
5167 isecdhe, idx)))
5197 static int test_tls13_ciphersuite(int idx)
5225 switch (idx) {
5339 static int test_tls13_psk(int idx)
5354 &sctx, &cctx, idx == 3 ? NULL : cert,
5355 idx == 3 ? NULL : privkey)))
5358 if (idx != 3) {
5385 if (idx == 0 || idx == 1) {
5390 if (idx >= 1) {
5401 if (idx != 3) {
5414 if (idx == 0 || idx == 1) {
5421 || !TEST_true(psk_client_cb_cnt == idx)
5461 if (idx == 0 || idx == 1) {
5502 if (idx == 0 || idx == 1) {
5521 if (idx != 3) {
5535 if (idx == 0 || idx == 1) {
5543 || !TEST_true(psk_server_cb_cnt == idx))
6094 static int test_serverinfo_custom(const int idx)
6112 const int call_use_serverinfo_ex = idx > 0;
6113 switch (idx) {
6356 static int test_export_key_mat_early(int idx)
6371 &sess, idx, SHA384_DIGEST_LENGTH)))
6828 static int test_ssl_clear(int idx)
6835 if (idx == 1)
6843 || (idx == 1
8948 static int test_session_cache_overflow(int idx)
8957 if (idx % 2 == 0)
8962 if (idx % 2 == 1)
8968 (idx % 2 == 0) ? TLS1_3_VERSION
8986 if (idx > 1) {
9226 static int test_sigalgs_available(int idx)
9239 if (idx != 0 && idx != 3) {
9248 if (idx < 3) {
9266 if (idx == 1 || idx == 4)
9277 if (idx != 5) {
9294 if (idx < 4) {
9304 if (idx < 3) {
9319 if (idx != 5
9338 (idx == 0 || idx == 3) ? 2 : 1))
9341 if (!TEST_int_eq(hash, idx == 0 ? NID_sha384 : NID_sha256))
9344 if (!TEST_int_eq(sig, (idx == 4 || idx == 5) ? EVP_PKEY_EC
9367 static int test_pluggable_group(int idx)
9375 const char *group_name = idx == 0 ? "xorkemgroup" : "xorgroup";
9580 static int test_set_tmp_dh(int idx)
9585 int dhauto = (idx == 3 || idx == 4) ? 1 : 0;
9586 int expected = (idx <= 2) ? 0 : 1;
9592 if (idx >= 7)
9596 if (idx >= 5 && idx <= 8) {
9602 if (idx == 7 || idx == 8) {
9616 if ((idx & 1) == 1) {
9621 if (idx == 5) {
9627 else if (idx == 7) {
9630 } else if (idx == 9) {
9639 if ((idx & 1) == 0 && idx != 0) {
9643 if (idx == 6) {
9649 else if (idx == 8) {
9652 } else if (idx == 10) {
9688 static int test_dh_auto(int idx)
9698 switch (idx) {
9855 static int test_ticket_lifetime(int idx)
9865 if (idx == 0) {
9893 if (idx == 0) {
10243 static int test_pipelining(int idx)
10281 if (idx == 1) {
10290 if (idx == 5) {
10300 } else if (idx == 4) {
10305 if (idx == 2)
10307 else if (idx == 3)
10314 if (idx == 5) {
10357 expectedreads = idx == 4 ? numpipes + 1
10358 : (idx == 3 ? numpipes - 1 : numpipes);
10388 if (idx == 4) {
10412 if (idx == 5)
10476 static int test_multi_resume(int idx)
10486 if (idx == 4)
10489 if (idx == 4)
10493 if (idx != 4)
10507 if (idx == 0 || idx == 2) {
10511 if (idx == 1 || idx == 2 || idx == 3)
10516 if (idx == 3) {
10537 if (idx == 3) {
10546 if ((idx == 0 || idx == 2) && (i % 3) == 2)
10552 if (sess == NULL || (idx == 0 && (i % 3) == 2)) {