Commit Graph

82 Commits (285e0409cfeb8caac1ab4b9fe1d8f0789ed62073)

Author SHA1 Message Date
John Safranek 23899eda85 Build and test the wolfssh client app in CI
- --enable-sshclient defaults to no, so the app was built only by the
  configs that use --enable-all, and never under the multi-compiler
  warning flags. Add it to the multi-compiler matrix.
- Add scripts/sshclient.test, run by make check. It covers the client's
  sessions and the -E log file against the echoserver.
- The script is not gated on BUILD_SSHCLIENT. It exits 77 when the
  client app or the echoserver isn't there, so every build runs it and
  the ones without the app report it as a skip.
- Check the client and the echoserver by asking each for its usage
  message, not by looking for the file. Both are libtool wrapper
  scripts in the build tree, and a wrapper outlives a reconfigure that
  drops the program it wraps, then runs only far enough to say so.
- The echoserver runs in echo mode and the client's stdin comes from a
  fifo written a piece at a time, so the session carries data and ends
  on its own. Each client run has a watchdog.
- Rename sshd-test.yml's job to cover both apps. That workflow builds
  the client app along with wolfsshd.
- Check that the command reaches the server, now that the client sends
  it rather than discarding it.
- Make the SINGLE_THREADED guard a preprocessor #error. The runtime
  err_sys() only caught the misconfiguration in an autotools build that
  got as far as running; the #error catches it at compile time for the
  IDE and plain Makefile builds too.
- Treat WS_WANT_READ and WS_WANT_WRITE out of wolfSSH_worker() as a
  clean shutdown. The socket is non-blocking, so the peer having
  nothing ready is not a session failure.
2026-08-26 16:53:23 -05:00
Paul Adelsbach 581053bcf6 CI: add code coverage workflow, misc script updates 2026-08-21 11:30:40 -07:00
Yosuke Shimizu 5c92896d03 Run the API tests in the TPM CI job
- No job compiled a wolfSSH test binary with WOLFSSH_TPM defined, so a
  test guarded on it compiled out everywhere and could not gate a
  merge. This job enables TPM but only builds; the jobs that run make
  check do not enable it.
- Add a make check step. automake's check-am builds every check_PROGRAM
  regardless of the TESTS override, so this is the only job that
  compiles wolfSSH's tests with TPM support.
- Override TESTS to run only tests/api.test, the one suite with
  TPM-specific tests. kex.test also aborts in the example client, which
  demands -K in a TPM build.
- Restrict it to one matrix cell. The 2x2x2 matrix varies the simulator
  and the host key, neither of which these tests touch.
- Assert -DWOLFSSH_TPM in AM_CPPFLAGS first. A build without it
  compiles the guarded tests out and still exits 0, a hollow pass.
- Dump tests/api.log on failure and archive it.
2026-08-14 14:35:24 -07:00
Yosuke Shimizu 1644bb773d Accept exact-fit ScpBuffer in no-filesystem SCP send callback 2026-08-14 14:34:16 -07:00
Yosuke Shimizu 2142821bc6 Stop wPread and wPwrite dropping the high offset word 2026-08-14 14:25:55 -07:00
Emma Stensland 47ddc70b40 added check for private and public keys decoded 2026-07-31 16:14:52 -07:00
Yosuke Shimizu 029d412e1f Add OpenSSH certificate user authentication 2026-07-27 23:30:20 -07:00
Yosuke Shimizu 5acbeaeaee Run threaded api-test SFTP/SCP tests on Windows 2026-07-22 17:29:27 -05:00
Paul Adelsbach d7e99dc0a4 Address CI UBSan timeouts 2026-07-21 18:06:37 -05:00
John Safranek 7d7bf93e06 Test Zephyr sample on 3.4.0 and 4.4.0
- add a v4.4.0 matrix leg alongside v3.4.0
- run each leg in the Zephyr CI image with the matching SDK
  (ci:v0.26.4/SDK 0.16.1, ci:v0.29.0/SDK 1.0.0); drops the manual
  deps, west, pip and SDK install steps
- scope twister by --testsuite-root and drop --test: the scenario
  id is path-prefixed on 3.4.0 but bare on 4.x
- replace zip with tar caf logs.tar.xz for the failure-log artifact
2026-07-14 13:58:43 -07:00
aidan garske b8e2fd3703 Address review: TPM publickey auth fallback, reject truncated CA, guard negative CI test, silence maybe-uninitialized 2026-07-07 14:28:56 -07:00
aidan garske d818d032ba Address review: clear crypto callback on error, gate SHA-1 to RSA, cryptocb docs, fix comment 2026-07-07 14:28:56 -07:00
aidan garske 5f715daf02 Add TPM X.509 host certificate docs and CI coverage 2026-07-07 14:28:56 -07:00
Yosuke Shimizu 62639efd35 Enforce LoginGraceTime in wolfsshd on Windows and make the grace flag per-connection 2026-07-07 12:43:08 -05:00
Yosuke Shimizu 323ec15bb0 wolfsshd: add StrictModes and secure loading of trust anchors 2026-06-26 14:13:02 -07:00
Yosuke Shimizu 4483254e8c Zeroize SFTP file payload buffers before freeing 2026-06-25 10:28:47 -07:00
Paul Adelsbach 1dc30ed97e Set keyAllocated=1 when initializing any key 2026-06-22 10:40:56 -07:00
aidan garske e52b038de9 Add timeout to TPM SSH workflow to prevent multi-hour hangs 2026-06-22 08:51:37 -07:00
Yosuke Shimizu 2425f7c594 Bound OSC index before reads in wolfSSH_DoOSC 2026-06-18 11:00:42 -07:00
aidan garske a2c28c9c3c Add TPM 2.0 resident server host keys for ECDSA and RSA 2026-06-16 13:59:52 -07:00
Yosuke Shimizu eef8281609 wolfsshd: bind certificate auth to user, fail closed without FPKI 2026-06-16 11:50:34 -07:00
Yosuke Shimizu d49b15f51a SFTP path confinement and status-reply refactor 2026-06-09 10:46:17 -07:00
John Safranek 0b37d43239 Add x509 interop CI workflow
- Build PKIX-SSH and run wolfSSHd against the PKIX-SSH ssh/sftp
  clients using x509 user certs.
