summaryrefslogtreecommitdiff
path: root/src/libgit2/transports
Commit message (Collapse)AuthorAgeFilesLines
* net: move `gitno` buffer to `staticstr`Edward Thomson2023-05-139-84/+82
| | | | | | | | The `gitno` buffer interface is another layer on top of socket reads. Abstract it a bit into a "static string" that has `git_str` like semantics but without heap allocation which moves the actual reading logic into the socket / stream code, and allows for easier future usage of a static / stack-allocated `git_str`-like interface.
* util: make monotonic time fn return msEdward Thomson2023-05-131-4/+4
| | | | | | | | | | | | | | | | | `git__timer` is now `git_time_monotonic`, and returns milliseconds since an arbitrary epoch. Using a floating point to store the number of seconds elapsed was clever, as it better supports the wide range of precision from the different monotonic clocks of different systems. But we're a version control system, not a real-time clock. Milliseconds is a good enough precision for our work _and_ it's the units that system calls like `poll` take and that our users interact with. Make `git_time_monotonic` return the monotonically increasing number of milliseconds "ticked" since some arbitrary epoch.
* oid: use an oid array instead of shallowarrayEdward Thomson2023-05-095-63/+73
| | | | | | Users should provide us an array of object ids; we don't need a separate type. And especially, we should not be mutating user-providing values. Instead, use `git_oid *` in the shallow code.
* shallow: avoid unnecessary pkt freeEdward Thomson2023-05-081-7/+9
| | | | Looks like a double-free here.
* transport: transports understand oid typeEdward Thomson2023-04-252-10/+22
| | | | Teach the smart transport more about oid types, instead of assuming SHA1.
* shallow: don't assume SHA1Edward Thomson2023-04-251-24/+42
|
* smart: validate shallow/unshallow pktsEdward Thomson2023-04-251-6/+24
|
* Merge remote-tracking branch 'origin/main' into shallow-clone-networkEdward Thomson2023-04-226-58/+399
|\
| * http: add SSPI authentication on WindowsEdward Thomson2023-03-213-4/+345
| | | | | | | | | | Add support for SSPI on Windows, which offers NTLM and Negotiate authentication.
| * utf8: add conversion with size and refactor namesEdward Thomson2023-03-211-12/+12
| | | | | | | | | | | | | | | | Add functions to use convert a string with length, instead of assuming NUL termination. In addition, move the utf8 to 16 conversion routines into the `git_utf8` namespace instead of using namespaceless `git__` prefixed names.
| * http: refactor GSSAPI / negotiate / NTLM authEdward Thomson2023-03-213-46/+46
| | | | | | | | | | | | | | | | | | | | Name the GSSAPI and ntlmclient authentication providers as such. Today they're named after the authentication mechanism ("Negotiate", "NTLM") instead of their implementation. If we have competing implementations for the same mechanism (eg, a future Windows SSPI-based provider for Negotiate and NTLM) then this will get confusing.
* | Merge branch 'shallow-clone-network' of https://github.com/mathworks/libgit2 ↵lmcglash2023-03-101-1/+1
|\ \ | | | | | | | | | into shallow-clone-network
| * | Apply suggestions from code reviewLaurence McGlashan2023-03-101-1/+1
| | | | | | | | | Co-authored-by: Qix <Qix-@users.noreply.github.com>
* | | Remove stray commalmcglash2023-03-101-2/+2
|/ /
* | Merge commit 'd066d0d95c43e97df6624292f3f527f9372ca8fe'lmcglash2023-03-1010-161/+616
|\ \ | |/
| * Revert "Pass hostkey & port to host verify callback"Edward Thomson2023-02-271-11/+3
| | | | | | | | This reverts commit f68b40c0af9c7c5c2c8740fe4a8fbcba367e0087.
| * Pass hostkey & port to host verify callbackFrancois-Xavier Coudert2023-02-241-3/+11
| | | | | | | | Co-authored-by: Stefan Karpinski <stefan@karpinski.org>
| * net: parse urls or scp style paths in the same functionEdward Thomson2023-02-241-11/+7
| |
| * Make failure to connect to ssh-agent non-fatalFrancois-Xavier Coudert2023-02-221-1/+3
| | | | | | | | | | | | | | | | | | Fixes https://github.com/libgit2/libgit2/issues/3866 Has been applied in all Julia builds since 2017: https://github.com/JuliaLang/julia/pull/17459 Authored-by: Keno Fischer <kfischer@college.harvard.edu>
| * Merge pull request #6456 from libgit2/ethomson/sha256_experimentalEdward Thomson2023-02-145-46/+243
| |\ | | | | | | SHA256: more SHA256 support
| | * transport: teach transports about oid types and SHA256Edward Thomson2023-02-125-30/+140
| | |
| | * clone: support sha256Edward Thomson2023-02-123-22/+109
| | |
| * | Set all SSH hostkey preferences that are availableEric Huss2023-02-091-43/+42
| | |
| * | ssh: give a realistic error messageEdward Thomson2023-02-091-2/+2
| | | | | | | | | | | | | | | I spent an hour banging my head against this, when it was because the remote didn't trust my key.
| * | ssh: support windows `known_hosts` filesEdward Thomson2023-02-091-8/+8
| |/ | | | | | | | | | | | | Use `git_sysdir_find_homedir_file` to identify the path to the home directory's `.ssh/known_hosts`; this takes Windows paths into account by preferring `HOME`, then falling back to `HOMEPATH` and `USERPROFILE` directories.
| * Merge pull request #6435 from russell/capabilities-typoEdward Thomson2023-01-201-2/+2
| |\ | | | | | | transport: fix capabilities calculation
| | * transport: fix capabilities calculationRussell Sim2022-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | This looks like a typo to me, from what i can see these lines were added at the same time and because of how capabilities are calculated, it's likely that this code will work in situations where these capabilities were the last ones.
| * | Merge commit 'e33d7c068' into ssh_key_checkingEdward Thomson2023-01-201-91/+326
| |\ \ | | |/ | |/|
| | * ssh: look for a key in known_hosts to set the key type for the handshakeCarlos Martín Nieto2022-11-041-53/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The server and client negotiate a single hostkey, but the "best" cipher may not be the one for which we have an entry in `known_hosts`. This can lead to us not finding the key in known_hosts even though we should be connecting. Instead here we look up the hostname with a nonsense key to perform a lookup in the known hosts and set that. This is roughly what the OpenSSH client does as well.
| | * ssh: verify the remote's host key against known_hosts if it existsCarlos Martín Nieto2022-11-021-87/+222
| | | | | | | | | | | | | | | It turns out this has been available in libssh2 for a long time and we should have been verifying this the whole time.
| * | http: Update httpclient options when reusing an existing connection.Sebastian Lackner2022-10-203-7/+27
| |/ | | | | | | | | | | | | | | | | | | Httpclient internally stores a copy of the certificate_check callback and payload. When connecting via HTTPS, and if the server sends back "Connection: close" after the first request, the following request would attempt to re-use the httpclient and call the (now outdated) callback. In particular for pygit2 this is a problem, since callbacks / payloads are only valid for the duration of a libgit2 call, leading to a ffi.from_handle() error and crashing the Python interpreter.
| * winhttp: handle long custom headersKevin Saul2022-07-221-4/+9
| |
* | fix shallow array searchYuang Li2022-09-061-1/+1
| |
* | refactor smart_pktYuang Li2022-08-311-2/+2
| |
* | Use GIT_OID_SHA1_HEXSIZEYuang Li2022-08-311-8/+8
| |
* | support fetch unshallow option on shallow reposyuangli2022-08-091-4/+22
| |
* | fix memory leakyuangli2022-08-091-0/+2
| |
* | fix grafts and shallowarray memory leaksyuangli2022-08-022-8/+0
| |
* | attempt to fix nego.shallowarray memory leakyuangli2022-08-022-0/+8
| |
* | fix memory leaks about packetsyuangli2022-08-012-0/+6
| |
* | fix clone::shallow test behaviouryuangli2022-07-291-2/+0
| |
* | eliminate build warningsyuangli2022-07-291-2/+2
| |
* | remove build errorsyuangli2022-07-291-8/+8
| |
* | Merge branch 'transportPR' into shallow-clone-networkyuangli2022-07-295-20/+189
|/
* sha256: indirection for experimental functionsEdward Thomson2022-07-131-2/+3
| | | | | The experimental function signature is only available when `GIT_EXPERIMENTAL_SHA256` is enabled.
* oid: give oids a typeEdward Thomson2022-06-201-2/+4
| | | | | `git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
* oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`Edward Thomson2022-06-142-15/+15
| | | | | In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
* Apply suggestions from code reviewlhchavez2022-06-111-1/+1
| | | Co-authored-by: Edward Thomson <ethomson@github.com>
* transport: introduce `git_transport_smart_remote_connect_options`lhchavez2022-04-161-0/+12
| | | | | | | | | | | 6fc6eeb66c40310086c8f059cae41de69ad4c6da removed `git_transport_smart_proxy_option`, and there was nothing added to replace it. That made it hard for custom transports / smart subtransports to know what remote connect options to use (e.g. proxy options). This change introduces `git_transport_smart_remote_connect_options` to replace it.
* http: skip processing when body is null or 0 lengthEdward Thomson2022-02-271-1/+1
| | | | Mistakenly `&&` when we should have `||`d.