Commit Graph

1411 Commits (5267f6cc4b1168cacb55a4a9f68afb21dc14f492)

Author SHA1 Message Date
John Safranek 5267f6cc4b
Type Fix
When building wolfSSH with g++, it was complaining about type issues
with respect to the type enum wc_HashType. It was getting turned into a
byte and then back to an enum wc_HashType implicitly. It should never
have been a byte in the middle.
2022-12-22 14:30:36 -08:00
JacobBarthelmeh 1a3652bbad
Merge pull request #480 from ejohnstown/sftp-big-file
SFTP Large File Fix
2022-12-22 13:54:02 -07:00
John Safranek bef7f758cc
SFTP Large File Fix
1. There were a couple spots during a large file transfer where the
   client rekeying the session would interrupt the transfer and/or
   reset the amount of file data transfered. Fixed that with a check
   for WS_CHAN_RXD.
2. Added a build option to interrupt a file transfer after 2 minutes.
   Large files will take longer.
2022-12-22 09:52:18 -08:00
JacobBarthelmeh b211634680
Merge pull request #479 from ejohnstown/release
Updates for new release v1.4.12
2022-12-21 12:06:52 -07:00
John Safranek 124a6cc32d Updates for new release. 2022-12-20 14:33:53 -08:00
John Safranek c40f77914f
Merge pull request #477 from JacobBarthelmeh/sftp 2022-12-19 15:50:36 -08:00
JacobBarthelmeh 3e64f13b36 fix for x509 connections 2022-12-19 16:37:40 -07:00
JacobBarthelmeh 055f52ca5a add cert use to sftp client 2022-12-19 16:37:40 -07:00
JacobBarthelmeh 29d59ac1f9 add debug print out for checking IP address of peer 2022-12-19 16:37:40 -07:00
JacobBarthelmeh e47dca36f3 add HAVE_PTHRED define for including correct WOLFSSL_THREAD 2022-12-19 16:37:25 -07:00
JacobBarthelmeh bdf171306c
Merge pull request #476 from ejohnstown/ecdsa-sign
ECDSA Signing Guards
2022-11-23 15:59:01 -07:00
John Safranek 786257d0b9
ECDSA Signing Guards
1. Add guards around uses of algorithm names strings that shouldn't be
   included if the algo is disabled.
2. Add a little more context to the error strings in the cert versions
   of the signing functions.
2022-11-21 12:03:27 -08:00
JacobBarthelmeh b856afdace
Merge pull request #475 from ejohnstown/no-mp
Remove Public Math
2022-11-18 16:38:40 -07:00
John Safranek 36760ba0ee
Remove Public Math
1. Refactoring to remove the need for mp_int types and any of the math
   functions from wolfCrypt. wolfCrypt provides APIs for generating and
   verifying signatures and for checking keys, use them.
2. Add const to the pointers to the buffer in the Get functions used to
   parse the data stream.
3. Named the parameters for the Get functions when adding const to the
   prototypes in the header.
2022-11-17 08:31:03 -08:00
John Safranek c9b2a21214
Merge pull request #468 from JacobBarthelmeh/sftp 2022-11-15 16:05:07 -08:00
JacobBarthelmeh 77acddc7a6
Merge pull request #474 from ejohnstown/thread-test
Test Threading
2022-11-15 13:29:07 -07:00
John Safranek be8c52d2fa
Change name of guard around WABORT() 2022-11-04 13:53:03 -07:00
Hayden Roche 8c4c561dfb
Merge pull request #473 from ejohnstown/sftp-size 2022-11-03 14:07:58 -07:00
John Safranek 621bd3418e
Update Test Case
The test for wolfSSH_SFTP_SendReadPacket() expects to receive the
requested amount of data in response. The only guarantee is that up to
the requested amount of data is returned. Change the test so it checks
the return code is greater than 0, and less-than-equal-to the requested
amount.
2022-11-03 13:52:17 -07:00
John Safranek e038a482ef
wolfSFTP Size Check
1. Add some comments describing the constants WOLFSSH_MAX_SFTP_RW and
   WOLFSSH_MAX_SFTP_RECV.
