Commit Graph

88 Commits (c71202ffdb92202cc53bd520ee45f438d2edded4)

Author SHA1 Message Date
Mark Atwood 9731cfe250 test: assert SBOM wolfSSL version comes from WOLFSSL_DIR
The dependency assertion checked only that wolfssl was present with a
DEPENDS_ON edge, never that the recorded version matched WOLFSSL_DIR, so
the SBOM could attest a version wolfSSH was not built against and still
pass. Compare versionInfo against the tree.

That assertion alone would not have caught it: the runner installs
wolfssl from the same tree it passes as WOLFSSL_DIR, so pkg-config and
wolfssl/version.h always agree and a wrong source is indistinguishable
from a right one. Add a step that forces them apart -- a stub pkg-config
reports a sentinel version, and a distclean'd copy of the tree has no
generated version.h, so the configure.ac fallback is the only route to a
correct answer. Reverting the recipe fix makes this step fail with the
sentinel, and the fallback path now has CI coverage it lacked.
2026-08-27 09:43:33 -07:00
Mark Atwood f8f580b878 fix: fail SBOM CI when gen-sbom missing on master
The gate skipped SBOM generation and exited 0 whenever wolfssl's
scripts/gen-sbom was absent, so the job could report success having
never exercised `make sbom`. That was deliberate while the script was
unmerged, but it landed on master in wolfSSL/wolfssl#10343.

On master, a missing gen-sbom or one too old for --dep-wolfssl is a
regression, so fail instead of skipping: a green run now always means
the target was exercised and the wolfssl-dependency assertions ran.
Only a deliberately pinned older wolfssl_ref still degrades to a skip.

The ref is passed through env rather than interpolated into the shell
script, to keep the workflow expression out of the command line.
2026-08-27 09:43:33 -07:00
Mark Atwood d52677082f fix: unpin SBOM CI from merged wolfssl PR ref
wolfSSL/wolfssl#10343 merged on 2026-07-27, but the SBOM workflow still
checked out wolfssl at refs/pull/10343/head. GitHub keeps PR refs alive
after merge, so CI stayed green while validating a pre-merge snapshot
rather than master. Point wolfssl_ref and its fallback at master.

Distinguish the two gen-sbom lookup failures. A set-but-wrong
WOLFSSL_DIR previously printed the "re-run with WOLFSSL_DIR=..." advice
to someone who had already set it; it now names the path that was
probed and states that WOLFSSL_DIR is a source tree, not an install
prefix.

Refresh the README and in-recipe notes that still told users to track
the #10343 branch until it merged.
2026-08-27 09:43:33 -07:00
Sameeh Jubran b89b940add sbom: sync scripts/sbom.am with canonical copy and widen CI filter
Re-sync scripts/sbom.am with the canonical wolfSSL copy ($(docdir)
sbomdir, [[:space:]] version parse, GNU-make and uninstall-sbom docs)
and widen the SBOM workflow pull_request filter to '**'.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-27 09:43:33 -07:00
Sameeh Jubran 1f57f67db7 sbom: default license to GPL-3.0-or-later and pin CI to #10343 ref
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-27 09:43:33 -07:00
Sameeh Jubran 5323b26b0a sbom: extract shared scripts/sbom.am recipe and add CI
Move the make sbom / install-sbom / uninstall-sbom recipe out of
Makefile.am into a reusable scripts/sbom.am fragment; Makefile.am now
just declares the product facts (name, LICENSING, wolfssl dependency,
GPL-3.0-only default) and includes it.

Add a GitHub Actions workflow covering both SBOM paths:
- autotools: build wolfSSL + wolfSSH, run make sbom, assert SPDX
  validity, CycloneDX identity, reproducibility, and the wolfssl
  dependency edge.
- embedded: run gen-sbom against user_settings.h (via pcpp) + the
  wolfSSH source set, asserting the same identity/validity/reproducibility
  plus that user_settings.h options and the wolfssl dependency are
  captured.
Both gracefully skip on a gen-sbom that predates the wolfSSL SBOM
change.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-27 09:43:33 -07:00
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