summaryrefslogtreecommitdiff
path: root/lib/ssh.c
Commit message (Collapse)AuthorAgeFilesLines
...
* escape: avoid using curl_easy_unescape() internallyDaniel Stenberg2016-10-311-6/+6
| | | | Since the internal Curl_urldecode() function has a better API.
* select: switch to macros in uppercaseDaniel Stenberg2016-10-181-1/+1
| | | | | | | | | | Curl_select_ready() was the former API that was replaced with Curl_select_check() a while back and the former arg setup was provided with a define (in order to leave existing code unmodified). Now we instead offer SOCKET_READABLE and SOCKET_WRITABLE for the most common shortcuts where only one socket is checked. They're also more visibly macros.
* http2: Remove incorrect commentsJay Satiro2016-08-251-5/+0
| | | | .. also remove same from scp
* multi: make Curl_expire() work with 0 ms timeoutsDaniel Stenberg2016-08-041-1/+1
| | | | | | | | | | Previously, passing a timeout of zero to Curl_expire() was a magic code for clearing all timeouts for the handle. That is now instead made with the new Curl_expire_clear() function and thus a 0 timeout is fine to set and will trigger a timeout ASAP. This will help removing short delays, in particular notable when doing HTTP/2.
* conn: don't free easy handle data in handler->disconnectDaniel Stenberg2016-06-291-4/+0
| | | | | Reported-by: Gou Lingfeng Bug: https://curl.haxx.se/mail/lib-2016-06/0139.html
* SFTP: set a generic error when no SFTP one exists...Daniel Stenberg2016-06-281-2/+7
| | | | | | | | ... as otherwise we could get a 0 which would count as no error and we'd wrongly continue and could end up segfaulting. Bug: https://curl.haxx.se/mail/lib-2016-06/0052.html Reported-by: 暖和的和暖
* typedefs: use the full structs in internal code...Daniel Stenberg2016-06-221-1/+1
| | | | ... and save the typedef'ed names for headers and external APIs.
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-7/+7
|
* ssh: fix version number check typoDaniel Stenberg2016-05-301-1/+1
|
* ssh: fix build for libssh2 before 1.2.6Daniel Stenberg2016-05-291-1/+9
| | | | | | | The statvfs functionality was added to libssh2 in that version, so we switch off that functionality when built with older libraries. Fixes #831
* lib: include curl_printf.h as one of the last headersDaniel Stenberg2016-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743
* code: style updatesDaniel Stenberg2016-04-031-1/+1
|
* multi: turn Curl_done into file local multi_doneDaniel Stenberg2016-03-301-3/+2
| | | | ... as it now is used by multi.c only.
* SSH: new CURLOPT_QUOTE command "statvfs"marquis-de-muesli2016-03-271-0/+57
| | | | | usage: "statvfs path" returns remote file system statistics
* SSH: support CURLINFO_FILETIMEmarquis-de-muesli2016-03-271-3/+34
|
* SCP: use libssh2_scp_recv2 to support > 2GB files on windowsDavid Byron2016-02-141-4/+15
| | | | | | | libssh2_scp_recv2 is introduced in libssh2 1.7.0 - to be released "any day now. Closes #451
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* ssh: make CURLOPT_SSH_PUBLIC_KEYFILE treat "" as NULLKamil Dudka2016-01-151-2/+5
| | | | | | | | | | | | The CURLOPT_SSH_PUBLIC_KEYFILE option has been documented to handle empty strings specially since curl-7_25_0-31-g05a443a but the behavior was unintentionally removed in curl-7_38_0-47-gfa7d04f. This commit restores the original behavior and clarifies it in the documentation that NULL and "" have both the same meaning when passed to CURLOPT_SSH_PUBLIC_KEYFILE. Bug: http://curl.haxx.se/mail/lib-2016-01/0072.html
* Revert "cleanup: general removal of TODO (and similar) comments"Daniel Stenberg2015-11-241-3/+11
| | | | | | | This reverts commit 64e959ffe37c436503f9fed1ce2d6ee6ae50bd9a. Feedback-by: Dan Fandrich URL: http://curl.haxx.se/mail/lib-2015-11/0062.html
* cleanup: general removal of TODO (and similar) commentsDaniel Stenberg2015-11-131-11/+3
| | | | | | They tend to never get updated anyway so they're frequently inaccurate and we never go back to revisit them anyway. We document issues to work on properly in KNOWN_BUGS and TODO instead.
* fread_func: move callback pointer from set to state structDaniel Stenberg2015-10-151-2/+2
| | | | | | | | | | | | | | | | ... and assign it from the set.fread_func_set pointer in the Curl_init_CONNECT function. This A) avoids that we have code that assigns fields in the 'set' struct (which we always knew was bad) and more importantly B) it makes it impossibly to accidentally leave the wrong value for when the handle is re-used etc. Introducing a state-init functionality in multi.c, so that we can set a specific function to get called when we enter a state. The Curl_init_CONNECT is thus called when switching to the CONNECT state. Bug: https://github.com/bagder/curl/issues/346 Closes #346
* SFTP: fix range request off-by-one in size checkDaniel Stenberg2015-08-101-1/+1
| | | | | | Reported-by: Tim Stack Closes #359
* SSH: three state machine fixupsDaniel Stenberg2015-08-021-4/+7
| | | | | | | | | | | The SSH state machine didn't clear the 'rc' variable appropriately in a two places which prevented it from looping the way it should. And it lacked an 'else' statement that made it possible to erroneously get stuck in the SSH_AUTH_AGENT state. Reported-by: Tim Stack Closes #357
* read_callback: move to SessionHandle from connectdataDaniel Stenberg2015-05-201-2/+2
| | | | | | | With many easy handles using the same connection for multiplexing, it is important we store and keep the transfer-oriented stuff in the SessionHandle so that callbacks and callback data work fine even when many easy handles share the same physical connection.
* checksrc: use space after commaDaniel Stenberg2015-03-171-1/+1
|
* free: instead of Curl_safefree()Daniel Stenberg2015-03-161-5/+5
| | | | | | | | | | | | Since we just started make use of free(NULL) in order to simplify code, this change takes it a step further and: - converts lots of Curl_safefree() calls to good old free() - makes Curl_safefree() not check the pointer before free() The (new) rule of thumb is: if you really want a function call that frees a pointer and then assigns it to NULL, then use Curl_safefree(). But we will prefer just using free() from now on.
* mprintf.h: remove #ifdef CURLDEBUGDaniel Stenberg2015-03-031-5/+2
| | | | | ... and as a consequence, introduce curl_printf.h with that re-define magic instead and make all libcurl code use that instead.
* SFTP: work-around servers that return zero size on STATDaniel Stenberg2014-12-161-1/+5
| | | | | Bug: http://curl.haxx.se/mail/lib-2014-12/0103.html Pathed-by: Marc Renault
* libssh2: detect features based on version, not configure checksDaniel Stenberg2014-11-091-7/+0
| | | | | ... so that non-configure builds get the correct functions too based on the libssh2 version used.
* SSH: use the port number as well for known_known checksNobuhiro Ban2014-11-091-0/+19
| | | | | | ... if the libssh2 version is new enough. Bug: http://curl.haxx.se/bug/view.cgi?id=1448
* ssh: Fixed build on platforms where R_OK is not definedGisle Vanem2014-11-051-0/+3
| | | | | Bug: http://curl.haxx.se/mail/lib-2014-11/0035.html Reported-by: Jan Ehrhardt
* code cleanup: we prefer 'CURLcode result'Daniel Stenberg2014-10-241-12/+11
| | | | | | | | | | | | | | ... for the local variable name in functions holding the return code. Using the same name universally makes code easier to read and follow. Also, unify code for checking for CURLcode errors with: if(result) or if(!result) instead of if(result == CURLE_OK), if(CURLE_OK == result) or if(result != CURLE_OK)
* ssh_statemach_act: split out assignment from checkDaniel Stenberg2014-10-061-1/+2
| | | | just a minor code style thing to make the code clearer
* ssh: comment "fallthrough" in switch statementDaniel Stenberg2014-10-031-0/+2
|
* ssh: improve key file searchJeremy Lin2014-10-031-27/+48
| | | | | | | | | | | | | For private keys, use the first match from: user-specified key file (if provided), ~/.ssh/id_rsa, ~/.ssh/id_dsa, ./id_rsa, ./id_dsa Note that the previous code only looked for id_dsa files. id_rsa is now generally preferred, as it supports larger key sizes. For public keys, use the user-specified key file, if provided. Otherwise, try to extract the public key from the private key file. This means that passing --pubkey is typically no longer required, and makes the key-handling behavior more like OpenSSH.
* Ensure progress.size_dl/progress.size_ul are always >= 0Brandon Casey2014-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | Historically the default "unknown" value for progress.size_dl and progress.size_ul has been zero, since these values are initialized implicitly by the calloc that allocates the curl handle that these variables are a part of. Users of curl that install progress callbacks may expect these values to always be >= 0. Currently it is possible for progress.size_dl and progress.size_ul to by set to a value of -1, if Curl_pgrsSetDownloadSize() or Curl_pgrsSetUploadSize() are passed a "size" of -1 (which a few places currently do, and a following patch will add more). So lets update Curl_pgrsSetDownloadSize() and Curl_pgrsSetUploadSize() so they make sure that these variables always contain a value that is >= 0. Updates test579 and test599. Signed-off-by: Brandon Casey <drafnel@gmail.com>
* bits.close: introduce connection close trackingDaniel Stenberg2014-05-221-2/+2
| | | | | | | Make all code use connclose() and connkeep() when changing the "close state" for a connection. These two macros take a string argument with an explanation, and debug builds of curl will include that in the debug output. Helps tracking connection re-use/close issues.
* INFILESIZE: fields in UserDefined must not be changed run-timeDaniel Stenberg2014-04-261-9/+9
| | | | | | set.infilesize in this case was modified in several places, which could lead to repeated requests using the same handle to get unintendent/wrong consequences based on what the previous request did!
* ssh: prevent a logic error that could result in an infinite loopDan Fandrich2014-03-151-1/+2
|
* ssh: removed a redundant close state transitionDan Fandrich2014-03-141-4/+2
|
* ssh: abort immediately on a header callback errorDan Fandrich2014-03-141-1/+9
|
* ssh: fix compiler warning converting ssize_t to intDaniel Stenberg2014-03-061-1/+1
|
* ssh: Fixed a style warningDan Fandrich2014-03-061-6/+5
| | | | Also, combined a couple of #ifdef sections
* ssh: Pass errors from libssh2_sftp_read up the stackDan Fandrich2014-03-061-0/+4
|
* SFTP: skip reading the dir when NOBODY=1Daniel Stenberg2014-02-191-2/+4
| | | | | | | When asking for an SFTP directory with NOBODY set, no directory contents should be retrieved. Bug: http://curl.haxx.se/mail/lib-2014-02/0155.html
* ssh: Fixed a NULL pointer dereference on OOM conditionDan Fandrich2014-02-061-0/+1
|
* SFTP: stat remote file also when CURLOPT_NOBODY is 1Fabian Frank2014-01-201-3/+10
| | | | | | | | | Make it possible to call curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &filesize) and related functions on remote sftp:// files, without downloading them. Reported-by: Yingwei Liu Bug: http://curl.haxx.se/mail/lib-2014-01/0139.html
* mprintf: Replaced internal usage of FORMAT_OFF_T and FORMAT_OFF_TUSteve Holme2013-12-311-7/+8
| | | | | | | | | Following commit 0aafd77fa4c6f2, replaced the internal usage of FORMAT_OFF_T and FORMAT_OFF_TU with the external versions that we expect API programmers to use. This negates the need for separate definitions which were subtly different under different platforms/compilers.
* vtls: renamed sslgen.[ch] to vtls.[ch]Daniel Stenberg2013-12-201-1/+1
|
* vtls: created subdir, moved sslgen.[ch] there, updated all include linesDaniel Stenberg2013-12-201-1/+1
|