Commit Graph

211 Commits (a813f9c93ad49df6c64c86f039afe2d0c821023f)

Author SHA1 Message Date
John Safranek bd312c34f2
Old Compiler Warning Cleanup (GCC 4.0.2)
1. client.c: It was warning a recommendation to tag the function
   `readInput()` as non-return. Changed the err_sys() calls to
   `fprintf(stderr, ...)` and then return from the function.
2. internal.c: In functions `DoKexInit()` and
   `DoUserAuthRequestPublicKey()`, initialized a couple variables that
   could be used uninitialized.
3. wolfsftp.c: Fixed a variable that was shadowing a global label.
4. wolfsftp.c: In function `wolfSSH_SFTP_RecvFSTAT()`, initialized a
   variable that could be used uninitialized.
5. scpclient.c: The command line argument was read into a char value
   assuming it was signed, which is usually true. On the PowerPC this
   value is unsigned. Promoted it to int to match the other tools.
2022-01-27 10:36:51 -08: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 f95e0995cc
After sending the shutdown messages, client needs to wait for the server to respond before closing its socket. 2021-10-07 15:28:40 -07: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 1ad3fc052b
Change the checked error codes to their names. 2021-10-05 19:38:33 -07:00
John Safranek 0dd21f4593
Change portfwd's data buffers to use the define EXAMPLE_BUFFER_SZ for a size. It can be changed at configure time. Use allocated buffers for small stack builds. 2021-10-05 19:38:33 -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
John Safranek 21f54b0599 Clean up some awkward debug logging with respect to userauth. 2021-08-02 23:41:27 +07:00
Eric Blankenhorn 5931aefff5 Fix for NO_FILESYSTEM and WOLFSSH_NO_AES_GCM 2021-07-20 11:22:04 -07:00
Jacob Barthelmeh a0e19049f4 fixes for build with NO_WOLFSSH_CLIENT macro and --enable-all 2021-03-26 17:24:39 +07:00
John Safranek 351bc7585e
SSH-AGENT
1. For the client agent command line option, add the flag to the flag string.
2. Update PostSignRequest() to support all flavors of ECDSA and to
   switch out code for missing algorithms.
3. Hide function SendRequestIdentities().
2021-02-02 14:13:48 -08:00
John Safranek 88e7919fbf
SSH-AGENT
Add command line option to the client to allow use of the agent.
2021-02-02 14:01:39 -08:00
John Safranek bbd3d76291
Add some option disables to the api test and the echoserver. 2021-02-02 11:45:21 -08:00
Guido Vranken ec2ecb8a82 Fix memmove length calculation in SFTP client example 2021-01-08 11:07:15 +01: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 740d47d0b7
More Options
1. Wrapped the user keys in client.c with guards.
2. Added the ECC-521 key for hansel.
3. Touched up the loads of the keys with guards.
2020-10-14 14:28:26 -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
John Safranek 06ea6eb2d0
Merge pull request #289 from JacobBarthelmeh/interop
add peek when waiting for data
2020-10-01 12:05:06 -07:00
John Safranek b7a6a51f4f
Merge pull request #284 from JacobBarthelmeh/sftp
add example timeout to sftp example
2020-10-01 11:48:20 -07:00
Jacob Barthelmeh 000b8544c6 add peek when waiting for data 2020-09-30 13:22:07 -06:00
Jacob Barthelmeh a4b2c693fe use word32 type with timeout example 2020-09-30 11:45:33 -06:00
John Safranek 1be4042711
Change examples' header file including guard from pragma-once to ifndef-define. 2020-09-24 16:50:35 -07:00
Jacob Barthelmeh 69b91a3a2e adjust size of strncpy and time limit 2020-09-17 11:16:22 -06:00
Jacob Barthelmeh f8b092c5b4 add example timeout to sftp example 2020-09-17 10:43:38 -06:00
JacobBarthelmeh c4578da7a2
Merge pull request #282 from ejohnstown/optional-build
Optional Builds
2020-09-08 15:15:22 -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 487bcef2cc
Fix Memory
1. A couple places weren't passing the correct heap pointer to free.
   Normally this was ignored in the build because the WMALLOC macro left
   them out. Found using wolfCrypt memory logging.
2. Replaced the call to strdup() with wstrdup() that takes a heap and
   type parameter so sit may allocate a buffer with WMALLOC() and be
   freed correctly by WFREE().
3. Tweaked the client to use a preallocated buffer for the private key
   rather than letting ReadKey allocate one. (Another WFREE() heap/type
   issue.)
2020-09-02 12:11:24 -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 04511bafa6 add guard on file system use in example client 2020-08-26 10:38:36 -06:00
Jacob Barthelmeh 9a8b9e72c9 adjust check for :/ and check on compare of file name 2020-08-26 10:22:56 -06:00
Jacob Barthelmeh 44d18953ed allow scp to '/' and increase file buffer in example server 2020-08-26 10:22:56 -06:00
Jacob Barthelmeh 1a7a80544d make shutdown error message unique to client used 2020-08-26 10:22:56 -06:00
Jacob Barthelmeh 217a7d6520 add callback and example for no file system with SCP 2020-08-26 10:22:56 -06:00