Commit Graph

169 Commits (90c0ee6a7cdec2c44708cbc224b972ac012f2d9e)

Author SHA1 Message Date
Yosuke Shimizu cd7a7f47c3 Fix DoChannelRequest and Add unit test for DoChannelRequest 2026-04-21 16:18:24 -07:00
Yosuke Shimizu b007310fa2 Fix wolfSSH_RealPath tests 2026-04-21 16:01:41 -07:00
John Safranek 6d09901166
Merge pull request #924 from yosuke-wolfssl/f_2485
Add kex integration test for ed25519 server key
2026-04-21 11:14:26 -07:00
John Safranek a608f1944f
Merge pull request #923 from yosuke-wolfssl/f_2484
Add additional regress test for DoKexDhReply
2026-04-21 09:46:43 -07:00
Yosuke Shimizu fe89681f9b Add unit test for DoUserAuthBanner 2026-04-20 17:05:05 +09:00
JacobBarthelmeh f4b7786b0b
Merge pull request #922 from ejohnstown/check-dhgroup
Validate server's group
2026-04-16 14:56:30 -06:00
John Safranek 16ddcd9764 Validate server's group
The client wasn't validating the DH group parameters in the KEX DH GEX
Group message. This adds a function to perform the validation of the
prime `p` to verify it is safe. (Prime and that ((p - 1) / 2) is
prime.) Also adds a test to a known unsafe prime and known safe prime
to verify the validate function.

Affected function: DoKexDhGexGroup.
Issue: F-1688
2026-04-16 13:42:24 -07:00
Yosuke Shimizu 651e4cae8a Add kex integration test for ed25519 server key 2026-04-16 15:14:42 +09:00
Yosuke Shimizu fd82a4bcf5 Fix DoGlobalRequestFwd and Add the regress tests 2026-04-16 13:11:29 +09:00
Yosuke Shimizu 7beec434db Add regress test for DoKexDhReply 2026-04-16 10:10:50 +09:00
JacobBarthelmeh cdd6df0c38
Merge pull request #919 from yosuke-wolfssl/f_2871
Fix DoChannelOpen() and Add the regress test
2026-04-15 15:33:01 -06:00
Yosuke Shimizu 0317c40fc1 Fix DoChannelOpen() and Add regress test 2026-04-15 13:52:23 +09:00
Yosuke Shimizu 9e3eee1276 Fix existing tests 2026-04-15 11:04:09 +09:00
Yosuke Shimizu 367dd5a8f2 Add regress test for DoKexDhReply 2026-04-15 10:44:29 +09:00
David Garske 9c8b4e8a2c
Merge pull request #913 from yosuke-wolfssl/f_2483
Add an integration test where a client authenticates using public key
2026-04-14 09:13:55 -07:00
Yosuke Shimizu aa4c9ff9a0 Add unit test for VerifyMac 2026-04-14 09:23:14 +09:00
Yosuke Shimizu 22f9ef8ddb Add an integration test where a client authenticates using public key 2026-04-14 09:16:21 +09:00
John Safranek b71670f797
Merge pull request #909 from padelsbach/lls-lcd-commands
Add lcd and lls commands
2026-04-13 14:54:15 -07:00
David Garske eb49029a7f
Merge pull request #910 from yosuke-wolfssl/f_2072
Fix SendUserAuthKeyboardResponse() and add regress tests
2026-04-13 10:38:57 -07:00
David Garske aaf3e5574e
Merge pull request #908 from LinuxJedi/f-fixes
Static code analysis fixes
2026-04-10 14:33:06 -07:00
Paul Adelsbach 453371f953 Add lcd and lls commands 2026-04-10 12:51:58 -07:00
John Safranek 5272cc4603
Merge pull request #911 from padelsbach/sftp-command-underflow
Sftp command underflow
2026-04-10 09:13:18 -07:00
Yosuke Shimizu 6d81c9da1e Fix SendUserAuthKeyboardResponse and add regress test 2026-04-10 10:29:11 +09:00
Paul Adelsbach 94b82715a4 Cleanup sftp test artifacts at start of test 2026-04-09 14:41:19 -07:00
Paul Adelsbach d854f03570 Move sftp test cases into a table for stronger linkage to expected behavior 2026-04-09 12:06:16 -07:00
Paul Adelsbach e74fd71473 Fix underflow in sftp example with empty args 2026-04-09 11:54:58 -07:00
Andrew Hutchings 64de7a210f Fix gating 2026-04-08 14:57:29 +01:00
Andrew Hutchings d4a6cf80f9 Add more tests 2026-04-08 14:42:30 +01:00
Andrew Hutchings 0c5d8d31ae Fix type mismatch and harness bug 2026-04-08 14:04:44 +01:00
Andrew Hutchings a6861d993a Validate the host key signature algorithm name in DoKexDhReply().
The client-side KEXDH_REPLY path was parsing the signature blob name and
skipping over it without checking that it matched the negotiated host key
algorithm. That allowed an RSA server to negotiate rsa-sha2-256 or
rsa-sha2-512 but send a signature blob labeled ssh-rsa instead.

