Commit Graph

234 Commits (c402947e3e5eff8368ab1e458014b831fd39c779)

Author SHA1 Message Date
Hideki Miyazaki c402947e3e Add Renesas CS+ support and example server
Fixed CC-RX compiler warning

Fixed README
2019-05-07 09:20:15 +09:00
John Safranek cd05289772 Auth Fix
Before calling the auth callback, be sure to zero out the UserAuthData
I/O value, in case the calling application doesn't set a password or
key.
2019-04-26 10:21:14 -07:00
John Safranek c2873009e9 fd Fix
POSIX uses an int for a file descriptor. In Windows, they use a SOCKET
type which isn't an int, it is a unsigned long. Changed the types of
the file descriptors to a WS_SOCKET_T, which is either an int or a
SOCKET. Added a unit test.
2019-04-26 09:22:34 -07:00
John Safranek 9aaebbb146 Update the copyright to 2019 2019-04-08 10:24:08 -07:00
John Safranek f7f7b4743e
Merge pull request #147 from kojo1/add-algos
Add AES-CTR, make Algo configurable
2019-04-05 14:14:03 -07:00
John Safranek 1d051e1a84 Memory Update
1. Renumbered the dynamic memory type IDs so they don't conflict with wolfCrypt/wolfSSL.
2. Renumbered the error codes so they don't conflict with wolfCrypt.
3. Fixed a couple of typos when using dynamic memory type IDs that were missed due to default memory handling being used.
2019-04-05 11:36:25 -07:00
Takashi Kojo 658f081237 make configuration opts, WOLFSSH_NO_xxx, compatible with wolfSSL names. 2019-04-05 08:39:10 +09:00
Takashi Kojo a93bc3673e guard by configuration options, WOLFSSH_NO_xxx 2019-04-05 06:52:54 +09:00
Takashi Kojo 08faaf9f46 configurable cannedXXXAlgoNames 2019-04-04 17:12:38 +09:00
John Safranek d3f3e2ca33
Merge pull request #119 from JacobBarthelmeh/exec
Extended Data Read and Execute Channel
2019-04-03 16:21:47 -07:00
John Safranek 0326cfea31 Fuzz Fix
AFL found a failed bounds check in DoDebug. Fixed the check to test for the smallest possible size of the incoming message.
2019-04-03 14:09:06 -07:00
John Safranek 47a51b5a5b Server Public Key Bug Fix
The callback was getting a pointer to the raw public key data in the
receive buffer including the blob length, this caused the pubkey to be
short in the callback. Updated the pubKey given to the callback to be
the SSH encoded blob without the total size, and pass the total size in.
Also, update the hash of the public key to include the size.
2019-04-03 10:18:20 -07:00
Takashi Kojo 357172afcd add CTR in cannedEncAlgoNames 2019-04-03 09:46:31 +09:00
Takashi Kojo b8a2101499 AES_ENCRYPT for AES-CTR, wc_AesSetKey 2019-04-03 06:47:47 +09:00
Takashi Kojo 6c57e54e79 make Alog configurable 2019-04-02 08:44:17 +09:00
Takashi Kojo 8a82608cd7 add AES-CTR 2019-04-02 07:21:38 +09: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
Jacob Barthelmeh d6efc07bc9 sanity check on size returned 2019-03-18 14:28:01 -06: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 f2cb7a3356 scan-build fixes 2019-01-25 10:47:24 -07: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 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 73839469ed adjust stream_send behavior with WANT_WRITE 2019-01-18 10:19:18 -07:00
Jacob Barthelmeh 19a4ce6403 initial sftp server non blocking 2019-01-16 18:03:36 -07: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 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 157b71be7c Update wolfSSH_SFTP_Put() and wolfSSH_SFTP_SendWritePacket() for non-blocking. 2019-01-04 10:44:41 -08: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
Jacob Barthelmeh c06bb7db56 modify wolfSSH_stream_send behavior with non blocking want write case 2018-12-28 11:02:25 -07: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 d34900b6ae refactor code and add more CreateMpint calls 2018-12-14 14:01:20 -07:00
Jacob Barthelmeh f0f286fd41 check on mpint shared secret 2018-12-13 15:55:51 -07:00
Jacob Barthelmeh 7911c70349 sanity check that WOLFSSH struct has handshake info 2018-12-12 13:34:18 -07: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 35938eb1a2 wolfSFTP for Windows
1. Updated file functions to be usable by Win32.
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
JacobBarthelmeh ba4fae0054
Merge pull request #98 from ejohnstown/fwd
TCP Port Forwarding
2018-09-20 13:39:07 -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