Lines Matching refs:cf
486 static CURLcode ssl_connect(struct Curl_cfilter *cf, struct Curl_easy *data) in ssl_connect() argument
488 struct ssl_connect_data *connssl = cf->ctx; in ssl_connect()
497 result = Curl_ssl->connect_blocking(cf, data); in ssl_connect()
507 ssl_connect_nonblocking(struct Curl_cfilter *cf, struct Curl_easy *data, in ssl_connect_nonblocking() argument
514 return Curl_ssl->connect_nonblocking(cf, data, done); in ssl_connect_nonblocking()
539 bool Curl_ssl_getsessionid(struct Curl_cfilter *cf, in Curl_ssl_getsessionid() argument
546 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in Curl_ssl_getsessionid()
547 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in Curl_ssl_getsessionid()
578 ((!cf->conn->bits.conn_to_host && !check->conn_to_host) || in Curl_ssl_getsessionid()
579 (cf->conn->bits.conn_to_host && check->conn_to_host && in Curl_ssl_getsessionid()
580 strcasecompare(cf->conn->conn_to_host.name, check->conn_to_host))) && in Curl_ssl_getsessionid()
581 ((!cf->conn->bits.conn_to_port && check->conn_to_port == -1) || in Curl_ssl_getsessionid()
582 (cf->conn->bits.conn_to_port && check->conn_to_port != -1 && in Curl_ssl_getsessionid()
583 cf->conn->conn_to_port == check->conn_to_port)) && in Curl_ssl_getsessionid()
586 strcasecompare(cf->conn->handler->scheme, check->scheme) && in Curl_ssl_getsessionid()
601 CURL_TRC_CF(data, cf, "%s cached session ID for %s://%s:%d", in Curl_ssl_getsessionid()
603 cf->conn->handler->scheme, peer->hostname, peer->port); in Curl_ssl_getsessionid()
647 CURLcode Curl_ssl_set_sessionid(struct Curl_cfilter *cf, in Curl_ssl_set_sessionid() argument
655 struct ssl_config_data *ssl_config = Curl_ssl_cf_get_config(cf, data); in Curl_ssl_set_sessionid()
656 struct ssl_primary_config *conn_config = Curl_ssl_cf_get_primary_config(cf); in Curl_ssl_set_sessionid()
677 if(!Curl_ssl_getsessionid(cf, data, peer, &old_sessionid, &old_size, NULL)) { in Curl_ssl_set_sessionid()
697 if(cf->conn->bits.conn_to_host) { in Curl_ssl_set_sessionid()
698 clone_conn_to_host = strdup(cf->conn->conn_to_host.name); in Curl_ssl_set_sessionid()
707 if(cf->conn->bits.conn_to_port) in Curl_ssl_set_sessionid()
708 conn_to_port = cf->conn->conn_to_port; in Curl_ssl_set_sessionid()
759 store->scheme = cf->conn->handler->scheme; in Curl_ssl_set_sessionid()
771 Curl_ssl_cf_is_proxy(cf) ? "PROXY" : "server"); in Curl_ssl_set_sessionid()
775 CURL_TRC_CF(data, cf, "Added Session ID to cache for %s://%s:%d [%s]", in Curl_ssl_set_sessionid()
777 Curl_ssl_cf_is_proxy(cf) ? "PROXY" : "server"); in Curl_ssl_set_sessionid()
805 void Curl_ssl_adjust_pollset(struct Curl_cfilter *cf, struct Curl_easy *data, in Curl_ssl_adjust_pollset() argument
808 struct ssl_connect_data *connssl = cf->ctx; in Curl_ssl_adjust_pollset()
811 curl_socket_t sock = Curl_conn_cf_get_socket(cf->next, data); in Curl_ssl_adjust_pollset()
815 CURL_TRC_CF(data, cf, "adjust_pollset, POLLOUT fd=%" FMT_SOCKET_T, in Curl_ssl_adjust_pollset()
820 CURL_TRC_CF(data, cf, "adjust_pollset, POLLIN fd=%" FMT_SOCKET_T, in Curl_ssl_adjust_pollset()
1212 CURLcode Curl_none_shutdown(struct Curl_cfilter *cf UNUSED_PARAM, in Curl_none_shutdown()
1218 (void)cf; in Curl_none_shutdown()
1226 int Curl_none_check_cxn(struct Curl_cfilter *cf, struct Curl_easy *data) in Curl_none_check_cxn() argument
1228 (void)cf; in Curl_none_check_cxn()
1243 bool Curl_none_data_pending(struct Curl_cfilter *cf UNUSED_PARAM, in Curl_none_data_pending()
1246 (void)cf; in Curl_none_data_pending()
1288 static CURLcode multissl_connect(struct Curl_cfilter *cf, in multissl_connect() argument
1293 return Curl_ssl->connect_blocking(cf, data); in multissl_connect()
1296 static CURLcode multissl_connect_nonblocking(struct Curl_cfilter *cf, in multissl_connect_nonblocking() argument
1302 return Curl_ssl->connect_nonblocking(cf, data, done); in multissl_connect_nonblocking()
1305 static void multissl_adjust_pollset(struct Curl_cfilter *cf, in multissl_adjust_pollset() argument
1311 Curl_ssl->adjust_pollset(cf, data, ps); in multissl_adjust_pollset()
1322 static void multissl_close(struct Curl_cfilter *cf, struct Curl_easy *data) in multissl_close() argument
1326 Curl_ssl->close(cf, data); in multissl_close()
1329 static ssize_t multissl_recv_plain(struct Curl_cfilter *cf, in multissl_recv_plain() argument
1335 return Curl_ssl->recv_plain(cf, data, buf, len, code); in multissl_recv_plain()
1338 static ssize_t multissl_send_plain(struct Curl_cfilter *cf, in multissl_send_plain() argument
1345 return Curl_ssl->send_plain(cf, data, mem, len, code); in multissl_send_plain()
1576 static void cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) in cf_close() argument
1578 struct ssl_connect_data *connssl = cf->ctx; in cf_close()
1580 Curl_ssl->close(cf, data); in cf_close()
1584 cf->connected = FALSE; in cf_close()
1606 CURLcode Curl_ssl_peer_init(struct ssl_peer *peer, struct Curl_cfilter *cf, in Curl_ssl_peer_init() argument
1624 if(Curl_ssl_cf_is_proxy(cf)) { in Curl_ssl_peer_init()
1625 ehostname = cf->conn->http_proxy.host.name; in Curl_ssl_peer_init()
1626 edispname = cf->conn->http_proxy.host.dispname; in Curl_ssl_peer_init()
1627 peer->port = cf->conn->http_proxy.port; in Curl_ssl_peer_init()
1632 ehostname = cf->conn->host.name; in Curl_ssl_peer_init()
1633 edispname = cf->conn->host.dispname; in Curl_ssl_peer_init()
1634 peer->port = cf->conn->remote_port; in Curl_ssl_peer_init()
1676 static void ssl_cf_destroy(struct Curl_cfilter *cf, struct Curl_easy *data) in ssl_cf_destroy() argument
1680 CF_DATA_SAVE(save, cf, data); in ssl_cf_destroy()
1681 cf_close(cf, data); in ssl_cf_destroy()
1682 CF_DATA_RESTORE(cf, save); in ssl_cf_destroy()
1683 cf_ctx_free(cf->ctx); in ssl_cf_destroy()
1684 cf->ctx = NULL; in ssl_cf_destroy()
1687 static void ssl_cf_close(struct Curl_cfilter *cf, in ssl_cf_close() argument
1692 CF_DATA_SAVE(save, cf, data); in ssl_cf_close()
1693 cf_close(cf, data); in ssl_cf_close()
1694 if(cf->next) in ssl_cf_close()
1695 cf->next->cft->do_close(cf->next, data); in ssl_cf_close()
1696 CF_DATA_RESTORE(cf, save); in ssl_cf_close()
1699 static CURLcode ssl_cf_connect(struct Curl_cfilter *cf, in ssl_cf_connect() argument
1703 struct ssl_connect_data *connssl = cf->ctx; in ssl_cf_connect()
1707 if(cf->connected) { in ssl_cf_connect()
1712 if(!cf->next) { in ssl_cf_connect()
1717 if(!cf->next->connected) { in ssl_cf_connect()
1718 result = cf->next->cft->do_connect(cf->next, data, blocking, done); in ssl_cf_connect()
1723 CF_DATA_SAVE(save, cf, data); in ssl_cf_connect()
1724 CURL_TRC_CF(data, cf, "cf_connect()"); in ssl_cf_connect()
1726 DEBUGASSERT(data->conn == cf->conn); in ssl_cf_connect()
1731 result = Curl_ssl_peer_init(&connssl->peer, cf, TRNSPRT_TCP); in ssl_cf_connect()
1737 result = ssl_connect(cf, data); in ssl_cf_connect()
1741 result = ssl_connect_nonblocking(cf, data, done); in ssl_cf_connect()
1745 cf->connected = TRUE; in ssl_cf_connect()
1752 CURL_TRC_CF(data, cf, "cf_connect() -> %d, done=%d", result, *done); in ssl_cf_connect()
1753 CF_DATA_RESTORE(cf, save); in ssl_cf_connect()
1757 static bool ssl_cf_data_pending(struct Curl_cfilter *cf, in ssl_cf_data_pending() argument
1763 CF_DATA_SAVE(save, cf, data); in ssl_cf_data_pending()
1764 if(Curl_ssl->data_pending(cf, data)) in ssl_cf_data_pending()
1767 result = cf->next->cft->has_data_pending(cf->next, data); in ssl_cf_data_pending()
1768 CF_DATA_RESTORE(cf, save); in ssl_cf_data_pending()
1772 static ssize_t ssl_cf_send(struct Curl_cfilter *cf, in ssl_cf_send() argument
1783 CF_DATA_SAVE(save, cf, data); in ssl_cf_send()
1784 nwritten = Curl_ssl->send_plain(cf, data, buf, len, err); in ssl_cf_send()
1785 CF_DATA_RESTORE(cf, save); in ssl_cf_send()
1790 static ssize_t ssl_cf_recv(struct Curl_cfilter *cf, in ssl_cf_recv() argument
1797 CF_DATA_SAVE(save, cf, data); in ssl_cf_recv()
1799 nread = Curl_ssl->recv_plain(cf, data, buf, len, err); in ssl_cf_recv()
1807 CURL_TRC_CF(data, cf, "cf_recv(len=%zu) -> %zd, %d", len, in ssl_cf_recv()
1809 CF_DATA_RESTORE(cf, save); in ssl_cf_recv()
1813 static CURLcode ssl_cf_shutdown(struct Curl_cfilter *cf, in ssl_cf_shutdown() argument
1820 if(!cf->shutdown) { in ssl_cf_shutdown()
1823 CF_DATA_SAVE(save, cf, data); in ssl_cf_shutdown()
1824 result = Curl_ssl->shut_down(cf, data, TRUE, done); in ssl_cf_shutdown()
1825 CURL_TRC_CF(data, cf, "cf_shutdown -> %d, done=%d", result, *done); in ssl_cf_shutdown()
1826 CF_DATA_RESTORE(cf, save); in ssl_cf_shutdown()
1827 cf->shutdown = (result || *done); in ssl_cf_shutdown()
1832 static void ssl_cf_adjust_pollset(struct Curl_cfilter *cf, in ssl_cf_adjust_pollset() argument
1838 CF_DATA_SAVE(save, cf, data); in ssl_cf_adjust_pollset()
1839 Curl_ssl->adjust_pollset(cf, data, ps); in ssl_cf_adjust_pollset()
1840 CF_DATA_RESTORE(cf, save); in ssl_cf_adjust_pollset()
1843 static CURLcode ssl_cf_cntrl(struct Curl_cfilter *cf, in ssl_cf_cntrl() argument
1854 CF_DATA_SAVE(save, cf, data); in ssl_cf_cntrl()
1855 Curl_ssl->attach_data(cf, data); in ssl_cf_cntrl()
1856 CF_DATA_RESTORE(cf, save); in ssl_cf_cntrl()
1861 CF_DATA_SAVE(save, cf, data); in ssl_cf_cntrl()
1862 Curl_ssl->detach_data(cf, data); in ssl_cf_cntrl()
1863 CF_DATA_RESTORE(cf, save); in ssl_cf_cntrl()
1872 static CURLcode ssl_cf_query(struct Curl_cfilter *cf, in ssl_cf_query() argument
1876 struct ssl_connect_data *connssl = cf->ctx; in ssl_cf_query()
1881 if(cf->connected && !Curl_ssl_cf_is_proxy(cf)) in ssl_cf_query()
1888 return cf->next ? in ssl_cf_query()
1889 cf->next->cft->query(cf->next, data, query, pres1, pres2) : in ssl_cf_query()
1893 static bool cf_ssl_is_alive(struct Curl_cfilter *cf, struct Curl_easy *data, in cf_ssl_is_alive() argument
1906 CF_DATA_SAVE(save, cf, data); in cf_ssl_is_alive()
1907 result = Curl_ssl->check_cxn(cf, data); in cf_ssl_is_alive()
1908 CF_DATA_RESTORE(cf, save); in cf_ssl_is_alive()
1918 return cf->next ? in cf_ssl_is_alive()
1919 cf->next->cft->is_alive(cf->next, data, input_pending) : in cf_ssl_is_alive()
1969 struct Curl_cfilter *cf = NULL; in cf_ssl_create() local
1982 result = Curl_cf_create(&cf, &Curl_cft_ssl, ctx); in cf_ssl_create()
1987 *pcf = result ? NULL : cf; in cf_ssl_create()
1995 struct Curl_cfilter *cf; in Curl_ssl_cfilter_add() local
1998 result = cf_ssl_create(&cf, data, conn); in Curl_ssl_cfilter_add()
2000 Curl_conn_cf_add(data, conn, sockindex, cf); in Curl_ssl_cfilter_add()
2007 struct Curl_cfilter *cf; in Curl_cf_ssl_insert_after() local
2010 result = cf_ssl_create(&cf, data, cf_at->conn); in Curl_cf_ssl_insert_after()
2012 Curl_conn_cf_insert_after(cf_at, cf); in Curl_cf_ssl_insert_after()
2022 struct Curl_cfilter *cf = NULL; in cf_ssl_proxy_create() local
2040 result = Curl_cf_create(&cf, &Curl_cft_ssl_proxy, ctx); in cf_ssl_proxy_create()
2045 *pcf = result ? NULL : cf; in cf_ssl_proxy_create()
2052 struct Curl_cfilter *cf; in Curl_cf_ssl_proxy_insert_after() local
2055 result = cf_ssl_proxy_create(&cf, data, cf_at->conn); in Curl_cf_ssl_proxy_insert_after()
2057 Curl_conn_cf_insert_after(cf_at, cf); in Curl_cf_ssl_proxy_insert_after()
2069 static struct Curl_cfilter *get_ssl_filter(struct Curl_cfilter *cf) in get_ssl_filter() argument
2071 for(; cf; cf = cf->next) { in get_ssl_filter()
2072 if(cf->cft == &Curl_cft_ssl) in get_ssl_filter()
2073 return cf; in get_ssl_filter()
2075 if(cf->cft == &Curl_cft_ssl_proxy) in get_ssl_filter()
2076 return cf; in get_ssl_filter()
2089 struct Curl_cfilter *cf; in Curl_ssl_get_internals() local
2091 cf = get_ssl_filter(data->conn->cfilter[sockindex]); in Curl_ssl_get_internals()
2092 if(cf) { in Curl_ssl_get_internals()
2094 CF_DATA_SAVE(save, cf, data); in Curl_ssl_get_internals()
2095 result = Curl_ssl->get_internals(cf->ctx, info); in Curl_ssl_get_internals()
2096 CF_DATA_RESTORE(cf, save); in Curl_ssl_get_internals()
2102 static CURLcode vtls_shutdown_blocking(struct Curl_cfilter *cf, in vtls_shutdown_blocking() argument
2106 struct ssl_connect_data *connssl = cf->ctx; in vtls_shutdown_blocking()
2112 if(cf->shutdown) { in vtls_shutdown_blocking()
2116 CF_DATA_SAVE(save, cf, data); in vtls_shutdown_blocking()
2120 timeout_ms = Curl_shutdown_timeleft(cf->conn, cf->sockindex, NULL); in vtls_shutdown_blocking()
2128 result = Curl_ssl->shut_down(cf, data, send_shutdown, done); in vtls_shutdown_blocking()
2133 what = Curl_conn_cf_poll(cf, data, timeout_ms); in vtls_shutdown_blocking()
2150 CF_DATA_RESTORE(cf, save); in vtls_shutdown_blocking()
2151 cf->shutdown = (result || *done); in vtls_shutdown_blocking()
2158 struct Curl_cfilter *cf, *head; in Curl_ssl_cfilter_remove() local
2162 for(cf = head; cf; cf = cf->next) { in Curl_ssl_cfilter_remove()
2163 if(cf->cft == &Curl_cft_ssl) { in Curl_ssl_cfilter_remove()
2165 CURL_TRC_CF(data, cf, "shutdown and remove SSL, start"); in Curl_ssl_cfilter_remove()
2167 result = vtls_shutdown_blocking(cf, data, send_shutdown, &done); in Curl_ssl_cfilter_remove()
2171 Curl_conn_cf_discard_sub(head, cf, data, FALSE); in Curl_ssl_cfilter_remove()
2172 CURL_TRC_CF(data, cf, "shutdown and remove SSL, done -> %d", result); in Curl_ssl_cfilter_remove()
2179 bool Curl_ssl_cf_is_proxy(struct Curl_cfilter *cf) in Curl_ssl_cf_is_proxy() argument
2181 return (cf->cft->flags & CF_TYPE_SSL) && (cf->cft->flags & CF_TYPE_PROXY); in Curl_ssl_cf_is_proxy()
2185 Curl_ssl_cf_get_config(struct Curl_cfilter *cf, struct Curl_easy *data) in Curl_ssl_cf_get_config() argument
2188 (void)cf; in Curl_ssl_cf_get_config()
2191 return Curl_ssl_cf_is_proxy(cf) ? &data->set.proxy_ssl : &data->set.ssl; in Curl_ssl_cf_get_config()
2196 Curl_ssl_cf_get_primary_config(struct Curl_cfilter *cf) in Curl_ssl_cf_get_primary_config() argument
2199 return &cf->conn->ssl_config; in Curl_ssl_cf_get_primary_config()
2201 return Curl_ssl_cf_is_proxy(cf) ? in Curl_ssl_cf_get_primary_config()
2202 &cf->conn->proxy_ssl_config : &cf->conn->ssl_config; in Curl_ssl_cf_get_primary_config()
2264 CURLcode Curl_alpn_set_negotiated(struct Curl_cfilter *cf, in Curl_alpn_set_negotiated() argument
2273 (cf->conn->bits.tunnel_proxy && Curl_ssl_cf_is_proxy(cf)) ? in Curl_alpn_set_negotiated()
2274 &cf->conn->proxy_alpn : &cf->conn->alpn in Curl_alpn_set_negotiated()
2276 &cf->conn->alpn in Curl_alpn_set_negotiated()