Commit Graph

114 Commits (master)

Author SHA1 Message Date
Andrew Hutchings e0a1bdd9c4
Merge pull request #804 from ejohnstown/vvv
Soft Disable AES-CBC
2025-05-17 15:53:55 +01:00
John Safranek 0f650789de Soft Disable AES-CBC
1. By default, soft disable AES-CBC. It isn't offered as a default
   encrypt algorithm, but may be set at runtime.
2. Add guard where AES-CBC can be added back as a default.
3. Add option to example client to run it with a custom encrypt
   algorithm list.
4. In the client, add macro to add items to the arg lists while checking
   the number of items in the list.
2025-05-16 11:41:52 -05:00
Andrew Hutchings 3e4d9c0b95 Keyboard Interactive bug fixes
* `keyboardAuthCb` was not initalized correctly, meaning we could
  enable the mode without callback.
* `SendUserAuthKeyboardRequest` didn't check `keyboardAuthCb` for
  `NULL`.
* `DoUserAuthInfoResponse` left `authData` partially uninitialized.
* `DoUserAuthInfoResponse` new checks that KB auth is in progress.
2025-05-06 10:06:22 +01:00
Andrew Hutchings c368efb8b2 Make Keyboard Interactive a compile time option
Now an off-by-default compile-time option. This saves resources and
confusion if you are not expecting it.

ZD #19704
2025-04-22 13:12:42 +01:00
Andrew Hutchings f73a76e064 Add DH Group 16 and HMAC-SHA2-512
This adds the `diffie-hellman-group16-sha512` key exchange and
`hmac-sha2-512` mac support.

Echoserver can now take `-x` for key exchange and `-m` for mac setting,
 and `-c` for cipher so that this can be used in the test suite.
2025-02-12 07:06:51 +00:00
Andrew Hutchings a4733ecd95 RFC-4256 Keyboard-Interactive authentication
This implements Keyboard-Interactive authentication.

Adds an additional callback set by `wolfSSH_KeyboarAuthPrompts()` which
will set a callback in the server to ask the application to provide the
prompt details for the client.
2025-02-11 14:19:52 +00:00
John Safranek 1a6225671b Release v1.4.18: Release Testing Fixes (Windows)
1. For the ASCII and Wide versions of types and functions, make sure
   the wolfSSHd is being consistent using them.
2. In SFTP, use WSOCKETCLOSE to close the socket. Use the correct type
   for the socket.
3. Add parens around part of a ternary operator check to clear up some
   ambiguous order of operations.
4. Add a variable initializer for a COORD structure.
5. Add parameter checks to the Base16_Decode function.
6. Fix a double-freed handle.
7. Clean up a bunch of build warnings.
2024-07-19 12:03:32 -07:00
Eric Blankenhorn 0719578e29 Fix testsuite with singlethreaded 2024-07-01 09:12:36 -05:00
John Safranek c1e5af49dc Echoserver Refresh
1. Add the code from wolfsshd that initially sets up the terminal
   settings to the echoserver.
