Commit Graph

342 Commits (aa7330f7fcacae2ce7f5af91ceac2a3c14b79d04)

Author SHA1 Message Date
John Safranek 157b71be7c Update wolfSSH_SFTP_Put() and wolfSSH_SFTP_SendWritePacket() for non-blocking. 2019-01-04 10:44:41 -08:00
Jacob Barthelmeh 3f1ebe292c initial LS nonblocking (needs more work) 2019-01-03 17:15:36 -07:00
John Safranek 2662e43cf1 Fix a couple scan-build warnings. 2019-01-02 15:11:05 -08:00
John Safranek 5c49c3fd46 Changing some spots where we weren't following the pattern of setting
the error field of the ssh object and just returning WS_FATAL_ERROR.
Instead of changing all the downstream fucntions from DoReceive(), have
it store the return value into the error register and return WS_FATA_ERROR.
2019-01-02 15:00:02 -08:00
John Safranek a28bf9902c Changing some spots where we weren't following the pattern of setting
the error field of the ssh object and just returning WS_FATAL_ERROR.
2019-01-02 14:38:22 -08:00
John Safranek 1ff58f0a94 Fixed some of the updated functions to clean themselves up on error,
except for would block situations.
2019-01-02 12:42:01 -08:00
Jacob Barthelmeh 887b4fa3ba adjust read on SFTP get 2019-01-02 13:31:20 -07:00
Jacob Barthelmeh f0ba3a0849 malloc lstat buffer and rework SFTP send packet type 2019-01-02 11:32:41 -07:00
Jacob Barthelmeh 821b34df23 use buffer for parsing SFTP attributes rather than reads 2019-01-02 10:05:23 -07:00
Jacob Barthelmeh 05f8070fa2 sftp real path non blocking 2019-01-02 09:46:46 -07:00
John Safranek 554fbda213 Non-blocking SFTP
1. Updated wolfSSH_SFTP_ClearState() with missing states.
2018-12-28 14:45:14 -08:00
John Safranek b4eff0ce7c Non-blocking SFTP
1. Updated wolfSSH_SFTP_GetHandle() using the new state machine method.
2018-12-28 14:38:51 -08:00
John Safranek 6fd588f208 Non-blocking SFTP
1. Updated wolfSSH_SFTP_Close() using the new state machine method.
2018-12-28 10:33:00 -08:00
Jacob Barthelmeh c06bb7db56 modify wolfSSH_stream_send behavior with non blocking want write case 2018-12-28 11:02:25 -07:00
John Safranek af32ee760f Fix failure in initializing the LSTAT state machine. 2018-12-28 09:57:51 -08:00
John Safranek bf89f60f14 scan-build fixes 2018-12-27 17:53:05 -08:00
John Safranek 41beb69794 Non-blocking SFTP
1. Updated wolfSSH_SFTP_SendReadPacket() using the new state machine method.
2018-12-27 17:25:43 -08:00
John Safranek b841fdb33a Non-blocking SFTP
1. Updated wolfSSH_SFTP_LSTAT() using the new state machine method.
2018-12-27 16:15:41 -08:00
Jacob Barthelmeh db09f672f2 add -N flag to SFTP client 2018-12-27 16:15:15 -07:00
Jacob Barthelmeh 915b383cd3 touch up to SFTP_GetHeader for nonblocking 2018-12-27 11:22:21 -07:00
Jacob Barthelmeh dbbe886efb add wolfSSH_SFTP_ClearState function for free'ing states 2018-12-27 10:00:43 -07:00
John Safranek 42f116bf1d Non-blocking SFTP
1. Move the non-blocking state types to wolfsftp.c.
2. Updated wolfSSH_SFTP_Open() to use the non-blocking state machine.
3. Updated wolfSSH_SFTP_Get() using the new state machine method.
2018-12-26 16:28:30 -08:00
John Safranek 4dc799ebeb Non-blocking SFTP
Rewrite wolfSSH_SFTP_Get() to be reenterant with its own state machine.
2018-12-21 15:58:06 -08:00
John Safranek 8c8e1191a5
Merge pull request #129 from JacobBarthelmeh/testing
check on mpint shared secret
2018-12-14 14:04:27 -08:00
Jacob Barthelmeh 5b917ef1c6 add log.h include and fix typo 2018-12-14 14:54:38 -07:00
Jacob Barthelmeh d34900b6ae refactor code and add more CreateMpint calls 2018-12-14 14:01:20 -07:00
John Safranek fb28cdab48
Merge pull request #128 from JacobBarthelmeh/fuzz
sanity check that WOLFSSH struct has handshake info
2018-12-14 10:27:52 -08:00
Jacob Barthelmeh f0f286fd41 check on mpint shared secret 2018-12-13 15:55:51 -07:00
Jacob Barthelmeh 86344c7e68 make check condition exact 2018-12-12 14:58:22 -07:00
Jacob Barthelmeh 7911c70349 sanity check that WOLFSSH struct has handshake info 2018-12-12 13:34:18 -07:00
Jacob Barthelmeh 10c888b855 fix return check on ReadFile and WriteFile 2018-12-11 16:33:10 -07:00
John Safranek feb283b5c5 Updated wolfSCP and wolfSFTP to use the new syntax for wstrncat. 2018-12-03 16:27:45 -08:00
John Safranek d8797b07f8 Add the function wstrcat() which acts like strncat, but adds an extra
check for space in the destination and will fail instead of truncating
the string.
2018-12-03 16:27:45 -08:00
Jacob Barthelmeh 39ab2abf66 add sftp client VS project 2018-12-03 16:27:45 -08:00
John Safranek b57e825381 wolfSFTP for Windows
1. Clean up some type size warnings.
2. Fix the wrappers for FileRead() and FileWrite(). The Overlapped
struct is a little funky to use.
2018-12-03 16:27:45 -08:00
John Safranek d30be12a30 Move the kludge #define to hush the windows builds on the string
functions to settings.h.
2018-12-03 16:27:45 -08:00
John Safranek 4f9311890d wolfSFTP for Windows
1. Added wrappers for FileRead and FileWrite to work with Win32.
2018-12-03 16:27:45 -08:00
John Safranek 6d8e55eb8c Typecast some strlen return values to the type they are assigned to. 2018-12-03 16:27:45 -08:00
John Safranek 9e16f6ec71 Clean up actually building on VS2012. 2018-12-03 16:27:45 -08:00
John Safranek 35938eb1a2 wolfSFTP for Windows
1. Updated file functions to be usable by Win32.
2018-12-03 16:27:45 -08:00
John Safranek 9b3af16ac2 wolfSFTP for Windows
1. Add a function mapping block to port.h for Windows build file routines.
2018-12-03 16:27:45 -08:00
Jacob Barthelmeh c033c6e979 use a dynamic buffer for SCP base path with Nucleus port 2018-11-30 16:58:48 -07:00
John Safranek dcd924577e Non-blocking fix
When sending data, if there is pending data, try to send it first before
setting up the next message.
2018-11-21 11:42:50 -08:00
John Safranek f414e7721a Non-blocking fix
1. If data is still in the buffer, try sending it again.
2018-11-21 11:38:33 -08:00
John Safranek 79646f93d1 Function Name Change
wolfSSL and wolfSSH both have a function named SendBuffered() and they
are both set to local visibility. There is at least one build
configuration where both versions of the function are visible and the
compile fails. Changing the name in wolfSSH to add the pseudonamespace
prefix wolfSSH_, and also changed the name of the function to
SendPacket() since it is used with two other functions with Packet in
the name.
2018-11-20 16:35:53 -08:00
Jacob Barthelmeh bdae414009 sanity check on buffer length 2018-11-15 16:28:22 -07:00
John Safranek 3b276aaae9
Merge pull request #115 from JacobBarthelmeh/fuzz
additional sanity checks
2018-11-15 14:44:57 -08:00
Jacob Barthelmeh 9f3d1f07d2 additional sanity checks 2018-11-15 15:36:51 -07: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
Jacob Barthelmeh 6c0d053f57 gcc-7 build fall through warning 2018-10-29 15:29:25 -06:00
Jacob Barthelmeh a14244d440 fix for check read return value with sftp 2018-10-08 17:45:23 -06:00
JacobBarthelmeh 1524c73438
Merge pull request #107 from ejohnstown/fix-no-inline
Fix disable-inline option.
2018-09-24 09:54:35 -06: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
Jacob Barthelmeh 1ae2bc3330 name change wolfSSH_CheckPeerWindow -> wolfSSH_CheckReceivePending 2018-09-20 14:27:53 -06:00
Jacob Barthelmeh 68e6d8308b add function to check for window adjustment and fix SCP file buffer offset
close file on SCP write fail, and add ioctl for Nucleus