Fix this by comparing the signature blob name against the expected
signature type derived from handshake->pubKeyId before verifying the
signature bytes.

Add regress coverage that drives an in-memory client/server handshake,
rewrites the server's first KEXDH_REPLY on the wire, and verifies the
client rejects rsa-sha2-256 and rsa-sha2-512 replies whose signature blob
name is downgraded to ssh-rsa.

F-2077
2026-04-08 13:33:42 +01:00
Andrew Hutchings 98e3b638c0 fix DoChannelOpen failure response and add regression test
Send SSH_MSG_CHANNEL_OPEN_FAILURE for unclassified channel open errors
instead of incorrectly falling back to SSH_MSG_REQUEST_FAILURE.

Normalize OPEN_OK error cases to an administrative-prohibited channel
open failure with a generic description, and add white-box regressions
covering callback rejection plus optional direct-tcpip and agent-null
paths.

F-2076
2026-04-08 13:11:35 +01:00
Eric Blankenhorn 0bb1d1b5b7 Add test case test_wolfSSH_CTX_UsePrivateKey_buffer_pem 2026-04-06 16:13:41 -05:00
John Safranek a6b6db8d2a KEX Fix
1. When disabling mlkem768nistp256-sha256, there's a crash when doing a
   mlkem768x25519-sha256 KEX. It tries to do a DH key exchange instead
   of x25519 with ML-KEM. Modified the check.
2. Fixed a guard where the build was treating not having
   mlkem768nistp256-sha256 like a FIPS build disallowing using ML-KEM
   when generating sesssion keys. It shouldn't make that check.
3. Added a test case to the KEM test.
2026-03-09 10:29:13 -07:00
aidan garske 09144d0c7a Add more wolfSSH CI workflows 2026-03-03 21:22:39 -08:00
Andrew Hutchings 67c7b9cce9 Address items in the review 2026-02-12 06:40:29 +00:00
Andrew Hutchings aa1b1676cb Fix SFTP server hang on WS_WANT_WRITE with non-blocking sockets
When wolfSSH_SFTP_buffer_send() called wolfSSH_stream_send(), the data
would be consumed into the SSH output buffer even if the underlying
socket returned EWOULDBLOCK/EAGAIN. SendChannelData() returns the
positive dataSz on WS_WANT_WRITE, causing the SFTP layer to advance
its buffer index as if the data was sent. The SSH output buffer still
had pending data that was never flushed, leading to an indefinite hang.

Fix: At the start of wolfSSH_SFTP_buffer_send(), check if there's
pending data in ssh->outputBuffer from a previous WS_WANT_WRITE. If
so, attempt to flush it first and return WS_WANT_WRITE if the flush
fails. This ensures the caller retries until all pending data is sent.

Also expose WS_SFTP_BUFFER and wolfSSH_SFTP_buffer_send() as
WOLFSSH_LOCAL for unit testing, and add regression test that verifies
the fix catches the bug.

Fixes ZD 21157
2026-02-05 12:06:46 +00:00
John Safranek 023b7d777e Testsuite Update
1. Break out the echoserver test into its own function, like the SFTP
   tests, called by the testsuite.
2. whitespace
2026-01-26 16:40:18 -08:00
John Safranek 303cafc9be Add ML-KEM with Curve25519 and NISTp384
1. Reorganize the KEX test to allow for testing any KEX algorithm. Add test
   cases for the new algorithms to the KEX test.
2. Reorder the cannedKexAlgoNames with the ML-KEM algos first.
3. Add the new algos to wolfSSH_GetText().
4. Add comments and whitespace cleanup.
2026-01-13 21:54:27 -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 05ea1dc3fc Prevent worker send stall on window backpressure
Handle receive-before-send in wolfSSH_worker so window-adjust packets
are processed when the send path is back-pressured, preventing SFTP
stalls with small-window clients.

Add regression that forces WANT_WRITE/WANT_READ paths without relying
on a TTY to guard against deadlock.

Fixed ZD 20958
2025-12-16 17:41:08 +00:00
Andrew Hutchings dee1c59f26 Fix double-free crash and socket-close spin 2025-12-09 09:36:38 -08:00
Andrew Hutchings 5ae5c250e2 Add tests and fix issues 2025-12-09 09:36:38 -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
John Safranek 50aa10d717
Merge pull request #793 from JacobBarthelmeh/rekey
sanity checks on message types during rekey
2025-10-06 13:54:03 -07: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
gojimmypi dccc62bafd
Rename wolfssh test certs 2025-09-03 11:10:53 -07:00
Timo Kokkonen d557c244f2 Add ED25519 key generation support. 2025-07-30 23:45:19 -07:00
JacobBarthelmeh b60c599c36 auth test case account for no null terminator with strings when comparing values 2025-07-25 11:32:02 -06:00