summaryrefslogtreecommitdiff
path: root/src/transports
Commit message (Collapse)AuthorAgeFilesLines
* winhttp: plug some leaksEdward Thomson2014-12-091-47/+67
|
* Merge pull request #2730 from libgit2/cmn/local-pushEdward Thomson2014-12-051-11/+6
|\ | | | | Adjust the local transport for the common refspec parser
| * local: adjust to the common refspec parsercmn/local-pushCarlos Martín Nieto2014-11-231-11/+6
| | | | | | | | | | | | | | We no longer have NULL strings, but empty ones and duplicate the sides if necessar, so the first check will never do anything. While in the area, remove unnecessary ifs and early returns.
* | win32: clear connection data on closeEdward Thomson2014-12-031-0/+1
|/
* Plug leaksCarlos Martín Nieto2014-11-231-6/+14
| | | | Valgrind is now clean except for libssl and libgcrypt.
* fetch: clear the connection data on closecmn/fetch-twiceCarlos Martín Nieto2014-11-191-0/+1
| | | | | | | | | | | When we fetch twice with the same remote object, we did not properly clear the connection flags, so we would leak state from the last connection. This can cause the second fetch with the same remote object to fail if using a HTTP URL where the server redirects to HTTPS, as the second fetch would see `use_ssl` set and think the initial connection wanted to downgrade the connection.
* push: use the common refspec parsercmn/push-refspec-refactorCarlos Martín Nieto2014-11-092-8/+8
| | | | | | | | | | | There is one well-known and well-tested parser which we should use, instead of implementing parsing a second time. The common parser is also augmented to copy the LHS into the RHS if the latter is empty. The expressions test had to change a bit, as we now catch a bad RHS of a refspec locally.
* Minor cleanup: Use defined no_check_cert_flags instead of C&P them againSven Strickroth2014-10-261-8/+6
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Cleanup memory leak in ssh transportEdward Thomson2014-10-261-34/+28
|
* Clean up various compiler warningsEdward Thomson2014-10-262-4/+10
|
* Provide host name to certificate_check_cbSven Strickroth2014-09-223-3/+3
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Merge pull request #2567 from cirosantilli/factor-41Vicent Marti2014-09-171-3/+3
|\ | | | | Factor 40 and 41 constants from source.
| * Factor 40 and 41 constants from source.Ciro Santilli2014-09-161-3/+3
| |
* | winhttp: get rid of the cert ignore flagCarlos Martín Nieto2014-09-161-7/+0
| | | | | | | | This brings us back in line with the other transports.
* | ssh: expose both hashesCarlos Martín Nieto2014-09-161-9/+9
| | | | | | | | | | The user may have the data hashed as MD5 or SHA-1, so we should provide both types for consumption.
* | ssh: provide our own types for host key lengthsCarlos Martín Nieto2014-09-161-9/+7
| | | | | | | | | | Instead of using the libssh2 defines, provide our own, which eases usage as we do not need to check whether libgit2 was built with libssh2 or not.
* | net: use only structs to pass information about certCarlos Martín Nieto2014-09-163-3/+13
| | | | | | | | | | | | Instead of spreading the data in function arguments, some of which aren't used for ssh and having a struct only for ssh, use a struct for both, using a common parent to pass to the callback.
* | Merge remote-tracking branch 'upstream/master' into cmn/host-cert-infoCarlos Martín Nieto2014-09-162-2/+8
|\ \ | |/
| * ssh: store error message immediately after a failed agent callcmn/ssh-errorsCarlos Martín Nieto2014-09-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the call to the agent fails, we must retrieve the error message just after the function call, as other calls may overwrite it. As the agent authentication is the only one which has a teardown and there does not seem to be a way to get the error message from a stored error number, this tries to introduce some small changes to store the error from the agent. Clearing the error at the beginning of the loop lets us know whether the agent has already set the libgit2 error message and we should skip it, or if we should set it.
| * Several CppCat warnings fixedArkady Shapkin2014-09-031-1/+1
| |
* | net: remove support for outright ignoring certificatesCarlos Martín Nieto2014-09-161-3/+0
| | | | | | | | | | | | | | | | | | | | This option make it easy to ignore anything about the server we're connecting to, which is bad security practice. This was necessary as we didn't use to expose detailed information about the certificate, but now that we do, we should get rid of this. If the user wants to ignore everything, they can still provide a callback which ignores all the information passed.
* | winhttp: set ignore security flags on user commandCarlos Martín Nieto2014-09-161-6/+42
| | | | | | | | If the user returns 0 from the certificate check and we had certificate issues, set the options to ignore certificate errors and resend the request.
* | winhttp: bring together request sendingCarlos Martín Nieto2014-09-161-32/+44
| | | | | | | | We need to call WinHttpSendRequest() in three different places. Unify all in a single function to have a single place for the certificate check.
* | winhttp: only do certificate check for SSLCarlos Martín Nieto2014-09-161-1/+1
| | | | | | | | If we're not using SSL, don't call the user's certificate check callback.
* | winhttp: credential check on successful connectCarlos Martín Nieto2014-09-161-0/+41
| | | | | | | | On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
* | Bring certificate check back to the normal return codeCarlos Martín Nieto2014-09-162-20/+17
| | | | | | | | | | Returning 0 lets the certificate check succeed. An error code is bubbled up to the user.
* | ssh: do ssh cert info before asking for credentialsCarlos Martín Nieto2014-09-161-47/+44
| | | | | | | | | | We know the host's key as soon as we connect, so we should perform the check as soon as we can, before we bother with the user's credentials.
* | transport: always call the certificate check callbackCarlos Martín Nieto2014-09-162-10/+12
| | | | | | | | | | | | | | We should let the user decide whether to cancel the connection or not regardless of whether our checks have decided that the certificate is fine. We provide our own assessment to the callback to let the user fall back to our checks if they so desire.
* | http: send the DER-encoded cert to the callbackCarlos Martín Nieto2014-09-162-22/+48
| | | | | | | | | | | | Instead of the parsed data, we can ask OpenSSL to give us the DER-encoded version of the certificate, which the user can then parse and validate.
* | Provide a callback for certificate validationCarlos Martín Nieto2014-09-164-3/+62
|/ | | | | | | | | If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
* Merge pull request #2538 from libgit2/ntk/propagate_url_parsing_errorVicent Marti2014-08-271-3/+3
|\ | | | | winhttp: Prevent swallowing of url parsing error
| * winhttp: Prevent swallowing of url parsing errornulltoken2014-08-271-3/+3
| |
* | Merge pull request #2502 from rnowosielski/remote_set_timeoutVicent Marti2014-08-271-1/+17
|\ \ | |/ |/| Set timeout on remote (Add timeout for WinHttpReceiveResponse #2147)
| * Set timeout on remote (WinHTTP) should return error in case of failure. ↵Rafal Nowosielski2014-08-271-7/+15
| | | | | | | | Connection timeout set to 1 minute. Read/Write timeout remains set to infinite #2147
| * Set timeout on remote (WinHTTP) to infinite #2147Rafal Nowosielski2014-08-231-0/+8
| |
* | Merge remote-tracking branch 'upstream/master' into cmn/ssh-retryCarlos Martín Nieto2014-08-2710-86/+687
|\ \ | |/
| * http: make sure we can consume the data we requestcmn/http-recv-bufferCarlos Martín Nieto2014-08-161-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recv buffer (parse_buffer) and the buffer have independent sizes and offsets. We try to fill in parse_buffer as much as possible before passing it to the http parser. This is fine most of the time, but fails us when the buffer is almost full. In those situations, parse_buffer can have more data than we would be able to put into the buffer (which may be getting full if we're towards the end of a data sideband packet). To work around this, we check if the space we have left on our buffer is smaller than what could come from the network. If this happens, we make parse_buffer think that it has as much space left as our buffer, so it won't try to retrieve more data than we can deal with. As the start of the data may no longer be at the start of the buffer, we need to keep track of where it really starts (data_offset) and use that in our calculations for the real size of the data we received from the network. This fixes #2518.
| * Introduce proper http authentication APIEdward Thomson2014-08-155-282/+528
| |
| * Add GSSAPI support for SPNEGO/Kerberos auth over HTTPEdward Thomson2014-08-151-30/+287
| |
| * Introduce git_buf_decode_base64Edward Thomson2014-08-152-2/+2
| | | | | | | | Decode base64-encoded text into a git_buf
| * Perform HTTP keep-aliveEdward Thomson2014-08-151-3/+12
| |
| * Custom transport: minor cleanupsEdward Thomson2014-08-142-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * Move the transport registration mechanisms into a new header under 'sys/' because this is advanced stuff. * Remove the 'priority' argument from the registration as it adds unnecessary complexity. (Since transports cannot decline to operate, only the highest priority transport is ever executed.) Users who require per-priority transports can implement that in their custom transport themselves. * Simplify registration further by taking a scheme (eg "http") instead of a prefix (eg "http://").
| * Consistently use p_snprintfJacques Germishuys2014-08-051-2/+2
| |
| * Define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH if not definedJacques Germishuys2014-08-051-0/+4
| |
| * Silence unused variables warningsJacques Germishuys2014-08-051-0/+1
| |
| * ssh: provide a factory function for setting ssh pathscmn/ssh-factory-for-pathsCarlos Martín Nieto2014-07-071-2/+52
| | | | | | | | | | | | | | | | | | git allows you to set which paths to use for the git server programs when connecting over ssh; and we want to provide something similar. We do this by providing a factory function which can be set as the remote's transport callback which will set the given paths upon creation.
| * Include libssh2.h before git2.h (transport.h)Jacques Germishuys2014-07-031-2/+4
| |
| * Merge pull request #2456 from libgit2/cmn/ssh-send-everythingVicent Marti2014-07-021-1/+12
| |\ | | | | | | ssh: libssh2_channel_write() behaves like send()
| | * ssh: libssh2_channel_write() behaves like send()cmn/ssh-send-everythingCarlos Martín Nieto2014-07-021-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the stream writing function was written, it assume that libssh2_channel_write() would always write all of the data to the wire. This is only true for the first 32k of data, which it tries to fit into one ssh packet. Since it can perform short writes, call it in a loop like we do for send(), advancing the buffer offset.
| * | Fix assert when receiving uncommon sideband packetPhilip Kelley2014-06-271-1/+3
| |/