- Posts an issue if the test fails.
2026-05-28 08:48:13 -07:00
John Safranek b583c0a225 Update wolfSSL version in ML-KEM and Thread tests
1. Update WOLFSSL_REF to v5.9.1-stable in the ML-KEM and single-thread
   tests (interop-mlkem.yml, singlethread-check.yml).
2. Drop kyber.yml; its coverage is a strict subset of interop-mlkem.yml.
   Fold its push and workflow_dispatch triggers into interop-mlkem.yml so
   ML-KEM still runs on master/release pushes and via manual dispatch.
3. Drop liboqs from the ML-KEM test. It isn't in configure.ac any more.
2026-05-18 11:04:51 -07:00
John Safranek b7c644f92a github/workflows: upgrade actions to Node.js 24 versions 2026-05-11 22:27:00 -07:00
John Safranek be69a46db0
Merge pull request #882 from JacobBarthelmeh/sftp
More robust SFTP send/read handling
2026-03-06 07:35:58 -08:00
JacobBarthelmeh 045012c163 adjust when the windows-sftp github actions test is triggered 2026-03-05 13:27:08 -07:00
aidan garske 09144d0c7a Add more wolfSSH CI workflows 2026-03-03 21:22:39 -08:00
JacobBarthelmeh 30ea988943 add Windows wolfsshd <-> wolfsftp test with large transfers 2026-02-27 16:23:27 -07:00
JacobBarthelmeh 83a3990d0d add aditional large SFTP transfer test when the SFTP read/write buffer is increased in size 2026-02-27 16:22:55 -07:00
Andrew Hutchings 33203c3aca Add contention testing
Simulate netowrk latency using netem and use it to test the non-blocking
mode of SFTP. This helps find issues which would affect running an SFTP
server on a microcontroller. It helped find the bug fixed in #876.
2026-02-16 06:42:32 +00:00
JacobBarthelmeh e60aafe955
Merge pull request #876 from LinuxJedi/sftp-hang
Fix SFTP server hang on WS_WANT_WRITE with non-blocking sockets
2026-02-12 15:23:42 -07:00
John Safranek 804aef5b00 Update FatFS Test
1. Update caching the download of the FatFS source archive to the
   pattern other tests are using to cache items. It was downloading
   the FatFS source archive every time, despite it being in the cache.
2. Update building wolfSSL to follow the pattern of the other tests.
2026-02-12 13:14:41 -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 89bcf85d50 Coverity Scan Automation
1. Add GitHub action to run a Coverity scan.
2026-01-22 14:34:38 -08:00
David Garske 1b8e0be48a
Merge pull request #869 from wolfSSL/draft-ietf-sshm-mlkem-hybrid-kex
Add mlkem1024nistp384-sha384 and mlkem768x25519-sha256
2026-01-21 12:55:14 -08:00
John Safranek eae1ecd08b GitHub Actions Update
1. Change all actions to run on push only to master, main, or a release.
2. Change all actions to run on workflow_dispatch.
2026-01-20 15:47:45 -08:00
John Safranek aa1ea29c64 Add ML-KEM with Curve25519 and NISTp384
1. Add GitHub action to test wolfSSL against OpenSSH using MLKEM.
2026-01-20 13:16:45 -08:00
JacobBarthelmeh 4f5f75f714 macos-latest updated in aug to be macos-15 and now was seeing kex test failure, revert to macos-14 2025-08-25 10:27:24 -06: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
aidan garske 3775d1843a newline 2025-04-01 22:05:47 -07:00
aidan garske 69e266178f Used port.h macros 2025-04-01 21:58:49 -07:00
aidan garske 77c8db6cc2 Rebase for tpm public key authentication with wolfssh 2025-04-01 16:44:55 -07:00
Anthony Hu 0183905dbe Replace Kyber 512 with ML-KEM 768.
Devin did some work here.
2025-03-21 19:35:02 -04:00
David Garske cea99e5e83
Merge pull request #787 from wolfSSL/devin/1740666408-add-fatfs-test-action
FATFS improvements, test and Linux example
2025-03-07 06:32:22 -08:00
Andrew Hutchings dfc0f72480 Make the FATFS a cache step 2025-03-06 11:15:29 +00:00
Andrew Hutchings a37591f3f5 Remove FATFS and link to it instead 2025-03-06 10:33:40 +00:00
Devin AI 647508beb8 Add GitHub Action for testing wolfSSH server with Paramiko SFTP client
Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
2025-02-28 11:44:42 +00:00
Devin AI da01ceac13 Add GitHub Action to test FATFS support for wolfsftp client
This adds a GitHub Action workflow to test the FATFS support for the wolfsftp client.
The workflow:
- Installs dependencies
- Clones and builds wolfSSL with appropriate flags
- Compiles the FATFS library
- Configures and builds wolfSSH with FATFS support
- Creates a test file
- Sets up an SSH server
- Uses the wolfsftp client to transfer a test file
- Verifies the file in the FATFS image

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>

Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
2025-02-27 15:40:06 +00:00