summaryrefslogtreecommitdiff
path: root/lib/vssh/libssh2.c
Commit message (Collapse)AuthorAgeFilesLines
* strerror.h: remove the #include from files not using itDaniel Stenberg2021-09-091-1/+0
|
* infof: remove newline from format strings, always append itDaniel Stenberg2021-07-071-60/+60
| | | | | | | | | | | | | | | | - the data needs to be "line-based" anyway since it's also passed to the debug callback/application - it makes infof() work like failf() and consistency is good - there's an assert that triggers on newlines in the format string - Also removes a few instances of "..." - Removes the code that would append "..." to the end of the data *iff* it was truncated in infof() Closes #7357
* version: turn version number functions into returning voidDaniel Stenberg2021-06-301-2/+2
| | | | | | | ... as we never use the return codes from them. Reviewed-by: Daniel Gustafsson Closes #7319
* libssh2: limit time a disconnect can take to 1 secondDaniel Stenberg2021-06-171-0/+7
| | | | Closes #7271
* conn: add 'attach' to protocol handler, make libssh2 use itDaniel Stenberg2021-05-171-0/+20
| | | | | | | | | | | The libssh2 backend has SSH session associated with the connection but the callback context is the easy handle, so when a connection gets attached to a transfer, the protocol handler now allows for a custom function to get used to set things up correctly. Reported-by: Michael O'Farrell Fixes #6898 Closes #7078
* libssh2: ignore timeout during disconnectDaniel Stenberg2021-05-041-16/+15
| | | | | | | | | | | | ... to avoid memory leaks! libssh2 is tricky as we have to deal with the non-blockiness even in close and shutdown cases. In the cases when we shutdown after a timeout already expired, it is crucial that curl doen't let the timeout abort the shutdown process as that then leaks memory! Reported-by: Benjamin Riefenstahl Fixes #6990
* tidy-up: make conditional checks more consistentDaniel Stenberg2021-04-221-12/+12
| | | | | | ... remove '== NULL' and '!= 0' Closes #6912
* libssh2: fix Value stored to 'sshp' is never readDaniel Stenberg2021-04-151-3/+1
| | | | | | Pointed out by scan-build Closes #6900
* libssh2: kdb_callback: get the right struct pointerDaniel Stenberg2021-03-231-2/+2
| | | | | | | | | | | | After the recent conn/data refactor in this source file, this function was mistakenly still getting the old struct pointer which would lead to crash on servers with keyboard-interactive auth enabled. Follow-up to a304051620b92e12b (shipped in 7.75.0) Reported-by: Christian Schmitz Fixes #6691 Closes #6782
* libssh2:ssh_connect: clear session pointer after freeDaniel Stenberg2021-03-211-0/+1
| | | | | | | | | If libssh2_knownhost_init() returns NULL, like in an OOM situation, the ssh session was freed but the pointer wasn't cleared which made libcurl later call libssh2 to cleanup using the stale pointer. Fixes #6764 Closes #6766
* ftp: add 'list_only' to the transfer state structDaniel Stenberg2021-02-091-1/+1
| | | | | | | | | and rename it from 'ftp_list_only' since it is also used for SSH and POP3. The state is updated internally for 'type=D' FTP URLs. Added test case 1570 to verify. Closes #6578
* ftp: never set data->set.ftp_append outside setoptDaniel Stenberg2021-02-081-1/+1
| | | | | | | | | | Since the set value then risks getting used like that when the easy handle is reused by the application. Also: renamed the struct field from 'ftp_append' to 'remote_append' since it is also used for SSH protocols. Closes #6579
* libssh2: fix CURL_LIBSSH2_DEBUG-enabled buildDaniel Stenberg2021-01-271-1/+1
| | | | | | | Follow-up to 2dcc940959772a Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/2dcc940959772a652f6813fb6bd3092095a4877b#commitcomment-46420088
* libssh2: move data from connection object to transfer objectDaniel Stenberg2021-01-251-129/+137
| | | | | | | | Readdir data, filenames and attributes are strictly related to the transfer and not the connection. This also reduces the total size of the fixed connectdata struct. Closes #6519
* curl_path: remove conn->data useDaniel Stenberg2021-01-191-2/+2
| | | | Closes #6487
* lib: more conn->data cleanupsDaniel Stenberg2021-01-191-181/+183
| | | | Closes #6479
* lib: pass in 'struct Curl_easy *' to most functionsDaniel Stenberg2021-01-171-110/+106
| | | | | | | | | | | | | | | | | | | | | ... in most cases instead of 'struct connectdata *' but in some cases in addition to. - We mostly operate on transfers and not connections. - We need the transfer handle to log, store data and more. Everything in libcurl is driven by a transfer (the CURL * in the public API). - This work clarifies and separates the transfers from the connections better. - We should avoid "conn->data". Since individual connections can be used by many transfers when multiplexing, making sure that conn->data points to the current and correct transfer at all times is difficult and has been notoriously error-prone over the years. The goal is to ultimately remove the conn->data pointer for this reason. Closes #6425
* libssh2: fix "Value stored to 'readdir_len' is never read"Daniel Stenberg2021-01-111-1/+0
| | | | Detected by scan-build
* language: s/behaviour/behavior/gEmil Engler2021-01-021-2/+2
| | | | | | | | We currently use both spellings the british "behaviour" and the american "behavior". However "behavior" is more used in the project so I think it's worth dropping the british name. Closes #6395
* failf: remove newline from formatting stringsDaniel Stenberg2020-12-251-2/+2
| | | | | | | | | ... as failf adds one itself. Also: add an assert() to failf() that triggers on a newline in the format string! Closes #6365
* infof/failf calls: fix format specifiersRikard Falkeborn2020-11-241-2/+2
| | | | | | Update a few format specifiers to match what is being printed. Closes #6241
* urldata: remove 'void *protop' and create the union 'p'Daniel Stenberg2020-11-231-4/+4
| | | | | | | ... to avoid the use of 'void *' for the protocol specific structs done per transfer. Closes #6238
* curl.se: new homeDaniel Stenberg2020-11-041-1/+1
| | | | Closes #6172
* sendf: move the verbose-check into Curl_debugDaniel Stenberg2020-11-021-19/+11
| | | | | | Saves us from having the same check done everywhere. Closes #6159
* libssh2: fix transport over HTTPS proxyDaniel Stenberg2020-10-291-1/+18
| | | | | | | | The fix in #6021 was not enough. This fix makes sure SCP/SFTP content can also be transfered over a HTTPS proxy. Fixes #6113 Closes #6128
* libssh2: fix build with disabled proxy supportBaruch Siach2020-10-261-1/+6
| | | | | | | | | | Build breaks because the http_proxy field is missing: vssh/libssh2.c:3119:10: error: 'struct connectdata' has no member named 'http_proxy' Regression from #6021, shipped in curl 7.73.0 Closes #6125
* libssh2: require version 1.0 or laterDaniel Stenberg2020-10-221-22/+0
| | | | | | | ... and simplify the code accordingly. libssh2 version 1.0 was released in April 2009. Closes #6116
* libssh2: handle the SSH protocols done over HTTPS proxyDaniel Stenberg2020-09-291-8/+83
| | | | | | Reported-by: Robin Douine Fixes #4295 Closes #6021
* Curl_handler: add 'family' to each protocolDaniel Stenberg2020-09-211-0/+2
| | | | | | | Makes get_protocol_family() faster and it moves the knowledge about the "families" to each protocol handler, where it belongs. Closes #5986
* libssh2: pass on the error from ssh_force_knownhost_key_typecbe2020-09-031-0/+1
| | | | Closes #5909
* sftp: add the option CURLKHSTAT_FINE_REPLACEMichael Musset2020-08-241-2/+9
| | | | | | Replace the old fingerprint of the host with a new. Closes #5685
* sftp: add new quote commands 'atime' and 'mtime'COFFEETALES2020-08-241-1/+31
| | | | Closes #5810
* libssh2: s/ssherr/sftperr/Daniel Stenberg2020-08-101-1/+1
| | | | | | | | | | | The debug output used ssherr instead of sftperr which not only outputs the wrong error code but also casues a warning on Windows. Follow-up to 7370b4e39f1 Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/7370b4e39f1390e701f5b68d910c619151daf72b#r41334700 Closes #5799
* libssh2: keep sftp errors as 'unsigned long'Daniel Stenberg2020-06-081-62/+66
| | | | | | | Remove weird work-around for storing the SFTP errors as int instead of the "unsigned long" that libssh2 actually returns for SFTP errors. Closes #5534
* timeouts: change millisecond timeouts to timediff_t from time_tDaniel Stenberg2020-05-301-1/+1
| | | | | | | For millisecond timers we like timediff_t better. Also, time_t can be unsigned so returning a negative value doesn't work then. Closes #5479
* libssh2: improved error output for wrong quote syntaxDaniel Stenberg2020-05-291-4/+4
| | | | | | Reported-by: Werner Stolz Closes #5474
* Revert "ssh: ignore timeouts during disconnect"Estanislau Augé-Pujadas2020-05-271-15/+12
| | | | | | | | This reverts commit f31760e63b4e9ef1eb25f8f211390f8239388515. Shipped in curl 7.54.1. Bug: https://curl.haxx.se/mail/lib-2020-05/0068.html Closes #5465
* cleanup: use a single space after equals sign in assignmentsDaniel Stenberg2020-05-261-1/+1
|
* libssh2: convert over to use dynbufDaniel Stenberg2020-05-051-76/+52
| | | | | | | | In my very basic test that lists sftp://127.0.0.1/tmp/, this patched code makes 161 allocations compared to 194 in git master. A 17% reduction. Closes #5336
* libssh2: set the expected total size in SCP upload initDaniel Stenberg2020-05-021-1/+3
| | | | | | | | | ... as otherwise the progress callback gets called without that information, making the progress meter have less info. Reported-by: Murugan Balraj Bug: https://curl.haxx.se/mail/archive-2020-05/0000.html Closes #5317
* sftp: fix segfault regression introduced by #4747Jim Fuller2020-03-091-16/+25
| | | | | | | | This fix adds a defensive check for the case where the char *name in struct libssh2_knownhost is NULL Fixes #5041 Closes #5062
* cleanup: comment typosDaniel Stenberg2020-02-211-1/+0
| | | | | | Spotted by 'codespell' Closes #4957
* libssh2: fix variable typeMarcel Raad2020-01-161-1/+1
| | | | | | | This led to a conversion warning on 64-bit MinGW, which has 32-bit `long` but 64-bit `size_t`. Closes https://github.com/curl/curl/pull/4823
* misc: Copyright year out of date, should be 2020Daniel Stenberg2020-01-121-1/+1
| | | | | | Follow-up to recent commits [skip ci]
* libssh2: add support for forcing a hostkey typeSantino Keupp2020-01-111-0/+130
| | | | | | | | | | | | - Allow forcing the host's key type found in the known_hosts file. Currently, curl (with libssh2) does not take keys from your known_hosts file into account when talking to a server. With this patch the known_hosts file will be searched for an entry matching the hostname and, if found, libssh2 will be told to claim this key type from the server. Closes https://github.com/curl/curl/pull/4747
* libssh2: add support for ECDSA and ed25519 knownhost keysSantino Keupp2019-12-151-47/+81
| | | | | | | | ... if a new enough libssh2 version is present. Source: https://curl.haxx.se/mail/archive-2019-12/0023.html Co-Authored-by: Daniel Stenberg Closes #4714
* lib: silence conversion warningsMarcel Raad2019-10-011-1/+1
| | | | Closes https://github.com/curl/curl/pull/4444
* libssh2: part of conditional expression is always true: !resultDaniel Stenberg2019-09-201-1/+1
| | | | | Fixes warning detected by PVS-Studio Fixes #4374
* ssh: add a generic Curl_ssh_version function for SSH backendsDaniel Stenberg2019-08-171-0/+4
| | | | Closes #4235
* vssh: move ssh init/cleanup functions into backend codeDaniel Stenberg2019-08-171-0/+19
|