Commit Graph

142 Commits (a48926b0dd65d8ab7abb248844513afddbb63d24)

Author SHA1 Message Date
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 e40e852bc2 handle certificate chains 2022-08-24 06:35:40 -07:00
JacobBarthelmeh 69e1cde58f update macro guard in echoserver 2022-08-24 06:35:40 -07:00
JacobBarthelmeh 71d7f9c8cc more return code checking 2022-08-24 06:35:40 -07:00
JacobBarthelmeh 8fa67a041b add argument to client for loading certificate 2022-08-24 06:35:40 -07:00
JacobBarthelmeh c507c77431 add UUID and FASC-N 2022-08-24 06:35:40 -07:00
John Safranek 13e525478c X.509 Certificate Support
1. Quality of Life improvements to echoserver: command line user config
2. adding policy checking
2022-08-24 06:35:40 -07:00
John Safranek a8fa38d7f8 OCSP Lookups
1. Changed to use the new set of certs.
2. Do an actual cert check and report errors.
3. Do an actual OCSP lookup and report errors.
2022-08-24 06:35:40 -07:00
John Safranek 1405eeae62 X.509 Certificate Support
1. Fix build error when building without certificates.
2. Add the root CA option to the echoserver usage.
3. Update the readme file to include the new certificate option.
4. Added command line option to load a CA cert into the echoserver.
2022-08-24 06:35:40 -07:00
JacobBarthelmeh 20ace73349 fix new scan-build warning 2022-08-22 18:09:07 -06:00
Jacob Barthelmeh 92d1f39065 update copyright date 2022-08-17 16:58:21 -06:00
John Safranek 511a022833
Merge pull request #435 from JacobBarthelmeh/sshd
Alpha version of SSHD support with wolfSSH
2022-08-16 16:22:55 -07:00
Jacob Barthelmeh 5806d28dd2 check for null port value 2022-08-09 13:24:58 -06:00
JacobBarthelmeh dba42d3dc7 Non-blocking SFTP and SSH fixes, handle edge case with files having '.' in name, alter want write case to return consumed size 2022-08-08 13:43:34 -07:00
JacobBarthelmeh 7b8ce149d7 add look for libpam and adjust for QNX build 2022-07-21 13:31:22 -07:00
JacobBarthelmeh 3013eee8cb handle pending sent packets with SFTP and want write case with rekey 2022-07-14 09:17:43 -07:00
John Safranek 6bc47eef77 No User
1. In the echoserver, add a print to the case where a user doesn't exist
   in the system.
2022-05-25 14:21:50 -07:00
John Safranek b34f144814
Preprocessor Guards
1. Add preprocessor guards for RSA/ECC to agent and the example and test
applications.
2. Remove redundant copy of FwdStates from internal.h.
2022-04-05 11:02:23 -07:00
David Garske 509851e64e
Merge pull request #398 from ejohnstown/status
Echoserver SFTP status update
2022-03-25 14:45:56 -07:00
John Safranek b94349bbc5
Echoserver SFTP status update
1. In wolfsftp, treat all the status codes the same when trying to read.
2. In the echoserver, treat all the status codes the same in the
   sftp_worker.
2022-03-24 16:55:12 -07:00
David Garske 0f22329187 Fix for FIPS 140-3 on ECC private key use. Fix for IPv6 with scpclient. Wrong macro for fall through. Add support for flushing file IO using `WOLFSCP_FLUSH`. 2022-03-24 13:34:26 -07:00
John Safranek 981b8e8b30
SFTP Channel Receive Fix
1. The echoserver's sftp_worker() was treating the WS_CHAN_RXD status as
   an error and failing out. Updated to clear the error status.
2. wolfSSH_SFTP_read() was also treating WS_CHAN_RXD status as an error
   and terminating the transfer. Update to treat like the other status.
2022-03-21 14:39:52 -07:00
John Safranek 796423bfac
Update tests and examples to include config.h
1. All the sources for the tests and examples did not have an include
   for config.h. This fixed some inconsistent builds with an older
   version of gcc.
2. Moved config.h from the src directory to the top level of the repo
   directory.