2. Add the WOLFSSH_TERM flag to the build of the echoserver.
2024-06-20 15:38:37 -07:00
Anthony Hu 1697d603c0 Changes inspired by ejohnstown comments. 2024-06-03 14:40:52 -04:00
Anthony Hu 499a742097 improvements for ipv6 2024-05-31 17:32:20 -04:00
John Safranek 1736a4cabf
Update Copyright Date
1. Bring all copyright dates up to 2024.
2. Fix a few files with incorrect licensing.
2024-03-22 12:17:09 -07:00
John Safranek 8c28f7a3a5
Update Pragma Macro Use
1. The wrapper for the pragma PRAGMA_GCC_DIAG_PUSH and its friends are
   not set up to be used like a function. Remove the semicolons after
   their usage. (Clang doesn't care, but MSVC does.)
2024-03-01 16:02:30 -08:00
John Safranek 6dd53b12ec
KEX Cipher Lists
1. Add API test.
2024-03-01 15:42:40 -08:00
John Safranek 672d36e245 KEX Cipher Lists
1. Add APIs for setting the algorithm lists used in the KEX initization
   messages.
2. Add API to check if a specified algorithm name is available.
3. Add APIs to list available algorithms.
4. Add algorithm lists to the WOLFSSH_CTX and WOLFSSH structures.
5. Added a local function to fetch algorithm strings based on their type and
   an index.
6. Added starter tests for the algorithm functions.
7. Move the canned algorithm list strings before CtxInit() so they may be
   used for default lists in the WOLFSSH_CTX.
8. Carry over the algorithm name lists from WOLFSSH_CTX to WOLFSSH.
9. Remove dead code.
10. Add parameter names to a few function prototypes.
2024-02-29 13:18:49 -08:00
John Safranek 815d22f729
Merge pull request #650 from miyazakh/no_rsa
fix WOLFSSH_NO_RSA
2024-01-31 13:20:53 -08:00
JacobBarthelmeh 7156ac81e0 adjust test socket close down and pull of zephyr sdk 2024-01-29 14:55:09 -07:00
Hideki Miyazaki b256522f5b
fix WOLFSSH_NO_RSA 2024-01-27 13:03:10 +09:00
JacobBarthelmeh 9b5c54cd7f account for small highwater mark test case 2024-01-19 09:18:41 -07:00
John Safranek 27275b76f3
SFTP Test File
Modify the SFTP tests to use the file configure.ac instead of configure.
Some environments do not have or use configure. Configure.ac is in the
source archive.
2024-01-03 14:50:55 -08:00
John Safranek ec1248f14d
SFTP Test Maintenance
1. Modified SignalTcpReady() to test.h. Matched its prototype to the
   other functions for TcpReady.
2. Add a timeout in WaitTcpReady() specifically for Zephyr builds.
3. Misc few cleanups.
2024-01-03 13:24:10 -08:00
John Safranek 16708d2bb0
SFTP Test Maintenance
1. In wolfSSH_SftpTest(), move the -p parameter inside the guard with
   the port number it belongs to.
2. In wolfSSH_SftpTest(), free the conditional variable and mutex.
2024-01-02 14:01:59 -08:00
John Safranek dba9a6c36c
PR Review
1. Add test keys.
2. Add API test for wolfSSH_ReadKey_buffer().
3. Fix allocation issue found using the API test.
2023-11-06 15:16:39 -08:00
Juliusz Sosinowicz 37412ff50f Init zephyr support
- SSH
- SFTP
- SCP
2023-10-02 20:38:21 +02:00
JacobBarthelmeh 5780570880 limit additional nonblocking test 2023-09-29 16:12:21 -07:00
JacobBarthelmeh cb6088e339 check if rekeying in test 2023-09-29 15:14:27 -07:00
JacobBarthelmeh bbc9f9e157 add more test debug prints and better rekeying handling 2023-09-29 15:05:39 -07:00
John Safranek 826a045bf4 RFC 8332
1. Add server auth support for RSA signing with SHA2-256 and SHA2-512.
2023-06-01 16:10:45 -07:00
John Safranek d00db44b2f
SFTP Update
1. In the API test for SFTP, change the amount of the file requested to
   the limit WOLFSSH_MAX_SFTP_RW.
2. The check for want read on the exit of the server worker should clear
   ret if it is want read.
2023-04-19 13:39:35 -07:00
JacobBarthelmeh a9224993fd refactor client apps and add X509 to scpclient 2023-04-04 14:59:46 -07:00
John Safranek 95bcc4541c
Release v1.4.13
1. Update the copyright year in all file header comments.
2. Update the STM32CUBE files to use the correct GPL headers.
2023-04-03 10:41:10 -07:00
John Safranek c59226c36b
Build Cleanup
1. Found a few cases where disabling RSA made some things either not
   build or run correctly.
2. Hushed a few unused variables in gated-disabled situations.
3. Moved a temp variable closer to where it is used.
2023-02-03 17:18:26 -08:00
JacobBarthelmeh 3135bf87b6 add test for ls -s with sftp 2023-01-17 15:12:37 -08:00
John Safranek 99bab74d78
Release Cleanup
1. Update the release date in the ChangeLog.
2. Move some compiler guards around to hush warnings depending on the
   build options.
3. Fix a string name for ECDSA P521 algo.
4. Fix a stray static function definition.
5. For FIPSv5 builds, add CAST tests to the API test and testsuite.
6. Add the wolfSSH_Init() and wolfSSH_Cleanup() to the unit test.
2022-12-27 16:19:21 -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
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 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 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
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 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
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
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
John Safranek fe2d68619c
SFTP List
More Updates from peer review comments.
2022-09-23 16:25:51 -07:00
John Safranek b816ac5fe8
SFTP List
Updated from peer review comments.
2022-09-20 11:53:56 -07:00
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