Commit Graph

290 Commits (31c98b8c68acb10b755c3bfc008d6294de017586)

Author SHA1 Message Date
JacobBarthelmeh b589883539 fix for building client on windows with shell support 2023-06-28 14:32:15 -06:00
John Safranek 639f896320
Merge pull request #519 from JacobBarthelmeh/scp
break between SSH accept and SCP operation
2023-06-01 20:54:43 -07:00
JacobBarthelmeh 981a506967 add check for channel eof and remove shutdown call 2023-06-01 15:05:24 -07:00
JacobBarthelmeh 3da8e2a690 add cr for enter with shell connections to windows server 2023-05-19 12:59:04 -07:00
JacobBarthelmeh 3f2aa055ab break between SSH accept and SCP operation 2023-05-19 06:26:18 -07:00
John Safranek 851ac5525e
Variable Scope
1. Tighten up scope on variables in function SendKexDhReply.
2. Fix echoserver not handling the non-blocking would block state for
   SFTP.
2023-05-11 11:10:44 -07:00
John Safranek d00db44b2f
SFTP Update
1. In the API test for SFTP, change the amount of the file requested to
   the limit WOLFSSH_MAX_SFTP_RW.
2. The check for want read on the exit of the server worker should clear
   ret if it is want read.
2023-04-19 13:39:35 -07:00
John Safranek 35554745bc
Update sftpclient
1. Update the example SFTP client with changes made for the echoserver.
2. Better handling of rekeying status.
2023-04-13 16:17:59 -07:00
John Safranek c97e8ea319
Rekey
With the previous change for speed and timing, rekeying started having
trouble in SFTP. Each file block travels as two messages, and the
rekeying starts, but the messages are sent and lost. The client would
terminate the connection.

1. Tweak the timeout in the echoserver's SFTP loop.
2. Better checking for rekeying.
3. Returning that rekeying is happening.
2023-04-11 19:50:55 -07:00
John Safranek 73946a36c6
Decoupling SFTP from SSH
wolfSSH has a reach too deep into the wolfSSH internals. SFTP should
be more like an application running on top of wolfSSH. We prefer to
keep it all in one application, so it will work well in an embedded
environment, but there needs more separation.

1. The sftp_worker loop in the echoserver should prioritize reading
   the socket and processing the SSH layer messages. Next it should
   ensure the transmit buffer for the SFTP channel is being written.
   Last it should check the receive buffer for the SFTP for new
   messages from the peer. wolfSSH_worker() will ensure data is read
   from the socket, and distributed to the appropriate channel
   receieve buffers, and will make sure the SSH bookkeeping is
   performed.
2. SendChannelData() should also bound the send data amount by the
   local maxPacketSz.
3. wolfSSH_SFTP_buffer_send() should send only one chunk of data, not
   looping until everything is gone. Need to send, but cannot flood
   the output.
4. Remove the call to wolfSSH_worker() from the buffer send.
5. The wolfSSH_SFTP_read() state machine should check the return
   status from the call to buffer send, and if it isn't an error,
   don't clear the state, allow for a want-write write again later.
6. Do not limit the file chunk size to send to WOLFSSH_MAX_SFTP_RW.
   This limit is provided during SFTP negotiation. If the peer
   requests that much data, send it.
6. Modify the select wrapper to have a very small microseconds value
   in addition to the requested seconds.
2023-04-10 15:57:25 -07:00
JacobBarthelmeh 5a674a42d7 fix for ssh->error with SCP and public key use with common client code 2023-04-04 21:57:36 -07:00
JacobBarthelmeh 80f6ebb963 resolve unused function warnings 2023-04-04 14:59:46 -07:00
JacobBarthelmeh 5971e8a4fa warning fixes and windows build 2023-04-04 14:59:46 -07:00
JacobBarthelmeh a9224993fd refactor client apps and add X509 to scpclient 2023-04-04 14:59:46 -07:00
John Safranek 95bcc4541c
Release v1.4.13
1. Update the copyright year in all file header comments.
2. Update the STM32CUBE files to use the correct GPL headers.
2023-04-03 10:41:10 -07:00
Eric Blankenhorn 85f904dbfe Fix build error in client_test 2023-03-15 09:46:01 -05:00
John Safranek f8651c952b
Merge pull request #498 from JacobBarthelmeh/sshd-forcedcmd
remove leading tabs in config file while parsing, add force command test
2023-03-10 15:17:57 -08:00
John Safranek 55f352781e
Merge pull request #489 from JacobBarthelmeh/ip_check
add runtime option to override IP check with client
2023-03-10 15:00:46 -08:00
Kareem d1bdc32de1 Fix 32-bit builds of the SFTP client. Only build SFTP client if building examples is enabled. 2023-02-15 16:59:34 -07:00
John Safranek c59226c36b
Build Cleanup
1. Found a few cases where disabling RSA made some things either not
   build or run correctly.