2022-01-26 15:06:07 -08:00
Jacob Barthelmeh ba99ddda68 run license update script 2021-11-04 13:11:53 -06:00
Jacob Barthelmeh db00600628 fixes for warnings from scan-build 2021-11-04 09:43:53 -06:00
John Safranek 3c8b2a622a
In the echoserver, added a state check when a channel closes so it doesn't try to check a bad fd. 2021-10-07 15:09:02 -07:00
John Safranek a1f90568ab
Some cleanup for Windows build. 2021-10-06 18:08:04 -07:00
John Safranek fde6ce4550
SSH Port Forwarding Redux
1. Fixed a leak from a commit earlier in this branch.
2. Freed the correct address name when a forwarded connection closes.
3. Only muck about with the childFd when using the shell.
4. Treat the error code WS_CHANNEL_CLOSED as status, not a failure.
2021-10-06 13:24:13 -07:00
John Safranek d66fb26158
Update the echoserver to look up addresses used. 2021-10-06 13:24:05 -07:00
John Safranek 061463e604
Changed calls to malloc, free, memcpy, etc. with uses of the wrappers WMALLOC, WFREE, WMEMCPY, etc. 2021-10-05 19:38:33 -07:00
John Safranek dd79a54541
Fix issue with shutting down a channel. It would try to do it twice and error out. 2021-10-05 19:38:18 -07:00
John Safranek f369f4346c
Static Analysis Test Report Fixes
1. Moved SendKexDhReply()'s signature data to the heap. (413)
2. Moved SendUserAuthRequest()'s signature data to the heap. (414)
3. Moved DoKexDhReply()'s signature data to the heap. (415)
4. Moved DoUserAuthRequestRsa()'s RSA key to the heap. (416)
5. Moved wolfSSH_ProcessBuffer()'s key buffer to the heap. (422)
6. Moved wolfSSH_ReadKey_buffer()'s key bugger to the heap. (423)
7. In the echoserver, fixed a small-stack related allocation. It was
   using a DYNTYPE constant, but those aren't visible. Also, the
   wrong variable name was getting freed. (rebase)
2021-09-27 08:35:15 -07:00
John Safranek b3e9321a3c
Fixed an echoserver leak with forwarding. 2021-09-27 08:06:54 -07:00
John Safranek 1a807f1da4
Move some buffers around in the echoserver so they are allocated once per thread. 2021-09-27 08:06:54 -07:00
John Safranek 6d606dff45
Port Forwarding Update
1. Fix issue with local port forwarding example.
2. Add remote port forwarding to the echoserver.
3. Updated the unsupported GlobalReq response.
2021-09-27 08:06:54 -07:00
JacobBarthelmeh df753b0b4b sanity check on the end of the buffer in example 2021-08-27 13:41:41 -06:00
Jacob Barthelmeh 7968cb479e make loading user created keys into the examples easier 2021-08-25 09:53:58 -06:00
Eric Blankenhorn 5931aefff5 Fix for NO_FILESYSTEM and WOLFSSH_NO_AES_GCM 2021-07-20 11:22:04 -07:00
John Safranek bbd3d76291
Add some option disables to the api test and the echoserver. 2021-02-02 11:45:21 -08:00
John Safranek 31912462a0
Hide SHA from Echoserver
1. Remove calls to wc_Sha256 Init, Update, and Final and remove the
   instances of the wc_Sha256 structure.
2. Remove the c32toa function, it isn't used at this point.
3. Add calls to wc_Sha256Hash().

This removes the Sha256 structure off the stack and replaces it with the
direct call to the single-shot hash routine. Flattening the size of the
hashed data and hashing it in was removed as redundant.
2020-12-10 08:42:37 -08:00
John Safranek 28f5d750c9
More Options
1. Fix the key offerings in the echoserver and client with ifdef guards.
2. Fix a couple guards that weren't copy-pasted correctly.
2020-10-15 08:48:02 -07:00
John Safranek 4d5ce88cc9
More Options
Wrapped more items with guards to disable them if not usable.
2020-10-13 17:42:02 -07:00
Takashi Kojo 69791e1ff2 moving WOLFSSH_TEST guard into test.h 2020-10-11 11:54:39 +09:00
Takashi Kojo 28b8e745b1 fix for MQX 2020-10-11 06:53:46 +09:00
Jacob Barthelmeh 000b8544c6 add peek when waiting for data 2020-09-30 13:22:07 -06:00
John Safranek 39f30e25a4
Optional RSA
1. If RSA is disabled in the wolfCrypt build, the RSA related code
   in wolfSSH shall be disabled.
2. Examples will force themselves to use ECC if RSA is disabled.
2020-09-04 15:28:25 -07:00
John Safranek 132a0a52f6
Clean up a couple issues where building the code with a C++ reported build errors.
1. Typecasting the return from malloc.
2. strncpy() checking.
2020-08-31 09:31:47 -07:00
John Safranek e052108d0c
Merge pull request #271 from JacobBarthelmeh/scp
add callback and example for no file system with SCP
2020-08-27 09:23:17 -07:00
John Safranek e5c90b31e1
Merge pull request #273 from JacobBarthelmeh/testing
graceful shutdown with scp interop
2020-08-26 10:28:23 -07:00
Jacob Barthelmeh 217a7d6520 add callback and example for no file system with SCP 2020-08-26 10:22:56 -06:00