Artifactspublic-v0

curl

master
ply4 git calls30 ms292 KiB3 cachedprotocol v2
705 lines20 KiBRaw
1/***************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
7 *
8 * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9 *
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.se/docs/copyright.html.
13 *
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 * SPDX-License-Identifier: curl
22 *
23 ***************************************************************************/
24#include "curl_setup.h"
26#ifdef HAVE_GSSAPI
28#include "curl_gssapi.h"
29#include "curl_trc.h"
30#include "curlx/strcopy.h"
32#ifdef DEBUGBUILD
33#if defined(HAVE_GSSGNU) || !defined(_WIN32)
34#define Curl_gss_alloc malloc /* freed via the GSS API gss_release_buffer() */
35#define Curl_gss_free free /* pair of the above */
36#define CURL_GSS_STUB
37/* For correctness this would be required for all platforms, not only Windows,
38 but, as of v1.22.1, MIT Kerberos uses a special allocator only for Windows,
39 and the availability of 'gssapi/gssapi_alloc.h' is difficult to detect,
40 because GSS headers are not versioned, and there is also no other macro to
41 indicate 1.18+ vs. previous versions. On Windows we can use 'GSS_S_BAD_MIC'.
42 */
43#elif defined(_WIN32) && defined(GSS_S_BAD_MIC) /* MIT Kerberos 1.15+ */
44/* MIT Kerberos 1.10+ (Windows), 1.18+ (all platforms), missing from GNU GSS */
45#include <gssapi/gssapi_alloc.h>
46#define Curl_gss_alloc gssalloc_malloc
47#define Curl_gss_free gssalloc_free
48#define CURL_GSS_STUB
49#endif
50#endif /* DEBUGBUILD */
52#ifdef __GNUC__
53#define CURL_ALIGN8 __attribute__((aligned(8)))
54#else
55#define CURL_ALIGN8
56#endif
58#if defined(CURL_HAVE_DIAG) && defined(__APPLE__) && !defined(HAVE_GSSAPPLE)
59#pragma GCC diagnostic push
60#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
61#endif
63gss_OID_desc Curl_spnego_mech_oid CURL_ALIGN8 = {
64 6, CURL_UNCONST("\x2b\x06\x01\x05\x05\x02")
65};
66gss_OID_desc Curl_krb5_mech_oid CURL_ALIGN8 = {
67 9, CURL_UNCONST("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02")
68};
70#ifdef CURL_GSS_STUB
71enum min_err_code {
72 STUB_GSS_OK = 0,
73 STUB_GSS_NO_MEMORY,
74 STUB_GSS_INVALID_ARGS,
75 STUB_GSS_INVALID_CREDS,
76 STUB_GSS_INVALID_CTX,
77 STUB_GSS_SERVER_ERR,
78 STUB_GSS_NO_MECH,
79 STUB_GSS_LAST
80};
82/* libcurl is also passing this struct to these functions, which are not yet
83 * stubbed:
84 * gss_unwrap()
85 * gss_wrap()
86 */
87struct stub_gss_ctx_id_t_desc {
88 enum { STUB_GSS_NONE, STUB_GSS_KRB5, STUB_GSS_NTLM1, STUB_GSS_NTLM3 } sent;
89 int have_krb5;
90 int have_ntlm;
91 OM_uint32 flags;
92 char creds[250];
93};
95/* Stub credential: tracks which mechanisms are allowed */
96struct stub_gss_cred_id_t_desc {
97 int allow_krb5;
98 int allow_ntlm;
99};
101static OM_uint32 stub_gss_init_sec_context(
102 OM_uint32 *min,
103 gss_cred_id_t initiator_cred_handle,
104 struct stub_gss_ctx_id_t_desc **context,
105 gss_name_t target_name,
106 const gss_OID mech_type,
107 OM_uint32 req_flags,
108 OM_uint32 time_req,
109 const gss_channel_bindings_t input_chan_bindings,
110 gss_buffer_desc *input_token,
111 gss_OID *actual_mech_type,
112 gss_buffer_desc *output_token,
113 OM_uint32 *ret_flags,
114 OM_uint32 *time_rec)
116 struct stub_gss_ctx_id_t_desc *ctx = NULL;
118 /* The token will be encoded in base64 */
119 size_t length = sizeof(ctx->creds) * 3 / 4;
120 size_t used = 0;
121 char *token = NULL;
122 const char *creds = NULL;
124 (void)mech_type;
125 (void)time_req;
126 (void)input_chan_bindings;
127 (void)actual_mech_type;
129 if(!min)
130 return GSS_S_FAILURE;
132 *min = 0;
134 if(!context || !target_name || !output_token) {
135 *min = STUB_GSS_INVALID_ARGS;
136 return GSS_S_FAILURE;
137 }
139 creds = getenv("CURL_STUB_GSS_CREDS");
140 if(!creds || strlen(creds) >= sizeof(ctx->creds)) {
141 *min = STUB_GSS_INVALID_CREDS;
142 return GSS_S_FAILURE;
143 }
145 ctx = *context;
146 if(ctx && strcmp(ctx->creds, creds)) {
147 *min = STUB_GSS_INVALID_CREDS;
148 return GSS_S_FAILURE;
149 }
151 output_token->length = 0;
152 output_token->value = NULL;
154 if(input_token && input_token->length) {
155 if(!ctx) {
156 *min = STUB_GSS_INVALID_CTX;
157 return GSS_S_FAILURE;
158 }
160 /* Server response, either D (RA==) or C (Qw==) */
161 if(((char *)input_token->value)[0] == 'D') {
162 /* Done */
163 switch(ctx->sent) {
164 case STUB_GSS_KRB5:
165 case STUB_GSS_NTLM3:
166 if(ret_flags)
167 *ret_flags = ctx->flags;
168 if(time_rec)
169 *time_rec = GSS_C_INDEFINITE;
170 return GSS_S_COMPLETE;
171 default:
172 *min = STUB_GSS_SERVER_ERR;
173 return GSS_S_FAILURE;
174 }
175 }
177 if(((char *)input_token->value)[0] != 'C') {
178 /* We only support Done or Continue */
179 *min = STUB_GSS_SERVER_ERR;
180 return GSS_S_FAILURE;
181 }
183 /* Continue */
184 switch(ctx->sent) {
185 case STUB_GSS_KRB5:
186 /* We sent KRB5 and it failed, let's try NTLM */
187 if(ctx->have_ntlm) {
188 ctx->sent = STUB_GSS_NTLM1;
189 break;
190 }
191 else {
192 *min = STUB_GSS_SERVER_ERR;
193 return GSS_S_FAILURE;
194 }
195 case STUB_GSS_NTLM1:
196 ctx->sent = STUB_GSS_NTLM3;
197 break;
198 default:
199 *min = STUB_GSS_SERVER_ERR;
200 return GSS_S_FAILURE;
201 }
202 }
203 else {
204 if(ctx) {
205 *min = STUB_GSS_INVALID_CTX;
206 return GSS_S_FAILURE;
207 }
209 ctx = curlx_calloc(1, sizeof(*ctx));
210 if(!ctx) {
211 *min = STUB_GSS_NO_MEMORY;
212 return GSS_S_FAILURE;
213 }
215 if(strstr(creds, "KRB5"))
216 ctx->have_krb5 = 1;
218 if(strstr(creds, "NTLM"))
219 ctx->have_ntlm = 1;
221 /* If a credential restricts allowed mechs, honour it */
222 if(initiator_cred_handle != GSS_C_NO_CREDENTIAL) {
223 struct stub_gss_cred_id_t_desc *cred =
224 (struct stub_gss_cred_id_t_desc *)initiator_cred_handle;
225 if(!cred->allow_krb5)
226 ctx->have_krb5 = 0;
227 if(!cred->allow_ntlm)
228 ctx->have_ntlm = 0;
229 }
231 if(ctx->have_krb5)
232 ctx->sent = STUB_GSS_KRB5;
233 else if(ctx->have_ntlm)
234 ctx->sent = STUB_GSS_NTLM1;
235 else {
236 curlx_free(ctx);
237 *min = STUB_GSS_NO_MECH;
238 return GSS_S_FAILURE;
239 }
241 curlx_strcopy(ctx->creds, sizeof(ctx->creds), creds, strlen(creds));
242 ctx->flags = req_flags;
243 }
245 token = Curl_gss_alloc(length);
246 if(!token) {
247 curlx_free(ctx);
248 *min = STUB_GSS_NO_MEMORY;
249 return GSS_S_FAILURE;
250 }
252 {
253 gss_buffer_desc target_desc;
254 gss_OID name_type = GSS_C_NO_OID;
255 OM_uint32 minor_status;
256 OM_uint32 major_status;
257 major_status = gss_display_name(&minor_status, target_name,
258 &target_desc, &name_type);
259 if(GSS_ERROR(major_status)) {
260 Curl_gss_free(token);
261 curlx_free(ctx);
262 *min = STUB_GSS_NO_MEMORY;
263 return GSS_S_FAILURE;
264 }
266 if(strlen(creds) + target_desc.length + 5 >= sizeof(ctx->creds)) {
267 Curl_gss_free(token);
268 curlx_free(ctx);
269 *min = STUB_GSS_NO_MEMORY;
270 return GSS_S_FAILURE;
271 }
273 /* Token format: creds:target:type:padding */
274 used = curl_msnprintf(token, length, "%s:%.*s:%d:", creds,
275 (int)target_desc.length,
276 (const char *)target_desc.value,
277 (int)ctx->sent);
279 gss_release_buffer(&minor_status, &target_desc);
280 }
282 if(used >= length) {
283 Curl_gss_free(token);
284 curlx_free(ctx);
285 *min = STUB_GSS_NO_MEMORY;
286 return GSS_S_FAILURE;
287 }
289 /* Overwrite null-terminator */
290 memset(token + used, 'A', length - used);
292 *context = ctx;
294 output_token->value = token;
295 output_token->length = length;
297 return GSS_S_CONTINUE_NEEDED;
300static OM_uint32 stub_gss_delete_sec_context(
301 OM_uint32 *min,
302 struct stub_gss_ctx_id_t_desc **context,
303 gss_buffer_t output_token)
305 (void)output_token;
307 if(!min)
308 return GSS_S_FAILURE;
310 if(!context) {
311 *min = STUB_GSS_INVALID_CTX;
312 return GSS_S_FAILURE;
313 }
314 if(!*context) {
315 *min = STUB_GSS_INVALID_CTX;
316 return GSS_S_FAILURE;
317 }
319 curlx_safefree(*context);
320 *min = 0;
322 return GSS_S_COMPLETE;
325/* NTLMSSP OID: 1.3.6.1.4.1.311.2.2.10 */
326static gss_OID_desc stub_ntlmssp_oid = {
327 10, CURL_UNCONST("\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a")
328};
330static OM_uint32 stub_gss_inquire_context(
331 OM_uint32 *min,
332 struct stub_gss_ctx_id_t_desc *context,
333 gss_name_t *src_name,
334 gss_name_t *targ_name,
335 OM_uint32 *lifetime_rec,
336 gss_OID *mech_type,
337 OM_uint32 *ctx_flags,
338 int *locally_initiated,
339 int *open_context)
341 (void)src_name;
342 (void)targ_name;
343 (void)lifetime_rec;
344 (void)ctx_flags;
345 (void)locally_initiated;
346 (void)open_context;
348 if(!min)
349 return GSS_S_FAILURE;
351 if(!context) {
352 *min = STUB_GSS_INVALID_CTX;
353 return GSS_S_FAILURE;
354 }
356 *min = 0;
357 if(mech_type) {
358 switch(context->sent) {
359 case STUB_GSS_NTLM1:
360 case STUB_GSS_NTLM3:
361 *mech_type = &stub_ntlmssp_oid;
362 break;
363 default:
364 *mech_type = (gss_OID)&Curl_krb5_mech_oid;
365 break;
366 }
367 }
369 return GSS_S_COMPLETE;
371static OM_uint32 stub_gss_acquire_cred(
372 OM_uint32 *min,
373 gss_name_t desired_name,
374 OM_uint32 time_req,
375 gss_OID_set desired_mechs,
376 gss_cred_usage_t cred_usage,
377 gss_cred_id_t *output_cred_handle,
378 gss_OID_set *actual_mechs,
379 OM_uint32 *time_rec)
381 (void)desired_name;
382 (void)time_req;
383 (void)desired_mechs;
384 (void)cred_usage;
385 (void)actual_mechs;
386 (void)time_rec;
388 if(!min)
389 return GSS_S_FAILURE;
391 *min = 0;
392 /* Allocate a stub credential that initially allows all mechanisms */
393 if(output_cred_handle) {
394 struct stub_gss_cred_id_t_desc *cred =
395 curlx_calloc(1, sizeof(*cred));
396 if(!cred) {
397 *min = STUB_GSS_NO_MEMORY;
398 return GSS_S_FAILURE;
399 }
400 cred->allow_krb5 = 1;
401 cred->allow_ntlm = 1;
402 *output_cred_handle = (gss_cred_id_t)cred;
403 }
404 return GSS_S_COMPLETE;
407static OM_uint32 stub_gss_indicate_mechs(
408 OM_uint32 *min,
409 gss_OID_set *mech_set)
411 const char *creds;
412 OM_uint32 major;
414 if(!min)
415 return GSS_S_FAILURE;
417 *min = 0;
418 creds = getenv("CURL_STUB_GSS_CREDS");
419 if(!creds) {
420 *min = STUB_GSS_INVALID_CREDS;
421 return GSS_S_FAILURE;
422 }
424 major = gss_create_empty_oid_set(min, mech_set);
425 if(GSS_ERROR(major))
426 return major;
428 /* Always include Kerberos */
429 gss_add_oid_set_member(min, (gss_OID)&Curl_krb5_mech_oid, mech_set);
431 /* Include NTLM if the stub creds contain NTLM */
432 if(strstr(creds, "NTLM"))
433 gss_add_oid_set_member(min, &stub_ntlmssp_oid, mech_set);
435 return GSS_S_COMPLETE;
438#ifdef HAVE_GSS_SET_NEG_MECHS /* MIT Kerberos 1.8+ (2010-03-02),
439 missing from Apple GSS, GNU GSS */
440static OM_uint32 stub_gss_set_neg_mechs(OM_uint32 *min,
441 gss_cred_id_t cred_handle,
442 const gss_OID_set mech_set)
444 struct stub_gss_cred_id_t_desc *cred;
445 size_t i;
446 int found_krb5 = 0;
447 int found_ntlm = 0;
449 if(!min)
450 return GSS_S_FAILURE;
452 *min = 0;
453 if(cred_handle == GSS_C_NO_CREDENTIAL)
454 return GSS_S_FAILURE;
456 cred = (struct stub_gss_cred_id_t_desc *)cred_handle;
458 /* Determine which mechs are in the allowed set */
459 if(mech_set) {
460 for(i = 0; i < mech_set->count; i++) {
461 gss_OID oid = &mech_set->elements[i];
462 if(oid->length == Curl_krb5_mech_oid.length &&
463 !memcmp(oid->elements, Curl_krb5_mech_oid.elements, oid->length))
464 found_krb5 = 1;
465 if(oid->length == stub_ntlmssp_oid.length &&
466 !memcmp(oid->elements, stub_ntlmssp_oid.elements, oid->length))
467 found_ntlm = 1;
468 }
469 }
471 cred->allow_krb5 = found_krb5;
472 cred->allow_ntlm = found_ntlm;
473 return GSS_S_COMPLETE;
475#endif /* HAVE_GSS_SET_NEG_MECHS */
477static OM_uint32 stub_gss_release_cred(
478 OM_uint32 *min,
479 gss_cred_id_t *cred_handle)
481 if(!min)
482 return GSS_S_FAILURE;
484 *min = 0;
485 if(cred_handle && *cred_handle != GSS_C_NO_CREDENTIAL) {
486 curlx_free(*cred_handle);
487 *cred_handle = GSS_C_NO_CREDENTIAL;
488 }
489 return GSS_S_COMPLETE;
492#endif /* CURL_GSS_STUB */
494OM_uint32 Curl_gss_init_sec_context(struct Curl_easy *data,
495 OM_uint32 *minor_status,
496 gss_ctx_id_t *context,
497 gss_name_t target_name,
498 gss_OID mech_type,
499 gss_channel_bindings_t input_chan_bindings,
500 gss_buffer_t input_token,
501 gss_buffer_t output_token,
502 const bool mutual_auth,
503 OM_uint32 *ret_flags,
504 gss_cred_id_t cred_handle)
506 OM_uint32 req_flags = GSS_C_REPLAY_FLAG;
508 if(mutual_auth)
509 req_flags |= GSS_C_MUTUAL_FLAG;
511 if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_POLICY_FLAG) {
512#ifdef GSS_C_DELEG_POLICY_FLAG /* MIT Kerberos 1.7+ (2009-06-02), Apple GSS,
513 missing from GNU GSS */
514 req_flags |= GSS_C_DELEG_POLICY_FLAG;
515#else
516 infof(data, "WARNING: support for CURLGSSAPI_DELEGATION_POLICY_FLAG not "
517 "compiled in");
518#endif
519 }
521 if(data->set.gssapi_delegation & CURLGSSAPI_DELEGATION_FLAG)
522 req_flags |= GSS_C_DELEG_FLAG;
524#ifdef CURL_GSS_STUB
525 if(getenv("CURL_STUB_GSS_CREDS"))
526 return stub_gss_init_sec_context(minor_status,
527 cred_handle,
528 (struct stub_gss_ctx_id_t_desc **)context,
529 target_name,
530 mech_type,
531 req_flags,
532 0, /* time_req */
533 input_chan_bindings,
534 input_token,
535 NULL, /* actual_mech_type */
536 output_token,
537 ret_flags,
538 NULL /* time_rec */);
539#endif /* CURL_GSS_STUB */
541 return gss_init_sec_context(minor_status,
542 cred_handle,
543 context,
544 target_name,
545 mech_type,
546 req_flags,
547 0, /* time_req */
548 input_chan_bindings,
549 input_token,
550 NULL, /* actual_mech_type */
551 output_token,
552 ret_flags,
553 NULL /* time_rec */);
556OM_uint32 Curl_gss_delete_sec_context(OM_uint32 *min,
557 gss_ctx_id_t *context,
558 gss_buffer_t output_token)
560#ifdef CURL_GSS_STUB
561 if(getenv("CURL_STUB_GSS_CREDS"))
562 return stub_gss_delete_sec_context(min,
563 (struct stub_gss_ctx_id_t_desc **)context,
564 output_token);
565#endif /* CURL_GSS_STUB */
567 return gss_delete_sec_context(min, context, output_token);
570OM_uint32 Curl_gss_inquire_context(OM_uint32 *minor_status,
571 gss_ctx_id_t context,
572 gss_OID *mech_type)
574#ifdef CURL_GSS_STUB
575 if(getenv("CURL_STUB_GSS_CREDS"))
576 return stub_gss_inquire_context(minor_status,
577 (struct stub_gss_ctx_id_t_desc *)context,
578 NULL, NULL, NULL, mech_type,
579 NULL, NULL, NULL);
580#endif /* CURL_GSS_STUB */
582 return gss_inquire_context(minor_status, context,
583 NULL, NULL, NULL, mech_type,
584 NULL, NULL, NULL);
587OM_uint32 Curl_gss_acquire_cred(OM_uint32 *minor_status,
588 gss_name_t desired_name,
589 OM_uint32 time_req,
590 gss_OID_set desired_mechs,
591 gss_cred_usage_t cred_usage,
592 gss_cred_id_t *output_cred_handle,
593 gss_OID_set *actual_mechs,
594 OM_uint32 *time_rec)
596#ifdef CURL_GSS_STUB
597 if(getenv("CURL_STUB_GSS_CREDS"))
598 return stub_gss_acquire_cred(minor_status, desired_name, time_req,
599 desired_mechs, cred_usage,
600 output_cred_handle, actual_mechs, time_rec);
601#endif /* CURL_GSS_STUB */
603 return gss_acquire_cred(minor_status, desired_name, time_req,
604 desired_mechs, cred_usage,
605 output_cred_handle, actual_mechs, time_rec);
608OM_uint32 Curl_gss_indicate_mechs(OM_uint32 *minor_status,
609 gss_OID_set *mech_set)
611#ifdef CURL_GSS_STUB
612 if(getenv("CURL_STUB_GSS_CREDS"))
613 return stub_gss_indicate_mechs(minor_status, mech_set);
614#endif /* CURL_GSS_STUB */
616 return gss_indicate_mechs(minor_status, mech_set);
619#ifdef HAVE_GSS_SET_NEG_MECHS
620OM_uint32 Curl_gss_set_neg_mechs(OM_uint32 *minor_status,
621 gss_cred_id_t cred_handle,
622 const gss_OID_set mech_set)
624#ifdef CURL_GSS_STUB
625 if(getenv("CURL_STUB_GSS_CREDS"))
626 return stub_gss_set_neg_mechs(minor_status, cred_handle, mech_set);
627#endif /* CURL_GSS_STUB */
629 return gss_set_neg_mechs(minor_status, cred_handle, mech_set);
631#endif /* HAVE_GSS_SET_NEG_MECHS */
633OM_uint32 Curl_gss_release_cred(OM_uint32 *minor_status,
634 gss_cred_id_t *cred_handle)
636#ifdef CURL_GSS_STUB
637 if(getenv("CURL_STUB_GSS_CREDS"))
638 return stub_gss_release_cred(minor_status, cred_handle);
639#endif /* CURL_GSS_STUB */
641 return gss_release_cred(minor_status, cred_handle);
644#ifdef CURLVERBOSE
645#define GSS_LOG_BUFFER_LEN 1024
646static size_t display_gss_error(OM_uint32 status, int type,
647 char *buf, size_t len)
649 OM_uint32 maj_stat;
650 OM_uint32 min_stat;
651 OM_uint32 msg_ctx = 0;
652 gss_buffer_desc status_string = GSS_C_EMPTY_BUFFER;
654 do {
655 maj_stat = gss_display_status(&min_stat,
656 status,
657 type,
658 GSS_C_NO_OID,
659 &msg_ctx,
660 &status_string);
661 if(maj_stat == GSS_S_COMPLETE && status_string.length > 0) {
662 if(GSS_LOG_BUFFER_LEN > len + status_string.length + 3) {
663 len += curl_msnprintf(buf + len, GSS_LOG_BUFFER_LEN - len,
664 "%.*s. ", (int)status_string.length,
665 (char *)status_string.value);
666 }
667 }
668 gss_release_buffer(&min_stat, &status_string);
669 } while(!GSS_ERROR(maj_stat) && msg_ctx);
671 return len;
674/*
675 * Curl_gss_log_error()
676 *
677 * This is used to log a GSS-API error status.
678 *
679 * Parameters:
680 *
681 * data [in] - The session handle.
682 * prefix [in] - The prefix of the log message.
683 * major [in] - The major status code.
684 * minor [in] - The minor status code.
685 */
686void Curl_gss_log_error(struct Curl_easy *data, const char *prefix,
687 OM_uint32 major, OM_uint32 minor)
689 char buf[GSS_LOG_BUFFER_LEN] = "";
690 size_t len = 0;
692 if(major != GSS_S_FAILURE)
693 len = display_gss_error(major, GSS_C_GSS_CODE, buf, len);
695 display_gss_error(minor, GSS_C_MECH_CODE, buf, len);
697 infof(data, "%s%s", prefix, buf);
699#endif /* CURLVERBOSE */
701#if defined(CURL_HAVE_DIAG) && defined(__APPLE__) && !defined(HAVE_GSSAPPLE)
702#pragma GCC diagnostic pop
703#endif
705#endif /* HAVE_GSSAPI */
Diagnostics4 git calls · 30 ms
CallStatusSizeTime030 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=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 · 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 · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=26
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
fetch2005.3 KiB · hit26 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=5408
git.response.cache=HIT
git.response.duration_ms=26
git.fetch.wants=437f76d04a46d7f63aff4376dc610ee9e95ce907
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=5408
git.pkt.payload.max=5387
git.sideband.band1.bytes=5386
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
a5e2dc3a8acfc125
Request
4cdf6021…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format