Commit Graph

100 Commits (f7f7b4743e2585ddee6009fa4d7b1bed3a3bd1a7)

Author SHA1 Message Date
Jacob Barthelmeh d27454d567 remove duplicate line 2019-04-03 17:09:07 -06:00
Jacob Barthelmeh 9df6e300f8 do not exit on want read with console parsing 2019-04-01 13:16:59 -06:00
Jacob Barthelmeh ff84dea8a0 add function to get extended data and example remote command execute
update client example remote command execute for Windows

add wolfSSH_stream_peek and console translation

improvements to console translation and add client side psuedo terminal

windows client -c fix, clang build, sanity check on side for exec

fix for warnings with VS 2010 build

cast return value of WSTRLEN

update termios guard and fix for scan-build check

advance extended data buffer index on read

fix for error.h after rebase
2019-03-29 09:25:27 -06:00
John Safranek 8a267e2bd2 Public Key Check Callback
The public key check callback hook is given a pointer to the public key, the size of the key, and the application-specific context data.
1. Added a callback function hook for checking the public key sent to the client by the server. It defaults to accepting the key.
2. Added accessors for the public key check callback function and context data.
3. Added a dummy callback to all the example tools.
2019-03-26 13:51:35 -07:00
John Safranek a2bfd7749c 1. Update the Windows build README.
2. Add a guard to the sftpclient.c so it builds without SFTP enabled.
2019-03-04 16:46:25 -08:00
John Safranek ea515ca1b2 Add configure option to disable building the example tools. 2019-02-27 13:25:55 -08:00
John Safranek 2350ffe00e Review Fixes
1. Add a wrapper to the key-gen code that checks for wolfCrypt's keygen flag and errors if keygen isn't available.
2. The main loops around wolfSSH_stream_read() for the example client and server needed to check the error register for WANT_READ or WANT_WRITE, not the return code.
2019-02-27 11:28:24 -08:00
Jacob Barthelmeh aa7330f7fc nonblocking chmod, add chmod sftp test 2019-02-07 17:51:52 -07:00
Jacob Barthelmeh a6a1297c93 check for socket disconnect error 2019-02-07 11:07:10 -07:00
John Safranek accd3c299d Add a function to assign-add a 32-bit value to a 64-bit value. The
64-bit value is an array 2 of 32-bit values. In SFTP, changed up all the
uses (most) of word64 to word32 arrays. Not all systems we support have
64-bit types available.
2019-02-06 14:31:31 -08:00
Jacob Barthelmeh a92bcdc074 add test cases for more SFTP commands 2019-02-06 13:45:18 -07:00
Jacob Barthelmeh 9c73700f25 add SFTP tests to testsuite 2019-02-04 12:22:31 -07: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
Jacob Barthelmeh b8ae2fab59 add non blocking testing and better support for non blocking edge cases 2019-01-24 15:48:34 -07: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 df6955866d add sftp test cases, fix build for C89, add flag print out to echoserver 2019-01-23 12:02:35 -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 ee85cc552e add more support for want writes on server side 2019-01-23 10:37:21 -07: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
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
Jacob Barthelmeh 0f77f67bdf check for scp + no server and have print outs for servers 2019-01-11 09:48:58 -07: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 2e92d9c1ee Add check if building echoserver to test.h so the static functions aren't included when building not-inline. 2018-12-14 13:58:47 -08:00
Jacob Barthelmeh fc92e85853 use int type for getting example args 2018-12-11 17:01:56 -07:00
John Safranek d2a1c2ab1b Non-blocking fix
1. Added a non-blocking socket option to the client.
2. Added a non-blocking socket option to the server.
3. Added support for select to the test header.
4. Updated the usage strings so they are formatted the same.
2018-11-21 11:38:33 -08:00
John Safranek b97b237695 Static Analysis Fixes
Ran the clang static analysis and infer and fixed most of the reported
items. There were many that infer found that looked like false
positives.
2018-11-15 13:28:42 -08:00
John Safranek bbf818c587 also added test-locking group. tweaked misc.c, misc.h so they played nice with NO_INLINE 2018-09-20 16:19:25 -07:00
John Safranek cf959db741 Grouping test header functions into test-client, test-server, or
test-threading blocks. Adding flags to the examples and testsuite to
enable various test functions.
2018-09-20 16:10:13 -07:00
John Safranek 8a13a829df scan-build fixes
1. Didn't initialize errFd before calling select() in wolffwd.
2. Wasn't checking the accepted appFd in wolffwd.
3. For the test_KDF() unit test, a call to ConvertHexToBin() could succeed and leave eKey NULL, and pass it to memcmp().
2018-09-13 17:19:39 -07:00
John Safranek dbd59aea4a TCP/IP Forwarding
1. Removed the "direction" flag from the wolffwd example. Only works in one direction at this point.
2. Added the GPL header to the wolffwd example source.
3. Removed the stray prints from the wolffwd example.
4. wolfFwd example fails out if any of the sockets report failure.
2018-09-12 15:30:18 -07:00
John Safranek cbeb2cf566 TCP/IP Forwarding
1. Fixed an issue with the FD_SET copy.
2. Fixed some memory issues discovered with Valgrind.
2018-09-04 15:17:14 -07:00
John Safranek dfbfe8d93f TCP/IP Forwarding
1. Removed an unused data type and unused functions.
2. Do a couple fixes for scan-build.
2018-08-31 14:26:56 -07:00
John Safranek a42075d823 TCP/IP Forwarding
1. Removed some unused macros in the configure.ac script.
2. Added option for enabling TCP/IP Forwarding.
3. Coalesced the option enable checks to one location in the configure script.
4. Removed redundant compile flags from the wolfSSH automake include.
5. Added a check of the BUILD_SCP option to leave out the wolfcsp file as needed.
6. Removed the redundant debug flags from the ax_harden macro since we add them at the configure level.
7. Modified the ax_harden macro to add the flags to AM_CFLAGS rather than CFLAGS.
8. Removed redundant AM_CFLAGS from the include.am that are adding them to their build's CFLAGS.
9. Replaced the have-wolfssl macro with AC_CHECK_LIB.
10. When adding per-target CPPFLAGS, add the AM_CPPFLAGS back in.
11. remove redundant call to wolfSSH_Init() from echoserver
12. Add runtime configuration of the session window size and max packet size.
13. Parse the TCP/IP direct connect flavor of the Channel Open message.
14. Save and release the host and origin addresses.
15. Added an example forwarding tool.
16. Move and rename the FIND_SELF and FIND_PEER constants.
17. Add planned functions ChannelSend, ChannelRead, ChannelExit, worker.
18. Add new function ChannelNext, which returns the next channel in the list.
19. Changed SendBuffered() from static to local so it could be used by the worker.
20. Separated creating a channel and sending an channel open request.
21. Added status code for pending open channel and for received data.
2018-08-31 11:21:42 -07:00
John Safranek f08628af2b Scan Build Fixes
1. In the echoserver, free the thread context before exiting app on error.
2. In the unit test, when checking the KDF, initialize the sizes to zero
and the pointers to NULL after freeing them.
2018-08-15 12:38:20 -07:00
John Safranek 8a010c168e
Merge pull request #81 from JacobBarthelmeh/testing
additional sftp and scp tests
2018-07-16 10:49:42 -07:00
Jacob Barthelmeh 73bcd5c95a external test script 2018-07-02 17:07:51 -06:00
Jacob Barthelmeh 2c4bca35e0 sftp test script added 2018-07-02 12:03:48 -06:00
Jacob Barthelmeh e47427c484 fix when reading directory
change from NO_WOLFSSL_DIR to NO_WOLFSSH_DIR

