1. Modified SignalTcpReady() to test.h. Matched its prototype to the
other functions for TcpReady.
2. Add a timeout in WaitTcpReady() specifically for Zephyr builds.
3. Misc few cleanups.
The example server was never used. All new behaviors were added to the
echoserver only. Now with wolfSSHd, the server example can finally be
removed.
1. Remove the example server from the build.
2. Remove the file notes.md.
3. Update the readme.
1. Fix an instance in the example sftpclient where the size of something
is treated as an int and may have caused trouble, per the pedantic
compiler settings.
2. Changed a check for snprintf where we checked the lengths of
everything before calling snprintf. Turned it around where we check
the return of snprintf and error if the process would have output too
much.
1. When putting a file with SFTP, the client should check that the
requested file is a regular file based on its attributes.
2. Add the attributes to check in the permissions.
3. Add server checking for non-regular files and not allowing them to
be opened for reading or writing.
1. When getting a file with SFTP, the client should check that the
requested file is a regular file based on its attributes.
2. Add the attributes to check in the permissions.
3. Add a new error for a non-regular file.
A couple changes to keep the echoserver from spin-locking.
1. The SFTP worker should wait for data if the channel window is full.
If the client isn't sending a window adjust, it might be because of a
human time scale issue. New timeout is 60 seconds.
2. When the echoserver is waiting for something from the user and the
select times out, wait a second instead.
1. Change GetTerminalSize() to GetTerminalInfo().
2. Add the term variable to the things GetTerminalInfo() looks up.
3. Return the actual value of the environment variable TERM to the
server. If one isn't present, default to "xterm".
4. Clean up the whitespace in SendChannelTerminalRequest().
Misc other changes:
1. Cleanup whitespace in the recently added function
SendChannelOpenFail().
2. Add labels to the parameters in the prototype for
SendChannelOpenFail().
3. Remove the CR addition for Windows in the example client. Causes the
enter key to double-strike.
1. Add quit parameter to the example client's thread_args structure.
This will be used to let the windowMonitor thread know the
application is quitting.
2. If the windowMonitor's quit flag is set, it will exit and not call
wait again.
3. Join the windowMonitor thread rather than cancel it.
When the example client is using non-blocking sockets, sometimes they
don't block. The monitor thread on the socket wasn't handling
WS_WANT_READ explicitly, and treated it as a fatal error. It should be
reset to WS_SUCCESS.
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.
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.
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.
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.