2. Hushed a few unused variables in gated-disabled situations.
3. Moved a temp variable closer to where it is used.
2023-02-03 17:18:26 -08:00
John Safranek 6d6b4686b2
Fix SFTP Upload Stall
1. Update README for the change in the default channel receive window size.
2. In the SFTP client, add rekeying as a error that's OK to ignore.
3. In wolfSSH_stream_read(), clear the SSH object's error register.
2023-02-01 17:09:30 -08:00
John Safranek 7c92e34180
Merge pull request #490 from JacobBarthelmeh/sftp-path
handle full path used with SFTP Get-Put commands
2023-01-24 15:46:36 -08:00
John Safranek 1a58568eac
Merge pull request #487 from JacobBarthelmeh/pathing
set ssh error in sftp status not ok state
2023-01-24 15:35:32 -08:00
JacobBarthelmeh f844683c13 remove leading tabs in config file while parsing, add force command test 2023-01-23 14:25:08 -08:00
JacobBarthelmeh ca36b31666 add IP override for sftp client 2023-01-20 15:48:41 -08:00
JacobBarthelmeh 77ef211997 avoid trying to close a remote file if no handle was parsed 2023-01-20 14:42:27 -08:00
JacobBarthelmeh 17e2a834ad handle full path used with SFTP Get-Put commands 2023-01-19 16:14:44 -08:00
JacobBarthelmeh 6c1d0d78ab add runtime option to override IP check with client 2023-01-19 16:02:33 -08:00
JacobBarthelmeh f8b46ce1e3 alter setting of ssh->error with SFTP get and return value 2023-01-18 09:27:47 -08:00
JacobBarthelmeh d82283a8e3 add '-s' option to print file sizes with 'ls' command 2023-01-15 13:44:02 -08:00
John Safranek 99bab74d78
Release Cleanup
1. Update the release date in the ChangeLog.
2. Move some compiler guards around to hush warnings depending on the
   build options.
3. Fix a string name for ECDSA P521 algo.
4. Fix a stray static function definition.
5. For FIPSv5 builds, add CAST tests to the API test and testsuite.
6. Add the wolfSSH_Init() and wolfSSH_Cleanup() to the unit test.
2022-12-27 16:19:21 -08:00
John Safranek bef7f758cc
SFTP Large File Fix
1. There were a couple spots during a large file transfer where the
   client rekeying the session would interrupt the transfer and/or
   reset the amount of file data transfered. Fixed that with a check
   for WS_CHAN_RXD.
2. Added a build option to interrupt a file transfer after 2 minutes.
   Large files will take longer.
2022-12-22 09:52:18 -08:00
JacobBarthelmeh 055f52ca5a add cert use to sftp client 2022-12-19 16:37:40 -07:00
JacobBarthelmeh 29d59ac1f9 add debug print out for checking IP address of peer 2022-12-19 16:37:40 -07:00
John Safranek f75a60909a
Echoserver Driver
1. More tweaks for the threading guards.
2. Move a local declaration whose scope changed.
2022-11-01 15:26:22 -07:00
John Safranek e5a1c38d86
Echoserver Driver
1. Leave out the setup of the tcp_ready record when not using threading.
2. Don't change the echoserver directory when building for Integrity.
3. Change WEXIT to be a return(0) when building for Integrity.
4. The echoserver shouldn't call exit directly, it should save the
   return_code server args and then return to the caller.
