summaryrefslogtreecommitdiff
path: root/src/transports
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* 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
| |/
| * http: fix typo in credentials logicCarlos Martín Nieto2014-06-131-1/+1
| | | | | | | | | | We want to check whether the credentials callback is NULL, not whether the payload is.
* | ssh: make sure to ask for a username and use the same oneCarlos Martín Nieto2014-06-262-34/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to know which authentication methods are supported/allowed by the ssh server, we need to send a NONE auth request, which needs a username associated with it. Most ssh server implementations do not allow switching the username between authentication attempts, which means we cannot use a dummy username and then switch. There are two ways around this. The first is to use a different connection, which an earlier commit implements, but this increases how long it takes to get set up, and without knowing the right username, we cannot guarantee that the list we get in response is the right one. The second is what's implemented here: if there is no username specified in the url, ask for it first. We can then ask for the list of auth methods and use the user's credentials in the same connection.
* | cred: add convenience function to get the usernameCarlos Martín Nieto2014-06-262-0/+49
| | | | | | | | | | Since each cred defines the username on their own, introduce git_cred__username to retrieve the username pointer from them.
* | cred: introduce username-only credCarlos Martín Nieto2014-06-261-0/+23
| | | | | | | | | | This exists as ssh needs to know about the username to use before it can query for the supported authentication methods.
* | ssh: request credentials again on authentication failureCarlos Martín Nieto2014-06-261-26/+60
| | | | | | | | | | Instead of completely giving up on the first failure, ask for credentials as long as we fail to authenticate.
* | ssh: propagate the error code from the auth callbackCarlos Martín Nieto2014-06-171-13/+12
| | | | | | | | We need to be able to get a GIT_EUSER back through the outermost call.
* | ssh: detect authentication methodsCarlos Martín Nieto2014-06-171-6/+77
|/ | | | | | | | Before calling the credentials callback, ask the sever which authentication methods it supports and report that to the user, instead of simply reporting everything that the transport supports. In case of an error, we do fall back to listing all of them.
* clone: re-use the local transport's path resolutioncmn/path-to-pathCarlos Martín Nieto2014-06-031-20/+2
| | | | | | Whe already worked out the kinks with the function used in the local transport. Expose it and make use of it in the local clone method instead of trying to work it out again.
* smart: initialize the error variableCarlos Martín Nieto2014-05-221-1/+1
|
* Plug leaks and fix a C99-ismCarlos Martín Nieto2014-05-222-12/+14
| | | | | | | We have too many places where we repeat free code, so when adding the new free to the generic code, it didn't take for the local transport. While there, fix a C99-ism that sneaked through.
* Merge pull request #2376 from libgit2/cmn/remote-symrefVicent Marti2014-05-225-11/+120
|\ | | | | Add support for the symref extension
| * local transport: expose the symref dataCarlos Martín Nieto2014-05-211-4/+18
| | | | | | | | | | When using the local transport, we always have the symbolic information available, so fill it.
| * remote: expose the remote's symref mappingsCarlos Martín Nieto2014-05-212-0/+20
| | | | | | | | | | Add a symref_target field to git_remote_head to expose the symref mappings to the user.
| * smart: store reported symrefsCarlos Martín Nieto2014-05-213-7/+82
| | | | | | | | | | | | | | | | | | | | | | | | The protocol has a capability which allows the server to tell us which refs are symrefs, so we can e.g. know which is the default branch. This capability is different from the ones we already support, as it's not setting a flag to true, but requires us to store a list of refspec-formatted mappings. This commit does not yet expose the information in the reference listing.
* | smart: send a flush when we disconnectcmn/fetch-terminateCarlos Martín Nieto2014-05-201-0/+12
|/ | | | | The git server wants to hear a flush from us when we disconnect, particularly when we want to perform a fetch but are up to date.
* Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-254-48/+51
|\ | | | | Fire progress and update tips callbacks also for pushes.
| * Correct argument order of git__calloc()Jacques Germishuys2014-04-211-1/+1
| |
| * Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-213-5/+5
| |
| * Rename progress callback to sideband_progressJacques Germishuys2014-04-211-2/+2
| |
| * Check the return codes of remote callbacks.Jacques Germishuys2014-04-211-5/+9
| | | | | | | | The user may have requested that the operation be cancelled.
| * Fire progress callbacks also for pushes.Jacques Germishuys2014-04-201-36/+35
| | | | | | | | | | It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why.
* | Merge pull request #2283 from phkelley/win32_fsVicent Marti2014-04-231-75/+50
|\ \ | | | | | | Win32: UTF-8 <-> WCHAR conversion overhaul
| * | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-191-75/+50
| |/
* | transports: allow the creds callback to say it doesn't existCarlos Martín Nieto2014-04-222-32/+55
|/ | | | | | | | Allow the credentials callback to return GIT_PASSTHROUGH to make the transports code behave as though none was set. This should make it easier for bindings to behave closer to the C code when there is no credentials callback set at their level.
* Only zero sensitive information on destruction (and memory actually ↵Jacques Germishuys2014-04-181-7/+21
| | | | allocated by us)
* Make git_cred_ssh_custom_new() naming more consistentJacques Germishuys2014-04-182-3/+3
|
* Introduce git_cred_ssh_interactive_new()Jacques Germishuys2014-04-182-0/+58
| | | | This allows for keyboard-interactive based SSH authentication
* cred: tighten username rulesCarlos Martín Nieto2014-04-182-50/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ssh-specific credentials allow the username to be missing. The idea being that the ssh transport will then use the username provided in the url, if it's available. There are two main issues with this. The credential callback already knows what username was provided by the url and needs to figure out whether it wants to ask the user for it or it can reuse it, so passing NULL as the username means the credential callback is suspicious. The username provided in the url is not in fact used by the transport. The only time it even considers it is for the user/pass credential, which asserts the existence of a username in its constructor. For the ssh-specific ones, it passes in the username stored in the credential, which is NULL. The libssh2 macro we use runs strlen() against this value (which is no different from what we would be doing ourselves), so we then crash. As the documentation doesn't suggest to leave out the username, assert the need for a username in the code, which removes this buggy behavior and removes implicit state. git_cred_has_username() becomes a blacklist of credential types that do not have a username. The only one at the moment is the 'default' one, which is meant to call up some Microsoft magic.