2. When the server processor receives a request for file data during a
   file transfer, limit the amount of data sent to the client by the
   value WOLFSSH_MAX_SFTP_RW.
2022-11-02 17:06:08 -07:00
John Safranek f75a60909a
Echoserver Driver
1. More tweaks for the threading guards.
2. Move a local declaration whose scope changed.
2022-11-01 15:26:22 -07:00
John Safranek e5a1c38d86
Echoserver Driver
1. Leave out the setup of the tcp_ready record when not using threading.
2. Don't change the echoserver directory when building for Integrity.
3. Change WEXIT to be a return(0) when building for Integrity.
4. The echoserver shouldn't call exit directly, it should save the
   return_code server args and then return to the caller.
5. When using forwarding, don't exit if the address is IPv6, return an
   error.
6. When exiting, close the listen file descriptor.
7. Reset myoptind to 0 before processing the options list.
2022-10-31 14:44:57 -07:00
John Safranek f0270d8920
Echoserver Driver
1. For Integrity builds, err_sys should only printf.
2. For Integrity builds, WEXIT should be a return.
3. In the echoserver, add explicit WEXITs for the err_sys statements.
2022-10-28 10:42:43 -07:00
John Safranek f25e5465e1
Echoserver Driver
1. Moved the contents of main to a new function, wolfSSH_Echoserver().
2. main just calls the wolfSSH_Echoserver().
2022-10-27 11:26:04 -07:00
John Safranek a3ab8fb7ef
Single Threaded Tests
1. Regroup some of the test code inside the guards to disable it.
2. Remove the SFTP testing if single threaded is enabled.
3. Disable the testsuite if single threded is enabled.
2022-10-25 18:00:23 -07:00
John Safranek d0c295c924
Assert Consistency
1. Make whitespace in asserts consistent.
2. Make asserts consistent with wolfSSL's.
3. Added the pointer asserts.
4. Wrapper around abort() to disable it.
2022-10-25 17:12:07 -07:00
John Safranek c4b2af1a79
Test Threading
1. Whitespace.
2. Rename the Threading case for "else" to "elif
   defined(USE_WINDOWS_API)" and added a new else case.
2022-10-25 17:12:03 -07:00
Hayden Roche 15c0fd5d18
Merge pull request #472 from ejohnstown/test-tools 2022-10-25 10:15:42 -07:00
John Safranek 6ce7e14cda
Test Tools
1. Remove the flag NO_MAIN_FUNCTION from the test tools.
2. For unit and api tests, follow the patter for the testsuite with its
   NO_TESTSUITE_MAIN_DRIVER check.
2022-10-25 09:03:19 -07:00
Hayden Roche c88fa45d3d
Merge pull request #471 from ejohnstown/thread-dedup 2022-10-24 15:04:10 -07:00
John Safranek c580b2c3ba
Module Static Global
1. Move ConvertHexToBin() and Base16_Decode() into test.h.
2. Add a description for the options in test.h.
3. Add a static to the hexDecode const array for Base16_Decode().
4. Add the check for options.h/user_settings.h to api and unit tests.
2022-10-24 11:32:40 -07:00
John Safranek f88c3d6d3a
Dead Code Removal
1. In the echoserver's user authentication function, the summary check was
   refactored and the old code wasn't removed. A more strict compiler
   noticed the code was never executed.
2. Moved the ret check variable to the section of the function where it
   is used.
2022-10-21 15:54:34 -07:00
John Safranek 1fa4134304
Threading Deduplication
1. Move the test threading types and macros to the conditional threading
   section of test.h and make them conditional on wolfSSL v5.5.1.
2. Alias WOLFSSL_THREAD as WOLFSSH_THREAD.
3. Update the THREAD_FUNC typdef to look more like a function pointer.
4. Add the user_settings.h/options.h include that is missing from
   examples.