5. When using forwarding, don't exit if the address is IPv6, return an
   error.
6. When exiting, close the listen file descriptor.
7. Reset myoptind to 0 before processing the options list.
2022-10-31 14:44:57 -07:00
John Safranek f0270d8920
Echoserver Driver
1. For Integrity builds, err_sys should only printf.
2. For Integrity builds, WEXIT should be a return.
3. In the echoserver, add explicit WEXITs for the err_sys statements.
2022-10-28 10:42:43 -07:00
John Safranek f25e5465e1
Echoserver Driver
1. Moved the contents of main to a new function, wolfSSH_Echoserver().
2. main just calls the wolfSSH_Echoserver().
2022-10-27 11:26:04 -07:00
Hayden Roche c88fa45d3d
Merge pull request #471 from ejohnstown/thread-dedup 2022-10-24 15:04:10 -07:00
John Safranek f88c3d6d3a
Dead Code Removal
1. In the echoserver's user authentication function, the summary check was
   refactored and the old code wasn't removed. A more strict compiler
   noticed the code was never executed.
2. Moved the ret check variable to the section of the function where it
   is used.
2022-10-21 15:54:34 -07:00
John Safranek 1fa4134304
Threading Deduplication
1. Move the test threading types and macros to the conditional threading
   section of test.h and make them conditional on wolfSSL v5.5.1.
2. Alias WOLFSSL_THREAD as WOLFSSH_THREAD.
3. Update the THREAD_FUNC typdef to look more like a function pointer.
4. Add the user_settings.h/options.h include that is missing from
   examples.
2022-10-21 15:17:19 -07:00
John Safranek d8e3288dd6
Merge pull request #465 from JacobBarthelmeh/Certs
renew cert script, add check for user name in UPN and host IP in alt. names
2022-10-21 09:43:58 -07:00
John Safranek a7c7830dcd
Automake Refactor
1. Remove the DISTCLEANFILES variables from automake scripts. The items
   they clean are already cleaned appropriately.
2. For application targets, move the local headers to the SOURCES lists
   for the apps.
2022-10-20 11:35:59 -07:00
JacobBarthelmeh 0f9304d70d update client macro guard and add small stack dcert 2022-10-19 12:52:59 -07:00
Jacob Barthelmeh 9e3c2f3b78 check on user name in UPN if exists
add check on host IP address in certificate alt names
2022-10-10 08:29:50 -07:00
John Safranek e983ae0ad9
Multiple Server Keys
1. Allow user to add multiple server keys to the CTX up to a limit.
2. Clear the list of server's keys when releasing the CTX.
3. Update the API test case.
4. Server key algo list based on keys loaded.
5. Server uses key requested by client.
6. Change echoserver to load ECC and RSA key, -E option to select order.
7. Added a function to identify keys, and another to identify certs.
8. Added a function to add keys or certs to the list of keys and certs.
9. Fix return value for MAC Algo C2S match fail to the correct value.
2022-10-07 15:35:35 -07:00
John Safranek b816ac5fe8
SFTP List
Updated from peer review comments.
2022-09-20 11:53:56 -07:00
John Safranek a48926b0dd
SFTP List
1. Update wolfSSH_SFTPNAME_readdir() to have a special case getting
   the drive letters at root in Windows.
2. The Win32 APIs can use forward slashes, but cannot have one at the
   beginning of the path before the drive letter. Add a trim function
   to remove the leading slash in the SFTP paths.
3. Update echoserver to always set the default SFTP path to either the
   provided command line option or to the CWD for the echoserver run.
4.  Get the RealPath for the default path
5. Tweak wolfSSH_RealPath() to handle some Windows cases.
6. Added more test cases.
2022-09-16 14:17:31 -07:00
JacobBarthelmeh 3e1a6ff342 add mutual X509 auth of host key and sshd_config parsing additions 2022-09-06 16:15:34 -07:00
John Safranek c1aabbdd87
Old Compiler Warning Cleanup (GCC 4.0.2)
Fixed a few "possibly used uninialized variable" warnings.
2022-09-06 09:10:50 -07:00