add chmod feature

changes for sftp port

file attributes and SFTP version

no exit on echoserver and revert scp
2018-06-29 09:19:40 -06:00
Jacob Barthelmeh 522d93add3 scp nucleus port
fix for uninitialised value

fix compile time warnings

scp only build and handle file size of 0

macro guard on sftp build

adjust directory pointer on desktop build

close connection still on fail and update derefrence of dir with nucleus

ssh only build for nucleus
2018-06-13 16:23:08 -06:00
Jacob Barthelmeh 6d434d0030 initial port to Nucleus
update example on Nucleus

add code sourcery IDE project

fix naming of IDE project files

clean up opendir for fail case

fix for build warnings

add fstat and fixes for nucleus port

update FALL_THROUGH case

add null terminator and more memory free's

fix for scan build warnings

fix warning of no return value

better bounds checking

better path cleaning

fix return values in header file

clean path before access

remove trailing delimiter from clean path
2018-06-13 09:44:54 -06:00
JacobBarthelmeh 0fc6f343b0
Merge pull request #72 from ejohnstown/static-fixes
fix a handful of clang static analysis warnings
2018-06-07 09:38:46 -06:00
John Safranek 8477c4acd6 fix a handful of clang static analysis warnings 2018-06-06 15:04:59 -07:00
Jacob Barthelmeh dfdb2b1335 change return value for SFTP connection and clean up after rebase 2018-06-01 17:22:06 -06:00
Jacob Barthelmeh 2b934bd941 update error values and fix [l]stat status packet 2018-06-01 17:20:54 -06:00