2022-10-21 15:17:19 -07:00
John Safranek d8e3288dd6
Merge pull request #465 from JacobBarthelmeh/Certs
renew cert script, add check for user name in UPN and host IP in alt. names
2022-10-21 09:43:58 -07:00
Hayden Roche d45cf49fc3
Merge pull request #470 from ejohnstown/integ-rename 2022-10-20 15:10:47 -07:00
John Safranek 2cbbdfb798
Fixing name conflicts with the RTOS Integrity
1. Rename the type struct Buffer as struct WOLFSSH_BUFFER.
2. Rename the function Receive() as ReceiveData().
3. Fix unused variable value.
4. Rename the I/O callback functions LastError() as wsErrno() and
   TranslateReturnCode() as wsReturnCode(). LastError was conflicting
   with something, and TRC was just long.
5. The logFunction callback pointer isn't used in non-debug builds, and
   the compiler reported as such. Reference the variable to hush the
   warning.
2022-10-20 14:53:01 -07:00
Hayden Roche fd15c2d1c5
Merge pull request #469 from ejohnstown/am-ref 2022-10-20 14:23:43 -07:00
John Safranek 1bfb5c394b
Automake Refactor
1. Rename TestsuiteTest() with wolfSSH prefix.
2. Add wolfSSH_TestsuiteTest to the testsuite.h header file.
3. Add check so main function to the testsuite can be left out of the build
   with the flag NO_MAIN_FUNCTION.
2022-10-20 12:20:08 -07:00
John Safranek df4576558f
Automake Refactor
1. Rename test_SFTP() with wolfSSH prefix.
2. Add header file for the sftp.c file.
2022-10-20 12:19:34 -07:00
John Safranek 59b9dc6b5c
Automake Refactor
1. Rename ApiTest() and UnitTest() with wolfSSH prefix.
2. Modify wolfSSH_ApiTest() and wolfSSH_UnitTest() to take argc and argv
   parameters.
3. Add main functions to the unit and api tests, that can be left out of
   the build with the flag NO_MAIN_FUNCTION.
2022-10-20 11:48:17 -07:00
John Safranek a7c7830dcd
Automake Refactor
1. Remove the DISTCLEANFILES variables from automake scripts. The items
   they clean are already cleaned appropriately.
2. For application targets, move the local headers to the SOURCES lists
   for the apps.
2022-10-20 11:35:59 -07:00
JacobBarthelmeh 49256a2e40 update comment 2022-10-19 13:31:06 -07:00
JacobBarthelmeh 0f9304d70d update client macro guard and add small stack dcert 2022-10-19 12:52:59 -07:00
JacobBarthelmeh a611ebd26e
Merge pull request #467 from ejohnstown/multikey
Multiple Server Keys
2022-10-18 10:51:36 -06:00
John Safranek 19eaf98ae9
Multiple Server Keys
1. Fixing comments from review.
2. Use IdentifyKey in the function wolfSSH_ReadKey_buffer.
3. Modify BuildNameList to make a proper string and possibly return an
   error code.
2022-10-18 09:07:21 -07:00
JacobBarthelmeh 2a4d73df61 adjustment for handling '/./' case 2022-10-11 16:36:41 -07:00
John Safranek 7e99fb3aae
API Test Fix
The echoserver will check the return on the shutdown function for
success and socket error. Socket error is for the peer already having
shut down their socket. This is mapped back to success so it shuts down
cleanly. Add this behavior to the API test client in the test for SFTP
recv read command test.
2022-10-10 10:50:50 -07:00
Jacob Barthelmeh 9e3c2f3b78 check on user name in UPN if exists
add check on host IP address in certificate alt names
2022-10-10 08:29:50 -07:00
Jacob Barthelmeh c11c7e3bbd rename user cert and add renew script 2022-10-10 08:29:09 -07:00
John Safranek e983ae0ad9
Multiple Server Keys
1. Allow user to add multiple server keys to the CTX up to a limit.
2. Clear the list of server's keys when releasing the CTX.
3. Update the API test case.
4. Server key algo list based on keys loaded.
5. Server uses key requested by client.
6. Change echoserver to load ECC and RSA key, -E option to select order.
7. Added a function to identify keys, and another to identify certs.
8. Added a function to add keys or certs to the list of keys and certs.
9. Fix return value for MAC Algo C2S match fail to the correct value.
2022-10-07 15:35:35 -07:00