Lines Matching refs:cf
97 struct Curl_cfilter *cf = s; in gtls_push() local
98 struct ssl_connect_data *connssl = cf->ctx; in gtls_push()
101 struct Curl_easy *data = CF_DATA_CURRENT(cf); in gtls_push()
106 nwritten = Curl_conn_cf_send(cf->next, data, buf, blen, FALSE, &result); in gtls_push()
107 CURL_TRC_CF(data, cf, "gtls_push(len=%zu) -> %zd, err=%d", in gtls_push()
120 struct Curl_cfilter *cf = s; in gtls_pull() local
121 struct ssl_connect_data *connssl = cf->ctx; in gtls_pull()
124 struct Curl_easy *data = CF_DATA_CURRENT(cf); in gtls_pull()
130 result = Curl_gtls_client_trust_setup(cf, data, &backend->gtls); in gtls_pull()
138 nread = Curl_conn_cf_recv(cf->next, data, buf, blen, &result); in gtls_pull()
139 CURL_TRC_CF(data, cf, "glts_pull(len=%zu) -> %zd, err=%d", in gtls_pull()
242 static CURLcode handshake(struct Curl_cfilter *cf, in handshake() argument
247 struct ssl_connect_data *connssl = cf->ctx; in handshake()
251 curl_socket_t sockfd = Curl_conn_cf_get_socket(cf, data); in handshake()
305 CURLcode result = Curl_gtls_client_trust_setup(cf, data, &backend->gtls); in handshake()
504 static CURLcode gtls_populate_creds(struct Curl_cfilter *cf, in gtls_populate_creds() argument
508 struct ssl_primary_config *config = Curl_ssl_cf_get_primary_config(cf); in gtls_populate_creds()
509 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in gtls_populate_creds()
599 static bool gtls_shared_creds_different(struct Curl_cfilter *cf, in gtls_shared_creds_different() argument
602 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in gtls_shared_creds_different()
610 gtls_get_cached_creds(struct Curl_cfilter *cf, struct Curl_easy *data) in gtls_get_cached_creds() argument
620 !gtls_shared_creds_different(cf, shared_creds)) { in gtls_get_cached_creds()
637 static void gtls_set_cached_creds(struct Curl_cfilter *cf, in gtls_set_cached_creds() argument
641 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in gtls_set_cached_creds()
668 CURLcode Curl_gtls_client_trust_setup(struct Curl_cfilter *cf, in Curl_gtls_client_trust_setup() argument
672 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in Curl_gtls_client_trust_setup()
673 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in Curl_gtls_client_trust_setup()
692 cached_creds = gtls_get_cached_creds(cf, data); in Curl_gtls_client_trust_setup()
695 CURL_TRC_CF(data, cf, "using shared trust anchors and CRLs"); in Curl_gtls_client_trust_setup()
706 CURL_TRC_CF(data, cf, "loading trust anchors and CRLs"); in Curl_gtls_client_trust_setup()
707 result = gtls_populate_creds(cf, data, gtls->shared_creds->creds); in Curl_gtls_client_trust_setup()
712 gtls_set_cached_creds(cf, data, gtls->shared_creds); in Curl_gtls_client_trust_setup()
723 CURLcode Curl_gtls_update_session_id(struct Curl_cfilter *cf, in Curl_gtls_update_session_id() argument
729 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in Curl_gtls_update_session_id()
754 CURL_TRC_CF(data, cf, "get session id (len=%zu, alpn=%s) and store in cache", in Curl_gtls_update_session_id()
758 result = Curl_ssl_set_sessionid(cf, data, peer, alpn, in Curl_gtls_update_session_id()
765 static CURLcode cf_gtls_update_session_id(struct Curl_cfilter *cf, in cf_gtls_update_session_id() argument
769 struct ssl_connect_data *connssl = cf->ctx; in cf_gtls_update_session_id()
770 return Curl_gtls_update_session_id(cf, data, session, &connssl->peer, in cf_gtls_update_session_id()
778 struct Curl_cfilter *cf = gnutls_session_get_ptr(session); in gtls_handshake_cb() local
783 struct Curl_easy *data = CF_DATA_CURRENT(cf); in gtls_handshake_cb()
785 CURL_TRC_CF(data, cf, "handshake: %s message type %d", in gtls_handshake_cb()
789 cf_gtls_update_session_id(cf, data, session); in gtls_handshake_cb()
800 static CURLcode gtls_client_init(struct Curl_cfilter *cf, in gtls_client_init() argument
805 struct ssl_primary_config *config = Curl_ssl_cf_get_primary_config(cf); in gtls_client_init()
806 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in gtls_client_init()
952 result = Curl_gtls_client_trust_setup(cf, data, gtls); in gtls_client_init()
1050 struct Curl_cfilter *cf, in Curl_gtls_ctx_init() argument
1059 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in Curl_gtls_ctx_init()
1060 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in Curl_gtls_ctx_init()
1067 result = gtls_client_init(cf, data, peer, gctx); in Curl_gtls_ctx_init()
1074 result = cb_setup(cf, data, cb_user_data); in Curl_gtls_ctx_init()
1092 if(!Curl_ssl_getsessionid(cf, data, peer, in Curl_gtls_ctx_init()
1108 !cf->conn->connect_only && connssl && in Curl_gtls_ctx_init()
1116 CURL_TRC_CF(data, cf, "TLS session does not allow earlydata"); in Curl_gtls_ctx_init()
1119 CURL_TRC_CF(data, cf, "TLS session allows %zu earlydata bytes, " in Curl_gtls_ctx_init()
1124 result = Curl_alpn_set_negotiated(cf, data, connssl, in Curl_gtls_ctx_init()
1174 gtls_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) in gtls_connect_step1() argument
1176 struct ssl_connect_data *connssl = cf->ctx; in gtls_connect_step1()
1199 result = Curl_gtls_ctx_init(&backend->gtls, cf, data, &connssl->peer, in gtls_connect_step1()
1200 proto.data, proto.len, connssl, NULL, NULL, cf); in gtls_connect_step1()
1214 gnutls_transport_set_ptr(backend->gtls.session, cf); in gtls_connect_step1()
1722 static CURLcode gtls_verifyserver(struct Curl_cfilter *cf, in gtls_verifyserver() argument
1726 struct ssl_connect_data *connssl = cf->ctx; in gtls_verifyserver()
1727 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in gtls_verifyserver()
1728 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in gtls_verifyserver()
1730 const char *pinned_key = Curl_ssl_cf_is_proxy(cf) ? in gtls_verifyserver()
1746 result = cf_gtls_update_session_id(cf, data, session); in gtls_verifyserver()
1752 static CURLcode gtls_set_earlydata(struct Curl_cfilter *cf, in gtls_set_earlydata() argument
1756 struct ssl_connect_data *connssl = cf->ctx; in gtls_set_earlydata()
1766 CURL_TRC_CF(data, cf, "gtls_set_earlydata(len=%zu) -> %zd", in gtls_set_earlydata()
1776 static CURLcode gtls_send_earlydata(struct Curl_cfilter *cf, in gtls_send_earlydata() argument
1779 struct ssl_connect_data *connssl = cf->ctx; in gtls_send_earlydata()
1791 CURL_TRC_CF(data, cf, "gtls_send_earlydata(len=%zu) -> %zd", in gtls_send_earlydata()
1826 gtls_connect_common(struct Curl_cfilter *cf, in gtls_connect_common() argument
1830 struct ssl_connect_data *connssl = cf->ctx; in gtls_connect_common()
1839 result = gtls_connect_step1(cf, data); in gtls_connect_common()
1850 result = gtls_send_earlydata(cf, data); in gtls_connect_common()
1854 if(!Curl_ssl_cf_is_proxy(cf)) in gtls_connect_common()
1860 result = handshake(cf, data, TRUE, nonblocking); in gtls_connect_common()
1870 result = gtls_verifyserver(cf, data, backend->gtls.session); in gtls_connect_common()
1883 result = Curl_alpn_set_negotiated(cf, data, connssl, in gtls_connect_common()
1897 if(!Curl_ssl_cf_is_proxy(cf)) in gtls_connect_common()
1915 static CURLcode gtls_connect_nonblocking(struct Curl_cfilter *cf, in gtls_connect_nonblocking() argument
1919 struct ssl_connect_data *connssl = cf->ctx; in gtls_connect_nonblocking()
1925 return gtls_connect_common(cf, data, TRUE, done); in gtls_connect_nonblocking()
1928 static CURLcode gtls_connect(struct Curl_cfilter *cf, in gtls_connect() argument
1934 result = gtls_connect_common(cf, data, FALSE, &done); in gtls_connect()
1943 static CURLcode gtls_connect_deferred(struct Curl_cfilter *cf, in gtls_connect_deferred() argument
1949 struct ssl_connect_data *connssl = cf->ctx; in gtls_connect_deferred()
1955 result = gtls_set_earlydata(cf, data, buf, blen); in gtls_connect_deferred()
1960 return gtls_connect_common(cf, data, TRUE, done); in gtls_connect_deferred()
1963 static bool gtls_data_pending(struct Curl_cfilter *cf, in gtls_data_pending() argument
1966 struct ssl_connect_data *ctx = cf->ctx; in gtls_data_pending()
1978 static ssize_t gtls_send(struct Curl_cfilter *cf, in gtls_send() argument
1984 struct ssl_connect_data *connssl = cf->ctx; in gtls_send()
1994 *curlcode = gtls_connect_deferred(cf, data, buf, blen, &done); in gtls_send()
2055 static CURLcode gtls_shutdown(struct Curl_cfilter *cf, in gtls_shutdown() argument
2059 struct ssl_connect_data *connssl = cf->ctx; in gtls_shutdown()
2069 if(!backend->gtls.session || cf->shutdown || in gtls_shutdown()
2084 CURL_TRC_CF(data, cf, "SSL shutdown, gnutls_bye EAGAIN"); in gtls_shutdown()
2092 CURL_TRC_CF(data, cf, "SSL shutdown, gnutls_bye error: '%s'(%d)", in gtls_shutdown()
2119 CURL_TRC_CF(data, cf, "SSL shutdown, error: '%s'(%d)", in gtls_shutdown()
2125 cf->shutdown = (result || *done); in gtls_shutdown()
2129 static void gtls_close(struct Curl_cfilter *cf, in gtls_close() argument
2132 struct ssl_connect_data *connssl = cf->ctx; in gtls_close()
2138 CURL_TRC_CF(data, cf, "close"); in gtls_close()
2154 static ssize_t gtls_recv(struct Curl_cfilter *cf, in gtls_recv() argument
2160 struct ssl_connect_data *connssl = cf->ctx; in gtls_recv()
2170 *curlcode = gtls_connect_deferred(cf, data, NULL, 0, &done); in gtls_recv()
2193 CURLcode result = handshake(cf, data, FALSE, FALSE); in gtls_recv()