aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh.c
AgeCommit message (Collapse)Author
2008-12-17- SCP and SFTP with the multi interface had the same flaw: the 'DONE'Daniel Stenberg
operation didn't complete properly if the EAGAIN equivalent was returned but libcurl would simply continue with a half-completed close operation performed. This ruined persistent connection re-use and cause some SSH-protocol errors in general. The correction is unfortunately adding a blocking function - doing it entirely non-blocking should be considered for a better fix.
2008-12-15- libssh2_sftp_last_error() was wrongly used at some places in libcurl whichDaniel Stenberg
made libcurl sometimes not properly abort problematic SFTP transfers.
2008-11-29Adjust some libssh2 preprocessor symbol definition checksYang Tse
2008-11-24- Based on a patch by Vlad Grachov, libcurl now uses a new libssh2 0.19Daniel Stenberg
function when built to support SCP and SFTP that helps the library to know in which direction a particular libssh2 operation would return EAGAIN so that libcurl knows what socket conditions to wait for before trying the function call again. Previously (and still when using libssh2 0.18 or earlier), libcurl will busy-loop in this situation when the easy interface is used!
2008-10-23Created Curl_raw_nequal() which does a C-locale string case comparison.Dan Fandrich
Changed checkprefix() to use it and those instances of strnequal() that compare host names or other protocol strings that are defined to be independent of case in the C locale. This should fix a few more Turkish locale problems.
2008-10-22Changed some arrays of char* to arrays of char[] to reduce data size andDan Fandrich
run-time relocations.
2008-10-21Fixed some problems with SFTP range support to fix test cases 634 through 637.Dan Fandrich
2008-09-29- Ian Lynagh provided a patch that now makes CURLOPT_RANGE work fine for SFTPDaniel Stenberg
downloads!
2008-09-24ntoa() and inet_ntoa_r() no longer usedYang Tse
2008-09-10fix compiler warningYang Tse
2008-09-06remove unnecessary typecasting of malloc()Yang Tse
2008-09-06remove unnecessary typecasting of calloc()Yang Tse
2008-09-02Removed some redundant type castsDan Fandrich
2008-08-16Library internal only C preprocessor macros FORMAT_OFF_T and FORMAT_OFF_TUYang Tse
remain in use as internal curl_off_t print formatting strings for the internal *printf functions which still cannot handle print formatting string directives such as "I64d", "I64u", and others available on MSVC, MinGW, Intel's ICC, and other DOS/Windows compilers. This reverts previous commit part which did: FORMAT_OFF_T -> CURL_FORMAT_CURL_OFF_T FORMAT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU
2008-08-15For congruency sake with the naming of other CURL_XXXXXX_CURL_OFF_T macros,Yang Tse
the names of the curl_off_t formatting string directives now become CURL_FORMAT_CURL_OFF_T and CURL_FORMAT_CURL_OFF_TU. CURL_FMT_OFF_T -> CURL_FORMAT_CURL_OFF_T CURL_FMT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU Remove the use of an internal name for the curl_off_t formatting string directives and use the common one available from the inside and outside of the library. FORMAT_OFF_T -> CURL_FORMAT_CURL_OFF_T FORMAT_OFF_TU -> CURL_FORMAT_CURL_OFF_TU
2008-08-12Removed unneeded header filesDan Fandrich
2008-08-01Added support for --append on SFTP uploads. Unfortunately, OpenSSH doesn'tDan Fandrich
support this so it goes untested.
2008-07-11Changed slightly the SFTP quote commands chmod, chown and chgrp to onlyDan Fandrich
set the attribute that has changed instead of all possible ones. Hopefully, this will solve the "Permission denied" problem that Nagarajan Sreenivasan reported when setting some modes, but regardless, it saves a protocol round trip in the chmod case.
2008-07-03Introcuding a new timestamp for curl_easy_getinfo():Daniel Stenberg
CURLINFO_APPCONNECT_TIME. This is set with the "application layer" handshake/connection is completed (typically SSL, TLS or SSH). By using this you can figure out the application layer's own connect time. You can extract the time stamp using curl's -w option and the new variable named 'time_appconnect'. This feature was sponsored by Lenny Rachitsky at NeuStar.
2008-05-31Fix problem: 'result' may be used uninitialized.Yang Tse
Issue detected by Guenter Knauf's NetWare autobuild.
2008-05-28- Jeff Weber reported memory leaks with aborted SCP and SFTP transfers andDaniel Stenberg
provided excellent repeat recipes. I fixed the cases I managed to reproduce but Jeff still got some (SCP) problems even after these fixes: http://curl.haxx.se/mail/lib-2008-05/0342.html
2008-05-21Removed some duplicated #includesDan Fandrich
2008-05-09- Make Curl_write and it's callees accept a const pointer, in preparationMichal Marek
of tetetest's patch for curl_easy_send()
2008-04-03Scott Barrett added support for CURLOPT_NOBODY over SFTPDaniel Stenberg
2008-03-18Fixed an infinite loop when given an invalid SFTP quote command.Dan Fandrich
2008-03-13- Brian Ulm figured out that if you did an SFTP upload withDaniel Stenberg
CURLOPT_FTP_CREATE_MISSING_DIRS to create a directory, and then re-used the handle and uploaded another file to another directory that needed to be created, the second upload would fail. Another case of a state variable that wasn't properly reset between requests.
2008-03-09- Brian Ulm reported a crash when doing a second SFTP transfer on a re-usedDaniel Stenberg
easy handle if curl_easy_reset() was used between them. I fixed it and Brian verified that it cured his problem. - Brian Ulm reported that if you first tried to download a non-existing SFTP file and then fetched an existing one and re-used the handle, libcurl would still report the second one as non-existing as well! I fixed it abd Brian verified that it cured his problem.
2008-03-04Mike Protts brought a patch that makes resumed transfers work with SFTP.Daniel Stenberg
2008-02-19fix compiler warnings: 'statement is unreachable'Yang Tse
2008-02-19fix compiler warnings: 'enumerated type mixed with another type'Yang Tse
2008-02-18fix compiler warnings:Yang Tse
'enumerated type mixed with another type' and 'variable was set but never used'
2008-02-15log SSH public key authentication failure and reasonYang Tse
2008-01-22when unable to initialize sftp session, also log failure reasonYang Tse
2008-01-15Calls to Curl_failf() are not supposed to provide a trailing newline as theDaniel Stenberg
function itself adds that. Fixed on 50 or something strings!
2007-11-29include the libssh2 return code in the output for these failures to easeDaniel Stenberg
debugging
2007-11-24struct HandleData is now called struct SingleRequest, and is only for data thatDaniel Stenberg
is inited at the start of the DO action. I removed the Curl_transfer_keeper struct completely, and I had to move out a few struct members (that had to be set before DO or used after DONE) to the UrlState struct. The SingleRequest struct is accessed with SessionHandle->req. One of the biggest reasons for doing this was the bunch of duplicate struct members in HandleData and Curl_transfer_keeper since it was really messy to keep track of two variables with the same name and basically the same purpose!
2007-11-12Fixed a remaining problem with doing SFTP directory listings on a re-usedDaniel Stenberg
persistent connection. Mentioned by Immanuel Gregoire on the mailing list.
2007-11-12oops, fixed build when CURL_LIBSSH2_DEBUG is definedDaniel Stenberg
2007-11-08Fix compiler warning: may be used uninitializedYang Tse
2007-11-08Bug report #1823487 (http://curl.haxx.se/bug/view.cgi?id=1823487) pointedDaniel Stenberg
out that SFTP requests didn't use persistent connections. Neither did SCP ones. I gave the SSH code a good beating and now both SCP and SFTP should use persistent connections fine. I also did a bunch for indent changes as well as a bug fix for the "keyboard interactive" auth.
2007-11-07if () => if()Daniel Stenberg
while () => while() and some other minor re-indentings
2007-11-05Move connection-oriented variables from the SessionHandle struct to theDaniel Stenberg
connectdata struct. This will in theory enable us to do persistent connections with SCP+SFTP, but currently the state machine always (and wrongly) cleanup everything in the 'done' action instead of in 'disconnect'. Also did a bunch of indent fixes, if () => if() and a few other source cleanups like added comments etc.
2007-10-22Michal Marek forwarded the bug reportDaniel Stenberg
https://bugzilla.novell.com/show_bug.cgi?id=332917 about a HTTP redirect to FTP that caused memory havoc. His work together with my efforts created two fixes: #1 - FTP::file was moved to struct ftp_conn, because is has to be dealt with at connection cleanup, at which time the struct HandleData could be used by another connection. Also, the unused char *urlpath member is removed from struct FTP. #2 - provide a Curl_reset_reqproto() function that frees data->reqdata.proto.* on connection setup if needed (that is if the SessionHandle was used by a different connection).
2007-10-17We use this ZERO_NULL to avoid picky compiler warnings,Yang Tse
when assigning a NULL pointer to a function pointer var.
2007-10-12Added per-protocol callback static tables, replacing callback ptr storagePatrick Monnerat
in the connectdata structure by a single handler table ptr.
2007-10-03I renamed the CURLE_SSL_PEER_CERTIFICATE error code toDaniel Stenberg
CURLE_PEER_FAILED_VERIFICATION (standard CURL_NO_OLDIES style), and made this return code get used by the previous SSH MD5 fingerprint check in case it fails.
2007-10-03Based on a patch brought by Johnny Luong, libcurl now offersDaniel Stenberg
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 and the curl tool --hostpubmd5. They both make the SCP or SFTP connection verify the remote host's md5 checksum of the public key before doing a connect, to reduce the risk of a man-in-the-middle attack.
2007-09-29Immanuel Gregoire fixed a problem with persistent transfers over SFTP - theDaniel Stenberg
previous proto struct was kept.
2007-09-28rename variable to prevent shadow warningDaniel Stenberg
2007-09-18Immanuel pointed out that public key SSH auth failed if no public/privateDaniel Stenberg
key was specified and there was no HOME environment variable, and then it didn't continue to try the other auth methods. Now it will instead try to get the files id_dsa.pub and id_dsa from the current directory if none of the two conditions were met.