summaryrefslogtreecommitdiff
path: root/lib/vssh/libssh.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-30/+30
| | | | | | | | | | | | | | | | - 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
* conn: add 'attach' to protocol handler, make libssh2 use itDaniel Stenberg2021-05-171-0/+2
| | | | | | | | | | | 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
* tidy-up: make conditional checks more consistentDaniel Stenberg2021-04-221-21/+21
| | | | | | ... remove '== NULL' and '!= 0' Closes #6912
* libssh: fix "empty expression statement has no effect" warningsDaniel Stenberg2021-04-191-39/+63
| | | | | | | | | | ... by fixing macros to do-while constructs and moving out the calls to "break" outside of the actual macro. It also fixes the problem where the macro was used witin a loop and the break didn't do right. Reported-by: Emil Engler Fixes #6847 Closes #6909
* libssh: get rid of PATH_MAXEmil Engler2021-04-051-4/+3
| | | | | | | | This removes the last occurrence of PATH_MAX inside our libssh implementation by calculating the path length from the string length of the two components. Closes #6829
* 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
* curl_path: remove conn->data useDaniel Stenberg2021-01-191-4/+2
| | | | Closes #6487
* lib: more conn->data cleanupsDaniel Stenberg2021-01-191-142/+143
| | | | Closes #6479
* libssh: avoid plain free() of libssh-memoryDaniel Stenberg2021-01-181-2/+2
| | | | | | | | | | | | | | | Since curl's own memory debugging system redefines free() calls to track and fiddle with memory, it cannot be used on memory allocated by 3rd party libraries. Third party libraries SHOULD NOT require free() to release allocated resources for this reason - and libs can use separate healp allocators on some systems (like Windows) so free() doesn't necessarily work anyway. Filed as an issue with libssh: https://bugs.libssh.org/T268 Closes #6481
* lib: pass in 'struct Curl_easy *' to most functionsDaniel Stenberg2021-01-171-97/+105
| | | | | | | | | | | | | | | | | | | | | ... 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
* 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
* urldata: remove 'void *protop' and create the union 'p'Daniel Stenberg2020-11-231-5/+5
| | | | | | | ... 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-14/+7
| | | | | | Saves us from having the same check done everywhere. Closes #6159
* 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
* sftp: add new quote commands 'atime' and 'mtime'COFFEETALES2020-08-241-2/+32
| | | | Closes #5810
* libssh: avoid options override by configuration filesAnderson Toshiyuki Sasaki2020-04-251-14/+47
| | | | | | | | | | | | | | | Previously, options set explicitly through command line options could be overridden by the configuration files parsed automatically when ssh_connect() was called. By calling ssh_options_parse_config() explicitly, the configuration files are parsed before setting the options, avoiding the options override. Once the configuration files are parsed, the automatic configuration parsing is not executed. Fixes #4972 Closes #5283 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
* libssh: Use new ECDSA key types to check known hostsAnderson Toshiyuki Sasaki2020-04-171-0/+8
| | | | | | | | | From libssh 0.9.0, ssh_key_type() returns different key types for ECDSA keys depending on the curve. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Fixes #5252 Closes #5253
* libssh: Fix matching user-specified MD5 hex keyJay Satiro2020-03-071-3/+17
| | | | | | | | | | | Prior to this change a match would never be successful because it was mistakenly coded to compare binary data from libssh to a user-specified hex string (ie CURLOPT_SSH_HOST_PUBLIC_KEY_MD5). Reported-by: fds242@users.noreply.github.com Fixes https://github.com/curl/curl/issues/4971 Closes https://github.com/curl/curl/pull/4974
* libssh: improve known hosts handlingAnderson Toshiyuki Sasaki2020-02-271-6/+92
| | | | | | | | | | | | | | | | Previously, it was not possible to get a known hosts file entry due to the lack of an API. ssh_session_get_known_hosts_entry(), introduced in libssh-0.9.0, allows libcurl to obtain such information and behave the same as when compiled with libssh2. This also tries to avoid the usage of deprecated functions when the replacements are available. The behaviour will not change if versions older than libssh-0.8.0 are used. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Fixes #4953 Closes #4962
* cleanup: comment typosDaniel Stenberg2020-02-211-2/+1
| | | | | | Spotted by 'codespell' Closes #4957
* lib: remove ASSIGNWITHINCONDITION exceptions, use our code styleDaniel Stenberg2019-12-171-3/+7
| | | | | | | | | | ... even for macros Reviewed-by: Daniel Gustafsson Reviewed-by: Jay Satiro Reported-by: Jay Satiro Fixes #4683 Closes #4722
* Revert "checksrc: fix regexp for ASSIGNWITHINCONDITION"Daniel Stenberg2019-12-161-0/+1
| | | | | | This reverts commit ba82673dac3e8d00a76aa5e3779a0cb80e7442af. Bug: #4683
* build: Disable Visual Studio warning "conditional expression is constant"Jay Satiro2019-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Disable warning C4127 "conditional expression is constant" globally in curl_setup.h for when building with Microsoft's compiler. This mainly affects building with the Visual Studio project files found in the projects dir. Prior to this change the cmake and winbuild build systems already disabled 4127 globally for when building with Microsoft's compiler. Also, 4127 was already disabled for all build systems in the limited circumstance of the WHILE_FALSE macro which disabled the warning specifically for while(0). This commit removes the WHILE_FALSE macro and all other cruft in favor of disabling globally in curl_setup. Background: We have various macros that cause 0 or 1 to be evaluated, which would cause warning C4127 in Visual Studio. For example this causes it: #define Curl_resolver_asynch() 1 Full behavior is not clearly defined and inconsistent across versions. However it is documented that since VS 2015 Update 3 Microsoft has addressed this somewhat but not entirely, not warning on while(true) for example. Prior to this change some C4127 warnings occurred when I built with Visual Studio using the generated projects in the projects dir. Closes https://github.com/curl/curl/pull/4658
* curl_setup_once: consistently use WHILE_FALSE in macrosDaniel Gustafsson2019-11-281-1/+1
| | | | | | | | | The WHILE_FALSE construction is used to avoid compiler warnings in macro constructions. This fixes a few instances where it was not used in order to keep the code consistent. Closes #4649 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* checksrc: fix regexp for ASSIGNWITHINCONDITIONDaniel Gustafsson2019-11-281-1/+0
| | | | | | | | | | | | | | | | | | | | | The regexp looking for assignments within conditions was too greedy and matched a too long string in the case of multiple conditionals on the same line. This is basically only a problem in single line macros, and the code which exemplified this was essentially: do { if((x) != NULL) { x = NULL; } } while(0) ..where the final parenthesis of while(0) matched the regexp, and the legal assignment in the block triggered the warning. Fix by making the regexp less greedy by matching for the tell-tale signs of the if statement ending. Also remove the one occurrence where the warning was disabled due to a construction like the above, where the warning didn't apply when fixed. Closes #4647 Reviewed-by: Daniel Stenberg <daniel@haxx.se>
* libssh: part of conditional expression is always true: !resultDaniel Stenberg2019-09-231-1/+1
| | | | | PVS-Studio warning Fixed #4402
* libssh: part of conditional expression is always trueDaniel Stenberg2019-09-231-1/+1
| | | | | PVS-Studio warning Fixes #4402
* libssh: The expression is excessive or contains a misprintDaniel Stenberg2019-09-231-1/+1
| | | | | PVS-Studio warning Fixes #4402
* ssh: add a generic Curl_ssh_version function for SSH backendsDaniel Stenberg2019-08-171-0/+5
| | | | Closes #4235
* vssh: move ssh init/cleanup functions into backend codeDaniel Stenberg2019-08-171-0/+13
|
* vssh: create directory for SSH backend codeDaniel Stenberg2019-08-171-0/+2729