Lines Matching defs:ctx
545 static int verify_retry_cb(X509_STORE_CTX *ctx, void *arg)
547 int res = X509_verify_cert(ctx);
553 || (ssl = X509_STORE_CTX_get_ex_data(ctx, idx)) == NULL)
556 if (res == 0 && X509_STORE_CTX_get_error(ctx) ==
686 SSL_CTX *ctx = NULL;
690 if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method())))
692 SSL_CTX_set_default_passwd_cb(ctx, get_password_cb);
694 if (!TEST_int_eq(SSL_CTX_use_certificate_chain_file(ctx, leaf_chain), 1)
695 || !TEST_int_eq(SSL_CTX_use_PrivateKey_file(ctx, skey,
697 || !TEST_int_eq(SSL_CTX_check_private_key(ctx), 1))
699 if (!TEST_true(SSL_CTX_build_cert_chain(ctx, SSL_BUILD_CHAIN_FLAG_NO_ROOT
704 SSL_CTX_free(ctx);
2001 static void remove_session_cb(SSL_CTX *ctx, SSL_SESSION *sess)
3016 SSL_CTX *ctx;
3020 if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, TLS_method()))
3021 || !TEST_ptr(ssl = SSL_new(ctx))
3056 SSL_CTX_free(ctx);
5800 SSL_CTX *ctx = (SSL_CTX *)arg;
5802 if (SSL_set_SSL_CTX(s, ctx) == NULL) {
6946 SSL_CTX *ctx = NULL;
6952 TLS1_VERSION, 0, NULL, &ctx, NULL,
6957 ctx, max_fragment_len_test[idx_tst])))
6960 con = SSL_new(ctx);
6989 SSL_CTX_free(ctx);
7838 unsigned char iv[EVP_MAX_IV_LENGTH], EVP_CIPHER_CTX *ctx,
7865 || !EVP_CipherInit_ex(ctx, aes128cbc, NULL, tick_aes_key, iv, enc)
7881 EVP_CIPHER_CTX *ctx, EVP_MAC_CTX *hctx, int enc)
7904 || !EVP_CipherInit_ex(ctx, aes128cbc, NULL, tick_aes_key, iv, enc)
8312 SSL_CTX *ctx = (SSL_CTX *)arg;
8329 if (ctx != NULL && !TEST_ptr(SSL_set_SSL_CTX(s, ctx)))
8828 SSL_CTX *ctx;
8833 if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, TLS_method()))
8847 if (!TEST_int_eq(SSL_CTX_add_session(ctx, early), 1)
8848 || !TEST_int_eq(SSL_CTX_add_session(ctx, middle), 1)
8849 || !TEST_int_eq(SSL_CTX_add_session(ctx, late), 1))
8882 SSL_CTX_flush_sessions(ctx, now + TIMEOUT - 1);
8889 SSL_CTX_flush_sessions(ctx, now + TIMEOUT + 1);
8896 SSL_CTX_flush_sessions(ctx, now + TIMEOUT + 11);
8903 if (!TEST_int_eq(SSL_CTX_add_session(ctx, early), 1)
8904 || !TEST_int_eq(SSL_CTX_add_session(ctx, middle), 1)
8905 || !TEST_int_eq(SSL_CTX_add_session(ctx, late), 1))
8915 SSL_CTX_flush_sessions(ctx, 0);
8921 (void)SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_UPDATE_TIME
8922 | SSL_CTX_get_session_cache_mode(ctx));
8927 || !TEST_int_eq(SSL_CTX_add_session(ctx, early), 1)
8933 SSL_CTX_free(ctx);
9917 SSL_CTX *ctx = NULL;
9929 ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method());
9930 if (!TEST_ptr(ctx))
9934 if (!TEST_false(SSL_CTX_set_alpn_protos(ctx, NULL, 2)))
9936 if (!TEST_false(SSL_CTX_set_alpn_protos(ctx, good, 0)))
9938 if (!TEST_false(SSL_CTX_set_alpn_protos(ctx, good, sizeof(good))))
9940 if (!TEST_true(SSL_CTX_set_alpn_protos(ctx, good, 1)))
9942 if (!TEST_true(SSL_CTX_set_alpn_protos(ctx, bad0, sizeof(bad0))))
9944 if (!TEST_true(SSL_CTX_set_alpn_protos(ctx, bad1, sizeof(bad1))))
9946 if (!TEST_true(SSL_CTX_set_alpn_protos(ctx, bad2, sizeof(bad2))))
9948 if (!TEST_true(SSL_CTX_set_alpn_protos(ctx, bad3, sizeof(bad3))))
9950 if (!TEST_true(SSL_CTX_set_alpn_protos(ctx, bad4, sizeof(bad4))))
9953 ssl = SSL_new(ctx);
9980 SSL_CTX_free(ctx);
9989 SSL_CTX *ctx = NULL;
9995 ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method());
9996 if (!TEST_ptr(ctx))
10000 if (!TEST_true(SSL_CTX_get0_verify_cert_store(ctx, &store)))
10004 if (!TEST_true(SSL_CTX_get0_chain_cert_store(ctx, &cstore)))
10021 if (!TEST_true(SSL_CTX_set1_verify_cert_store(ctx, new_store)))
10024 if (!TEST_true(SSL_CTX_set1_chain_cert_store(ctx, new_cstore)))
10028 if (!TEST_true(SSL_CTX_get0_verify_cert_store(ctx, &store)))
10031 if (!TEST_true(SSL_CTX_get0_chain_cert_store(ctx, &cstore)))
10038 if (!TEST_true(SSL_CTX_set1_verify_cert_store(ctx, NULL)))
10041 if (!TEST_true(SSL_CTX_set1_chain_cert_store(ctx, NULL)))
10045 if (!TEST_true(SSL_CTX_get0_verify_cert_store(ctx, &store)))
10048 if (!TEST_true(SSL_CTX_get0_chain_cert_store(ctx, &cstore)))
10059 SSL_CTX_free(ctx);
10068 SSL_CTX *ctx = NULL;
10075 ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method());
10076 if (!TEST_ptr(ctx))
10080 ssl = SSL_new(ctx);
10145 SSL_CTX_free(ctx);
10154 SSL_CTX *ctx = NULL;
10160 ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method());
10161 if (!TEST_ptr(ctx))
10164 cp = SSL_CTX_get0_param(ctx);
10172 ssl = SSL_new(ctx);
10186 SSL_CTX_free(ctx);
10196 SSL_CTX *ctx = NULL;
10202 if (!TEST_ptr(ctx = SSL_CTX_new_ex(libctx, NULL, TLS_client_method()))
10206 SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
10218 SSL_CTX_free(ctx);