Commit Graph

93 Commits (2425f7c5945df94320091da343b0ed9ee1533a5e)

Author SHA1 Message Date
Yosuke Shimizu 2425f7c594 Bound OSC index before reads in wolfSSH_DoOSC 2026-06-18 11:00:42 -07:00
Yosuke Shimizu 1efd64743c wolfssh/scp: complete rekey that starts mid-transfer 2026-06-16 15:56:50 -07:00
Yosuke Shimizu cb9bb7a2a7 Fix SFTP client states dropping unsent bytes after partial channel send 2026-06-16 11:21:19 -07:00
David Garske ba09b582ba
Merge pull request #1007 from ejohnstown/hex2octal
Convert file permission hex constants to octal
2026-06-09 14:22:34 -07:00
Yosuke Shimizu d49b15f51a SFTP path confinement and status-reply refactor 2026-06-09 10:46:17 -07:00
John Safranek 3abdc22355 Convert file permission hex constants to octal
- Replace hex literals (0x1ED, 0x124, 0x4000, etc.) with octal
  equivalents (0755, 0444, 040000) in SCP/SFTP attribute handling
2026-06-08 10:39:48 -07:00
Yosuke Shimizu 5a19e449c6 Add upper limit of max window size and packet size, Add unit tests 2026-06-08 08:53:53 -07:00
Yosuke Shimizu aa04eca815 Fix SFTP rekey transparency in buffer_read and buffer_send 2026-06-04 14:36:20 -07:00
John Safranek 63a63cf0fb CERTMAN_VerifyCerts_buffer: reject certsCount=0
- Without the guard, inner loops short-circuit and WS_SUCCESS
  is returned without any verification.
- Add test case covering the new and existing bad-arg paths.

Issue: F-409
2026-05-21 11:42:43 -07:00
Yosuke Shimizu 7d7d04dc70 Fix minor issues and Add unit test for wrong padded OpenSSH key 2026-05-12 13:14:56 -07:00
John Safranek 3a5aa65369 Small Test Reorganization
1. Collect all the test function wrappers in internal.c to one location
   at the end of the file.
2. Update API test to check other algos if RSA or ECDSA are disabled.
3. Added guarded tests TestClientBuffersIdempotent() for WOLFSSH_NO_RSA
   and WOLFSSH_NO_ECDSA_SHA2_NISTP256. If both are set, the test is
   skipped.
2026-04-24 09:43:56 -07:00
John Safranek aad92b54ea Fix warning for unchecked errno in api.c test
Replace rewind() with fseek(f, 0, SEEK_SET) in the test helper
function. rewind() internally clears errno, which scan-build flags
as overwriting a previously unchecked errno value. fseek() to
offset 0 is functionally equivalent without the implicit errno
reset.
2026-04-22 10:27:06 -07:00
John Safranek afedde7a1d Fix Potential Double Free
Static analysis indicated the potential to double-free a pointer in the
`wolfSSH_CTX_UseCert_buffer()` test. Loading the second cert after
freeing the first cert could fail and the test cleanup would free the
pointer again. Just set pointer to null after freeing.
2026-04-22 10:27:06 -07:00
Yosuke Shimizu b007310fa2 Fix wolfSSH_RealPath tests 2026-04-21 16:01:41 -07:00
Yosuke Shimizu 9e3eee1276 Fix existing tests 2026-04-15 11:04:09 +09:00
Eric Blankenhorn 0bb1d1b5b7 Add test case test_wolfSSH_CTX_UsePrivateKey_buffer_pem 2026-04-06 16:13:41 -05:00
aidan garske 09144d0c7a Add more wolfSSH CI workflows 2026-03-03 21:22:39 -08:00
John Safranek 8951bd9209 Release v1.4.22
1. Update copyright date to 2026.
2025-12-29 16:53:33 -08:00
Andrew Hutchings 190dda3aa9 Fix agent test setup
Instantiate a wolfSSH_AGENT_CTX before invoking wolfSSH_AGENT_SignRequest so the regression tests exercise the intended paths instead of failing with WS_AGENT_NULL_E.
2025-10-22 15:31:46 +01:00
Andrew Hutchings 662247394f Add agent sign request regression tests
Exercise agent write failures, non-signature responses, oversized signatures, and the happy path to cover the recent wolfSSH_AGENT_SignRequest hardening.
2025-10-22 15:10:58 +01:00
JacobBarthelmeh cc17941a61 adjust test case to account for re-keying return 2025-09-16 14:16:16 -06:00
JacobBarthelmeh 2a11471bb7 refactor introducing more use of NoticeError 2025-09-16 13:30:25 -06:00
John Safranek 903bbc7fb2 Coverity: Argument cannot be negative
1. Due to not checking the result of fseek(), it is possible to try to
   malloc() -1 bytes of storage. Checking the return from fseek() and
   erring if negative.
2. Changing the check between the result of fseek() and fread() to match
   signedness. Adding some casting, as at that point the fseek() result
   is always positive.

Fixes CIDs:
  573009 572928 572868
2025-07-21 09:36:35 -07:00
John Safranek 538ae15310 Coverity: Resource leak
1. Fix some resource leaks during error conditions where a socket or a
   file descriptor doesn't get closed in all error cases.
2. In wolfSSH_SFTP_RecvOpen(), initialize the file descriptor.
3. For 572902, the error case resource leaks are fixed. There's still an
   issue to resolve for storing the FD for use later.

Fixes CIDs:
  572856 572902* 573012 573019 573021 573076
2025-07-11 14:06:46 -07:00
John Safranek 92cfb2e052 Coverity: Side effect in assertion
1. Modify AssertNotNull() to use the same pattern as AssertNull(). The
   macro assigns the pointer to a local variable and that is checked.

Fixes CIDs:
  537020 573008 573010 573011 573013 573014 573015
  573016 573017 573018 573022 573023 573024
2025-07-11 14:06:43 -07: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 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
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 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 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
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
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
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