Commit Graph

1269 Commits (e1f72a00e19e237851ed5167bb84b4408adfde3c)

Author SHA1 Message Date
John Safranek ddd15cb077
Merge pull request #369 from JacobBarthelmeh/sftp 2021-10-26 09:07:21 -07:00
John Safranek 0402caa05c
Moved the calculation for a size into an if-clause where the pointer derefenced is known-good. 2021-10-11 14:06:33 -07:00
Jacob Barthelmeh eda158731d sftp fix for getting attribute header 2021-10-08 10:45:45 -06:00
JacobBarthelmeh cde04a5819
Merge pull request #368 from ejohnstown/fixes
Fixes
2021-10-08 05:43:26 +07: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
David Garske 5dca5f1721
Merge pull request #367 from ejohnstown/readme
Update readme.
2021-10-07 11:37:20 -07:00
John Safranek 513313e65e
Update readme. 2021-10-07 11:19:01 -07:00
David Garske a80d60f446
Merge pull request #343 from ejohnstown/fwd-redux
Port Forwarding Update
2021-10-07 09:51:48 -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 4435ed40fa
Move function CreateMpint() to internal.c. 2021-09-27 10:49:21 -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 73fe699f30
Static Analysis Test Report Fixes
1. For DoChannelExtendedData(), removed the switch on the extended data
   value type. It can only be one value, and it is checked when read from
   the message. Checking it again in the switch statement leaves dead code.
   (47)
2. In PreparePacket(), fix a possible dereference of NULL when checking
   the outputBuffer length. (68)
3. Change the utility function CreateMpint() to return an error.
   (69, 70, 71)
4. DoChannelOpenForward() updates idx in the error case, even if idx is
   is NULL, don't bother updating it. (72)
5. In GenerateKeys(), if ssh is NULL, it might still check to see if its
   aeadMode is set. Check the aeadMode only if everything is still OK.
   (73)
6. In BundlePacket(), aeadMode was getting checked when ssh was NULL.
   Check it if everything is still OK. (74)
7. PurgePacket() should check that the ssh passed to it isn't NULL.
   (78, 79, 81)
8. Replumbed BuildUserAuthRequestRsa() to protect against trying to use
   an signed error code as an unsigned value. (113)
9. In GenerateKey(), check that the returned digest size isn't 0 or a
   negative error value. (130, 132)
10. In DoUserAuthReqEcc(), check the ssh pointer before dereferencing it
   to get the key size for allocating the small stack key values. (252)
11. In DoUserAuthReqRsa(), check the ssh pointer before dereferencing it
   to get the key size for allocating the small stack key values. (253)
12. In DoChannelRequest(), initialize the arrays for the read name and
   value to a NULL string. It should log as blank for an error. (440)
13. In SendUserAuthRequest(), initialize the keySigId to ID_NONE. Later
   in CleanupUserAuthRequestPublicKey(), explicitly check the keySigId
   value for one of the four types: RSA or ECDSA. (442)
14. In SendKexDhReply(), changed the union's type field from isRsa to
   pubKeyId, and explicitly checked against RSA or ECDSA. (444, 445, 446)
15. DoReceive() had a for(;;) loop but no control commands internally.
   Removed the loop as redundant. (451)
2021-09-27 08:06:54 -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
John Safranek 9c00b680d0
Merge pull request #361 from JacobBarthelmeh/auth
make loading user created keys into the examples easier
2021-09-02 14:29:31 -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 359eb212f9
Merge pull request #357 from JacobBarthelmeh/testing
fix for typo and reduce stack size
2021-08-23 14:31:48 -07:00
David Garske 4fd2b36eb0
Merge pull request #360 from ejohnstown/asan
ASAN SFTP Fixes
2021-08-18 16:23:03 -07:00
John Safranek edb272e35e
ASAN SFTP Fixes
When decoding SFTP messages, fix the size checks so they don't wrap. (ZD12766)
2021-08-18 14:20:08 -07:00
David Garske 5ceaf641ff
Merge pull request #355 from JacobBarthelmeh/auth
fix for RSA public key auth
2021-08-04 06:40:43 -07:00
Jacob Barthelmeh a3b5958106 update README's with helpful links, including one to the wolfSSH manual 2021-08-03 21:03:26 +07:00
Jacob Barthelmeh 094eff8933 reduce stack size of wolfSSH_ReadKey_buffer with smallstack 2021-08-03 20:39:19 +07:00
Jacob Barthelmeh 0070028072 fix for WOLFSSL_API typo and include with MQX 2021-08-03 19:57:55 +07:00
John Safranek 21f54b0599 Clean up some awkward debug logging with respect to userauth. 2021-08-02 23:41:27 +07:00
JacobBarthelmeh 032457aef6
Merge pull request #354 from ejohnstown/ver
version.h
2021-08-02 17:09:22 +07:00
Jacob Barthelmeh 5555aa05f2 fix for RSA public key auth 2021-08-02 16:58:18 +07:00
John Safranek 71f856a0a8
version.h wasn't added to the repo on the last release 2021-07-29 12:40:17 -07:00
JacobBarthelmeh 27bff63004
Merge pull request #350 from ejohnstown/actions
Actions
2021-07-26 11:27:19 +07:00
John Safranek 48a0e667a4
Merge pull request #353 from JacobBarthelmeh/release
Release version 1.4.7
2021-07-23 09:40:05 -07:00
Jacob Barthelmeh 056bd8a87c prepare for release v1.4.7 2021-07-23 15:39:29 +07:00
Jacob Barthelmeh a353cae4d8 initialize hash type 2021-07-23 14:29:43 +07:00
JacobBarthelmeh 40079edb57
Merge pull request #351 from ejohnstown/fixes
Fix for NO_FILESYSTEM and WOLFSSH_NO_AES_GCM and !HAVE_ECC
2021-07-23 13:50:02 +07:00
JacobBarthelmeh a133043d35
Merge pull request #352 from ejohnstown/fix-fuzz
Fuzzing Fixes
2021-07-21 15:51:40 +07:00
John Safranek 064cfce0d9
Fuzzing Fixes
1. Fixed a leak.
2. Fixed a branch on uninitialized.
(ZD 12640 and 12642)
2021-07-20 16:23:15 -07:00
John Safranek 326ae8725b
More disable flag fixes for ECDHE. 2021-07-20 11:38:55 -07:00
Eric Blankenhorn ccc590c3ae Fix from review 2021-07-20 11:22:06 -07:00
Eric Blankenhorn d02e6003f9 Fix for not HAVE_ECC 2021-07-20 11:22:06 -07:00
Eric Blankenhorn 5931aefff5 Fix for NO_FILESYSTEM and WOLFSSH_NO_AES_GCM 2021-07-20 11:22:04 -07:00
John Safranek e1f07a346a
Actions
1. Add build action for Ubuntu.
2. Add build action for macOS.
2021-07-20 11:05:04 -07:00
JacobBarthelmeh 784567eed3
Merge pull request #349 from ejohnstown/dh-sz-fix
DH Size Fix
2021-07-16 12:49:41 +07:00
John Safranek d64c0c309a
DH Size Fix
When creating the handshake info, initialize the size of the e and x values to their sizes.
2021-07-15 10:00:02 -07:00