Artifactspublic-v0

curl

master
ply4 git calls26 ms290 KiB3 cachedprotocol v2
244 lines9.6 KiBRaw
1#ifndef HEADER_CURL_VTLS_H
2#define HEADER_CURL_VTLS_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
11 *
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at https://curl.se/docs/copyright.html.
15 *
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 * SPDX-License-Identifier: curl
24 *
25 ***************************************************************************/
26#include "curl_setup.h"
28struct connectdata;
29struct ssl_easy_config;
30struct ssl_filter_config;
31struct Curl_cfilter;
32struct Curl_easy;
33struct dynbuf;
35#define SSLSUPP_CA_PATH (1 << 0) /* supports CAPATH */
36#define SSLSUPP_CERTINFO (1 << 1) /* supports CURLOPT_CERTINFO */
37#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */
38#define SSLSUPP_SSL_CTX (1 << 3) /* supports CURLOPT_SSL_CTX */
39#define SSLSUPP_HTTPS_PROXY (1 << 4) /* supports access via HTTPS proxies */
40#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */
41#define SSLSUPP_CAINFO_BLOB (1 << 6)
42#define SSLSUPP_ECH (1 << 7)
43#define SSLSUPP_CA_CACHE (1 << 8)
44#define SSLSUPP_CIPHER_LIST (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */
45#define SSLSUPP_SIGNATURE_ALGORITHMS (1 << 10) /* supports TLS sigalgs */
46#define SSLSUPP_ISSUERCERT (1 << 11) /* supports CURLOPT_ISSUERCERT */
47#define SSLSUPP_SSL_EC_CURVES (1 << 12) /* supports CURLOPT_SSL_EC_CURVES */
48#define SSLSUPP_CRLFILE (1 << 13) /* supports CURLOPT_CRLFILE */
49#define SSLSUPP_ISSUERCERT_BLOB (1 << 14) /* CURLOPT_ISSUERCERT_BLOB */
51#ifdef USE_ECH
52/* CURLECH_ values for the ech option */
53#define CURLECH_DISABLE 0
54#define CURLECH_GREASE 1
55#define CURLECH_ENABLE 2
56#define CURLECH_HARD 3
58/* TRUE if ECH is enabled (and supported) */
59bool Curl_ssl_ech_enabled(struct Curl_cfilter *cf);
60/* TRUE if SSL ECH configuration requires DNS HTTPS-RR record */
61bool Curl_ssl_need_httpsrr(struct Curl_cfilter *cf);
62#else
63#define Curl_ssl_ech_enabled(c) FALSE
64#define Curl_ssl_need_httpsrr(c) FALSE
65#endif /* USE_ECH */
67#define ALPN_ACCEPTED "ALPN: server accepted "
69#define VTLS_INFOF_NO_ALPN \
70 "ALPN: server did not agree on a protocol. Uses default."
71#define VTLS_INFOF_ALPN_OFFER_1STR \
72 "ALPN: curl offers %s"
73#define VTLS_INFOF_ALPN_ACCEPTED \
74 ALPN_ACCEPTED "%.*s"
76#define VTLS_INFOF_NO_ALPN_DEFERRED \
77 "ALPN: deferred handshake for early data without specific protocol."
78#define VTLS_INFOF_ALPN_DEFERRED \
79 "ALPN: deferred handshake for early data using '%.*s'."
81/* IETF defined version numbers used in TLS protocol negotiation */
82#define CURL_IETF_PROTO_UNKNOWN 0x0
83#define CURL_IETF_PROTO_SSL3 0x0300
84#define CURL_IETF_PROTO_TLS1 0x0301
85#define CURL_IETF_PROTO_TLS1_1 0x0302
86#define CURL_IETF_PROTO_TLS1_2 0x0303
87#define CURL_IETF_PROTO_TLS1_3 0x0304
88#define CURL_IETF_PROTO_DTLS1 0xFEFF
89#define CURL_IETF_PROTO_DTLS1_2 0xFEFD
91typedef enum {
92 CURL_SSL_PEER_DNS,
93 CURL_SSL_PEER_IPV4,
94 CURL_SSL_PEER_IPV6
95} ssl_peer_type;
97struct ssl_peer {
98 struct Curl_peer *origin; /* the authority we talk to */
99 struct Curl_peer *peer; /* the machine we are connected to */
100 char *sni; /* SNI version of hostname or NULL if not usable */
101 char *scache_key; /* for lookups in session cache */
102 ssl_peer_type type; /* type of the peer information */
103 uint8_t transport; /* one of TRNSPRT_* defines */
104};
106CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name,
107 const curl_ssl_backend ***avail);
109#define MAX_PINNED_PUBKEY_SIZE (1024 * 1024) /* 1 MiB */
111curl_sslbackend Curl_ssl_backend(void);
113/**
114 * Init SSL peer information for filter. Can be called repeatedly.
115 */
116CURLcode Curl_ssl_peer_init(struct ssl_peer *ssl_peer,
117 struct Curl_peer *origin,
118 struct Curl_peer *peer,
119 struct ssl_filter_config *sslc,
120 const char *tls_id,
121 uint8_t transport);
122/**
123 * Free all allocated data and reset peer information.
124 */
125void Curl_ssl_peer_cleanup(struct ssl_peer *peer);
127#ifdef USE_SSL
128int Curl_ssl_init(void);
129void Curl_ssl_cleanup(void);
130/* tell the SSL stuff to close down all open information regarding
131 connections (and thus session ID caching etc) */
132void Curl_ssl_close_all(struct Curl_easy *data);
133CURLcode Curl_ssl_set_engine(struct Curl_easy *data, const char *engine);
134/* Sets engine as default for all SSL operations */
135CURLcode Curl_ssl_set_engine_default(struct Curl_easy *data);
136struct curl_slist *Curl_ssl_engines_list(struct Curl_easy *data);
138void Curl_ssl_version(char *buffer, size_t size);
140/* Certificate information list handling. */
141#define CURL_X509_STR_MAX 100000
142#define MAX_ALLOWED_CERT_AMOUNT 100
144void Curl_ssl_free_certinfo(struct Curl_easy *data);
145CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num);
146CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, int certnum,
147 const char *label, const char *value,
148 size_t valuelen);
149CURLcode Curl_ssl_push_certinfo(struct Curl_easy *data, int certnum,
150 const char *label, const char *value);
152/* Functions to be used by SSL library adaptation functions */
154/* get N random bytes into the buffer */
155CURLcode Curl_ssl_random(struct Curl_easy *data,
156 unsigned char *buffer, size_t length);
157/* Check pinned public key. */
158CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data,
159 const char *pinnedpubkey,
160 const unsigned char *pubkey, size_t pubkeylen);
162bool Curl_ssl_cert_status_request(void);
164/* The maximum size of the SSL channel binding is 85 bytes, as defined in
165 * RFC 5929, Section 4.1. The 'tls-server-end-point:' prefix is 21 bytes,
166 * and SHA-512 is the longest supported hash algorithm, with a digest length of
167 * 64 bytes.
168 * The maximum size of the channel binding is therefore 21 + 64 = 85 bytes.
169 */
170#define SSL_CB_MAX_SIZE 85
172/* Return the tls-server-end-point channel binding, including the
173 * 'tls-server-end-point:' prefix.
174 * If successful, the data is written to the dynbuf, and CURLE_OK is returned.
175 * The dynbuf MUST HAVE a minimum toobig size of SSL_CB_MAX_SIZE.
176 * If the dynbuf is too small, CURLE_OUT_OF_MEMORY is returned.
177 * If channel binding is not supported, binding stays empty and CURLE_OK is
178 * returned.
179 */
180CURLcode Curl_ssl_get_channel_binding(struct Curl_easy *data, int8_t sockindex,
181 struct dynbuf *binding);
183#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
185CURLcode Curl_ssl_cfilter_add(struct Curl_easy *data,
186 struct Curl_peer *origin,
187 struct connectdata *conn,
188 int8_t sockindex);
190CURLcode Curl_cf_ssl_insert_after(struct Curl_cfilter *cf_at,
191 struct Curl_easy *data,
192 struct Curl_peer *origin,
193 struct Curl_peer *peer);
195CURLcode Curl_ssl_cfilter_remove(struct Curl_easy *data,
196 int8_t sockindex, bool send_shutdown);
198#ifndef CURL_DISABLE_PROXY
199CURLcode Curl_cf_ssl_proxy_insert_after(struct Curl_cfilter *cf_at,
200 struct Curl_easy *data,
201 struct Curl_peer *peer);
202#endif /* !CURL_DISABLE_PROXY */
204/**
205 * True iff the underlying SSL implementation supports the option.
206 * Option is one of the defined SSLSUPP_* values.
207 * `data` maybe NULL for the features of the default implementation.
208 */
209bool Curl_ssl_supports(struct Curl_easy *data, unsigned int ssl_option);
211/* Get the ssl_easy_config from `data` relevant for cfilter `cf`. */
212struct ssl_easy_config *
213Curl_ssl_cf_get_easy_config(struct Curl_cfilter *cf,
214 struct Curl_easy *data);
216/* Get the filter config relevant for cfilter `cf`. */
217struct ssl_filter_config *
218Curl_ssl_cf_get_filter_config(struct Curl_cfilter *cf);
220extern struct Curl_cftype Curl_cft_ssl;
221#ifndef CURL_DISABLE_PROXY
222extern struct Curl_cftype Curl_cft_ssl_proxy;
223#endif
225#else /* if not USE_SSL */
227/* When SSL support is not present, define away these function calls */
228#define Curl_ssl_init() 1
229#define Curl_ssl_cleanup() Curl_nop_stmt
230#define Curl_ssl_close_all(x) Curl_nop_stmt
231#define Curl_ssl_set_engine(x, y) CURLE_NOT_BUILT_IN
232#define Curl_ssl_set_engine_default(x) CURLE_NOT_BUILT_IN
233#define Curl_ssl_engines_list(x) NULL
234#define Curl_ssl_free_certinfo(x) Curl_nop_stmt
235#define Curl_ssl_random(x, y, z) ((void)(x), CURLE_NOT_BUILT_IN)
236#define Curl_ssl_cert_status_request() FALSE
237#define Curl_ssl_supports(a, b) FALSE
238#define Curl_ssl_cfilter_add(a, b, c, d) CURLE_NOT_BUILT_IN
239#define Curl_ssl_cfilter_remove(a, b, c) CURLE_OK
240#define Curl_ssl_cf_get_easy_config(a, b) NULL
241#define Curl_ssl_cf_get_filter_config(a) NULL
242#endif
244#endif /* HEADER_CURL_VTLS_H */
Diagnostics4 git calls · 26 ms
CallStatusSizeTime026 ms
discover200152 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit5 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=19
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=5
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2003.3 KiB · hit19 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=3388
git.response.cache=HIT
git.response.duration_ms=19
git.fetch.wants=b7fd4cebce75ec995bdf2448b8f184d4683523b6
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=3388
git.pkt.payload.max=3367
git.sideband.band1.bytes=3366
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e370de5ac522ce
Request
e4354bfe…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format