Commit Graph

523 Commits (55a763c360afabb1cbaab01dfa6febe9025f7344)

Author SHA1 Message Date
Jacob Barthelmeh 55a763c360 add missing testsuite.h file 2019-02-04 14:49:56 -07:00
Jacob Barthelmeh 9c73700f25 add SFTP tests to testsuite 2019-02-04 12:22:31 -07:00
John Safranek 055fbe6e4b 1. Updated SFTP_GetAttributes to take a heap pointer, just in case.
2. Put SFTP_RecvSTAT back into the build.
3. Use the common practice of setting the permissions on files from
windows to have all rx access, and add the write bit if file isn't read
only.
2019-01-30 14:29:34 -08:00
John Safranek 9b817d702c Update some more actions with Windows API calls instead of POSIX. 2019-01-29 17:11:10 -08:00
John Safranek 69455eafe7 When reading the data from the server during wolfSSH_SFTP_Get(), make
sure to get all the data from the server if the read_stream() doesn't
provide all that is present.
2019-01-29 16:06:07 -08:00
John Safranek 5512128aa5 1. Fix allocation for UNICODE strings. Need to be (count+1)*2 octets.
2. Added a local dynamic memory type in the ports for strings.
3. Removed the includes for winsock2.h. It is included by windows.h.
4. In the example client, switched fin and fout to macros to stdin and
stdout. While they are FILE in POSIX, in Windows they are a function.
2019-01-25 11:45:46 -08:00
Jacob Barthelmeh f2cb7a3356 scan-build fixes 2019-01-25 10:47:24 -07:00
John Safranek 4f8623b9b6 Add wrappers to the UNICODE Win32 functions to translate the strings
from ANSI C strings to wchar_t strings.
2019-01-24 17:34:35 -08:00
Jacob Barthelmeh b8ae2fab59 add non blocking testing and better support for non blocking edge cases 2019-01-24 15:48:34 -07:00
Jacob Barthelmeh 0cefa074fb remove guard on remove and rename 2019-01-24 11:28:16 -07:00
John Safranek 1891546c01 Back out a test case in Windows. Reconsolidated the checks into a single
check. (wrt WriteFile)
2019-01-24 10:20:23 -08:00
John Safranek a611c02211 Merge remote-tracking branch 'origin/nbsftp' into nbsftp 2019-01-23 18:27:56 -08:00
John Safranek ae6144f596 1. Add the default path parameter to the wolfsftp client.
2. Split the error check on the Windows file write into two checks.
3. Check the success of closing the local file in Windows.
4. Rearrange the Get state machine to attempt to close the remote file
first then the local file. The local file close is always attempted.
2019-01-23 18:22:56 -08:00
Jacob Barthelmeh 58186064de clean up closing directory with SFTP 2019-01-23 17:47:20 -07:00
Jacob Barthelmeh 756d5898f6 fix for listing directory with SFTP server on Windows 2019-01-23 16:58:10 -07:00
John Safranek 4bdfb5bfa3 Add MKDIR and RMDIR back into the Windows server. 2019-01-23 15:17:50 -08:00
John Safranek d9568efdcf Fix server side of Get(). 2019-01-23 13:51:42 -08:00
Jacob Barthelmeh 2c77a5c4bf fix for handle with Windows open dir 2019-01-23 14:08:18 -07:00
John Safranek eecae42f4a Fix invalid response when closing a file due to non-initialized result value. 2019-01-23 11:47:59 -08:00
Jacob Barthelmeh df6955866d add sftp test cases, fix build for C89, add flag print out to echoserver 2019-01-23 12:02:35 -07:00
John Safranek 6bac023986 1. Fix double free of "data" in the RecvWrite() function.
2. When writing to disk, add the idx to the data pointer.
2019-01-23 11:00:12 -08:00
Jacob Barthelmeh 02bf8632a8 lower platform toolset version for sftp client 2019-01-23 11:43:46 -07:00
Jacob Barthelmeh d54a42161e move sftp client example to examples directory 2019-01-23 11:23:32 -07:00
Jacob Barthelmeh fff773213a change wolffwd example name to portfwd 2019-01-23 11:23:21 -07:00
Jacob Barthelmeh 5b50b3c031 more support for want write on client side 2019-01-23 11:16:12 -07:00
Jacob Barthelmeh ee85cc552e add more support for want writes on server side 2019-01-23 10:37:21 -07:00
John Safranek 5386297429 Whitespace changes.
Change the file permissions when opening a file.
2019-01-22 16:24:18 -08:00
John Safranek e5b2e8478b Use fewer options when opening the file on Windows. 2019-01-22 14:04:48 -08:00
John Safranek d13607d889 1. Add a defaultSftpPath to the server, with an API function.
2. Add option to echoserver for the SFTP path.
3. Fix issues with the Get() and Put() state machines with respect to
file access. Windows builds to use Win32 API. Windows builds do not use
fseek().
4. RecvRealPath() to use the new default path option if available. It
does not call getcwd() for Windows builds.
2019-01-22 11:38:28 -08:00
John Safranek a457abd11d 1. Initialize the ret value in RecvSetSTAT().
2. Delete trailing commas in a couple enums.
3. Add extern "C" C++ guards around wolfsftp.h.
4. In port.c, comment out the pwrite and pread wrappers for Windows builds.
5. Remove the getcwd from RecvRealPath(), but needs a better fix.
6. Leave out several operations that need to be touched later. Emphasis is to get Get and Put running.
7. Open, Close, Read, Write, have a WINCE version using the Win32 API.
8. Remove the include of stdio.h from port.c for Windows builds.
9. Remove and Rename actions return an error for Windows builds.
2019-01-18 16:53:07 -08:00
Jacob Barthelmeh 73839469ed adjust stream_send behavior with WANT_WRITE 2019-01-18 10:19:18 -07:00
Jacob Barthelmeh 61a41b5b7b remove possible double free and fix non blocking echoserver 2019-01-17 17:22:41 -07:00
Jacob Barthelmeh 19a4ce6403 initial sftp server non blocking 2019-01-16 18:03:36 -07:00
John Safranek a8cf8b6b97 Fix a few more WinCE header issues. 2019-01-16 11:02:53 -08:00
Jacob Barthelmeh 0f77f67bdf check for scp + no server and have print outs for servers 2019-01-11 09:48:58 -07:00
John Safranek 39fce973f2 Cleaned up three compile type warnings. 2019-01-09 14:40:58 -08:00
John Safranek 7e9981c6ec Updated the main API, echoserver, client, and server for the NO_WOLFSSH_SERVER and NO_WOLFSSH_CLIENT options. 2019-01-09 14:25:50 -08:00
John Safranek 42675723e2 Fixed some issues with NO_WOLFSSH_SERVER builds. wolfSSH proper still
has the server code, but the wolfSFTP code excludes the server side.
2019-01-09 13:14:25 -08:00
John Safranek 8ec417b97b 1. Move some more includes in port.h to a block for WINCE where they aren't included.
2. Added "SINGLE_THREADED" to the vs user_settings.h.
2019-01-08 11:51:29 -08:00
Jacob Barthelmeh 6668ef2b80 advance file state on resume of put 2019-01-07 15:33:31 -07:00
John Safranek 9bba844e35 Put file should fail if the local file doesn't exist before trying to
open the remote file. Rearrange the Put state machine. Add an error code
for SFTP_FILE_DNE.
2019-01-07 14:12:12 -08:00
John Safranek 09bfe48615 Get and Put a file that doesn't exist, and their state machines didn't
transition to the cleanup state.
2019-01-07 14:05:00 -08:00
John Safranek 67ec3a0bad Bug fix in SFTP_Put where it would just fail with a non-blocking socket.
Caused by three issues:
1. an unsigned return code was checked for a negative error code
2. a state was skipped in the case of a would block situation
3. a possible blocking point wasn't getting checked for want-read or
write.
2019-01-07 13:21:20 -08:00
John Safranek 6d295bc396 add some logging of the states in SFTP_SendReadPacket() 2019-01-07 11:51:36 -08:00
John Safranek 9d589ea769 SFTP_SendReadPacket() can return a 0 in normal situations. SFTP_Get()
was treating it like an error and skipping the file close.
2019-01-07 11:50:15 -08:00
John Safranek c91dc02336 Do some line wrapping in the sftp source. 2019-01-07 11:34:25 -08:00
John Safranek 5fd1e5daf8 fix a memory leak with the data buffer for SFTP_STAT(). 2019-01-07 11:33:54 -08:00
John Safranek 3ebecebed4 Fixes with maxSz being word32. Should be int as a negative error code
may be returned.
2019-01-07 11:11:49 -08:00
John Safranek aba491f927 fix a missing return code in Rename 2019-01-07 10:55:33 -08:00
Jacob Barthelmeh efb3d30026 add rmdir SFTP non blocking 2019-01-07 11:40:33 -07:00