Artifactspublic-v0

curl

master
ply4 git calls29 ms289 KiB3 cachedprotocol v2
172 lines5.6 KiBRaw
1#ifndef HEADER_CURL_SCHANNEL_INT_H
2#define HEADER_CURL_SCHANNEL_INT_H
3/***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
10 * Copyright (C) Marc Hoersken, <info@marc-hoersken.de>, et al.
11 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
12 *
13 * This software is licensed as described in the file COPYING, which
14 * you should have received as part of this distribution. The terms
15 * are also available at https://curl.se/docs/copyright.html.
16 *
17 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
18 * copies of the Software, and permit persons to whom the Software is
19 * furnished to do so, under the terms of the COPYING file.
20 *
21 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 * KIND, either express or implied.
23 *
24 * SPDX-License-Identifier: curl
25 *
26 ***************************************************************************/
27#include "curl_setup.h"
29#ifdef USE_SCHANNEL
31#include "vtls/vtls.h"
32#include "curl_sha256.h"
34#if defined(_MSC_VER) && (_MSC_VER <= 1700)
35/* Workaround for warning:
36 'type cast' : conversion from 'int' to 'LPCSTR' of greater size */
37#undef CERT_STORE_PROV_MEMORY
38#undef CERT_STORE_PROV_SYSTEM_A
39#undef CERT_STORE_PROV_SYSTEM_W
40#define CERT_STORE_PROV_MEMORY ((LPCSTR)(size_t)2)
41#define CERT_STORE_PROV_SYSTEM_A ((LPCSTR)(size_t)9)
42#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)(size_t)10)
43#endif
45/* Offered by mingw-w64 v8+, MS SDK 10.0.17763.0/VS2017 15.8+ */
46#ifndef SCH_CREDENTIALS_VERSION
47#define SCH_CREDENTIALS_VERSION 0x00000005
49typedef enum _eTlsAlgorithmUsage {
50 TlsParametersCngAlgUsageKeyExchange,
51 TlsParametersCngAlgUsageSignature,
52 TlsParametersCngAlgUsageCipher,
53 TlsParametersCngAlgUsageDigest,
54 TlsParametersCngAlgUsageCertSig
55} eTlsAlgorithmUsage;
57/* !checksrc! disable TYPEDEFSTRUCT 1 */
58typedef struct _CRYPTO_SETTINGS {
59 eTlsAlgorithmUsage eAlgorithmUsage;
60 UNICODE_STRING strCngAlgId;
61 DWORD cChainingModes;
62 PUNICODE_STRING rgstrChainingModes; /* spellchecker:disable-line */
63 DWORD dwMinBitLength;
64 DWORD dwMaxBitLength;
65} CRYPTO_SETTINGS, *PCRYPTO_SETTINGS;
67/* !checksrc! disable TYPEDEFSTRUCT 1 */
68typedef struct _TLS_PARAMETERS {
69 DWORD cAlpnIds;
70 PUNICODE_STRING rgstrAlpnIds; /* spellchecker:disable-line */
71 DWORD grbitDisabledProtocols;
72 DWORD cDisabledCrypto;
73 PCRYPTO_SETTINGS pDisabledCrypto;
74 DWORD dwFlags;
75} TLS_PARAMETERS, *PTLS_PARAMETERS;
77/* !checksrc! disable TYPEDEFSTRUCT 1 */
78typedef struct _SCH_CREDENTIALS {
79 DWORD dwVersion;
80 DWORD dwCredFormat;
81 DWORD cCreds;
82 PCCERT_CONTEXT *paCred;
83 HCERTSTORE hRootStore;
85 DWORD cMappers;
86 struct _HMAPPER **aphMappers;
88 DWORD dwSessionLifespan;
89 DWORD dwFlags;
90 DWORD cTlsParameters;
91 PTLS_PARAMETERS pTlsParameters;
92} SCH_CREDENTIALS, *PSCH_CREDENTIALS;
94#endif /* !SCH_CREDENTIALS_VERSION */
96struct Curl_schannel_cred {
97 CredHandle cred_handle;
98 TCHAR *sni_hostname;
99 HCERTSTORE client_cert_store;
100 int refcount;
101};
103struct Curl_schannel_ctxt {
104 CtxtHandle ctxt_handle;
105};
107/* handle encoding/decoding buffers */
108struct sbuffer {
109 size_t length;
110 size_t offset;
111 unsigned char *buffer;
112};
114struct schannel_ssl_backend_data {
115 unsigned char *send_buffer;
116 size_t send_buffer_len;
117 struct sbuffer encdata;
118 struct sbuffer decdata;
119 struct Curl_schannel_cred *cred;
120 struct Curl_schannel_ctxt *ctxt;
121 SecBuffer shutdown_token;
122 size_t shutdown_offset;
123 SecPkgContext_StreamSizes stream_sizes;
124 unsigned long req_flags, ret_flags;
125 CURLcode recv_unrecoverable_err; /* schannel_recv had an unrecoverable err */
126 struct schannel_renegotiate_state {
127 bool started;
128 struct curltime start_time;
129 int io_need;
130 } renegotiate_state;
131 BIT(recv_sspi_close_notify); /* true if connection closed by close_notify */
132 BIT(recv_connection_closed); /* true if connection closed, regardless how */
133 BIT(recv_renegotiating); /* true if recv is doing renegotiation */
134 BIT(use_alpn); /* true if ALPN is used for this connection */
135 BIT(use_manual_cred_validation); /* true if manual cred validation is used */
136 BIT(sent_shutdown);
137 BIT(shutdown_generated);
138 /* encdata_is_incomplete: if encdata contains only a partial record that
139 cannot be decrypted without another recv() (that is, status is
140 SEC_E_INCOMPLETE_MESSAGE) then set this true. after recv() adds more
141 bytes into encdata then set this back to false. */
142 BIT(encdata_is_incomplete);
143};
145struct schannel_cert_share {
146 unsigned char CAinfo_blob_digest[CURL_SHA256_DIGEST_LENGTH];
147 size_t CAinfo_blob_size; /* CA info blob size */
148 char *CAfile; /* CAfile path used to generate
149 certificate store */
150 HCERTSTORE cert_store; /* cached certificate store or
151 NULL if none */
152 struct curltime time; /* when the cached store was created */
153};
155/* size of the structure: 20 bytes */
156struct num_ip_data {
157 DWORD size; /* 04 bytes */
158 union {
159 struct in_addr ia; /* 04 bytes */
160 struct in6_addr ia6; /* 16 bytes */
161 } bData;
162};
164HCERTSTORE Curl_schannel_get_cached_cert_store(struct Curl_cfilter *cf,
165 struct Curl_easy *data);
167bool Curl_schannel_set_cached_cert_store(struct Curl_cfilter *cf,
168 struct Curl_easy *data,
169 HCERTSTORE cert_store);
171#endif /* USE_SCHANNEL */
172#endif /* HEADER_CURL_SCHANNEL_INT_H */
Diagnostics4 git calls · 29 ms
CallStatusSizeTime029 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
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 · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
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 · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=24
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=2
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
fetch2002.3 KiB · hit24 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=2346
git.response.cache=HIT
git.response.duration_ms=24
git.fetch.wants=99790b3778ed38f9aa1b552af9ff8ff8e0f430d6
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=2346
git.pkt.payload.max=2325
git.sideband.band1.bytes=2324
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
a5e37c4f6d143a24
Request
0df5b73b…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format