window adjustment check with SFTP and handle multiple adjustment packets

fix for setting return value with Nucleus ioctl
2018-09-20 14:27:53 -06:00
JacobBarthelmeh ba4fae0054
Merge pull request #98 from ejohnstown/fwd
TCP Port Forwarding
2018-09-20 13:39:07 -06:00
Jacob Barthelmeh 64917a82d1 fixes for Nucleus port 2018-09-19 18:20:37 -06:00
John Safranek 1478f47296 remove an unused global request case we aren't using at this point 2018-09-19 15:42:35 -07:00
John Safranek f58cdee4a6 Removed some supplemental debugging prints from wolfSSH_worker(). 2018-09-19 15:18:35 -07:00
Jacob Barthelmeh 49cd054534 exit "put" loop if at end of file 2018-09-11 16:37:22 -06:00
JacobBarthelmeh b889645008
Merge pull request #101 from ejohnstown/small-fixes
Small Fixes
2018-09-11 15:20:48 -06:00
John Safranek 94626a5a2c Small Fixes
1. fixed bug in DoKexDhGexGroup() where ret was initialized to an error
2. The peer channel ID set during the connect needs to be saved for use later.
2018-09-11 14:01:59 -07:00
Jacob Barthelmeh 89a4c1015e add default SCP state of no direction set 2018-09-11 14:33:06 -06:00
John Safranek cf8b597250 Match Fix
When matching ID lists during the KEX Init, the client needs to swap lists.
2018-09-07 15:10:03 -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
Jacob Barthelmeh 634de0dc89 sanity checks on arguments 2018-08-31 16:56:55 -06: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
Jacob Barthelmeh bd816106f6 add sftp support for file time attribute 2018-08-20 16:38:17 -06:00
John Safranek 1a0be6492f
Merge pull request #90 from JacobBarthelmeh/fuzz
fix for possible overflow with sanity check
2018-08-14 10:38:37 -07:00
Jacob Barthelmeh 962ee5a06b fix for possible overflow with sanity check 2018-08-13 10:39:15 -06:00
Jacob Barthelmeh 53e14bd3c9 fix for uninitialized value and for base directory on nucleus port 2018-08-07 18:42:15 -06:00
Jacob Barthelmeh 9d6d975700 fix for recursive scp case 2018-08-07 13:18:48 -06:00
Jacob Barthelmeh ed68e57f64 account for emptying directory stack 2018-08-06 15:53:12 -06:00
Jacob Barthelmeh 8807fa0f2c fix warning and update comments 2018-08-06 14:40:15 -06:00
Jacob Barthelmeh b86c8befd1 update scp to handle file rename 2018-08-06 14:20:44 -06:00
Jacob Barthelmeh 5cbfa5e43f rename from different drives and list drives 2018-07-31 14:39:46 -06:00
John Safranek 419efeb59c
Merge pull request #80 from JacobBarthelmeh/sftp-nuc
fix when reading directory
2018-07-16 10:28:25 -07:00
Jacob Barthelmeh 8601a73026 sanity check that handshake information can be used 2018-07-02 15:23:14 -06:00
Jacob Barthelmeh f348629f06 better thread saftey with handle list 2018-06-29 16:24:02 -06:00
Jacob Barthelmeh b0b659a8e5 remove print statement 2018-06-29 15:40:32 -06:00
Jacob Barthelmeh 8baf943527 try and clean up any open handles on cleanup 2018-06-29 15:35:42 -06:00
Jacob Barthelmeh 2f826aadeb clang warnings and static analysis 2018-06-29 09:31:58 -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 c7b2dfbf1d sanity check on arguments with debug 2018-06-14 17:17:07 -06:00
John Safranek fbdff7f186 a few whitespace fixes 2018-06-14 14:30:40 -07: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
Jacob Barthelmeh 0fb9a76e54 alter error value for rename failure 2018-06-12 13:30:56 -06:00
Jacob Barthelmeh f80617f43c return value with write to file error 2018-06-12 13:29:58 -06:00
Jacob Barthelmeh 44585908f1 additional free's and memory management 2018-06-12 13:27:38 -06:00
Chris Conlon 37e3250164 fix scanbuild warning in SendChannelRequest() 2018-06-12 10:51:17 -06:00
JacobBarthelmeh 4415d2e52f
Merge pull request #71 from cconlon/scp
scp: update error propogation, add WOLFSSH_SCP_NEW_REQUEST state to send callback
2018-06-07 09:46:11 -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
Jacob Barthelmeh bebc660309 fix for static analysis warning 2018-06-06 16:26:58 -06:00
John Safranek 8477c4acd6 fix a handful of clang static analysis warnings 2018-06-06 15:04:59 -07:00
Chris Conlon a38fae858a add WOLFSSH_SCP_NEW_REQUEST state to scp to allow for application to abort transfer 2018-06-05 10:52:46 -06:00
Chris Conlon 7cd616cb8c propogate scp errors to application for wolfSSH_get_error 2018-06-05 09:51:25 -06:00
Jacob Barthelmeh a26bace432 fix size values on string cat 2018-06-04 10:29:08 -06:00
Jacob Barthelmeh dfdb2b1335 change return value for SFTP connection and clean up after rebase 2018-06-01 17:22:06 -06:00