Commit Graph

68 Commits (master)

Author SHA1 Message Date
Aidan Garske 8d839b2bce F-7676 - Schedule pending Will publish at the earlier of delay or session end 2026-08-11 17:36:38 -07:00
Eric Blankenhorn 7262e3b5bb release test fixes 2026-07-02 12:37:25 -05:00
aidan garske cc4de83c6f Regenerate broker test certs as X.509 v3 with localhost SAN 2026-06-15 09:38:06 -07:00
aidan garske abb3dccc62 Add localhost SAN to broker test certs so WebSocket TLS hostname verification passes 2026-06-12 10:31:49 -07:00
David Garske 1a3588db03 Cache wolfSSL builds and stabilize aws-ca-regression CI 2026-06-09 15:04:44 -07:00
David Garske aadf2a6dec Peer review fixes (thanks Copilot) 2026-05-17 22:36:44 -07:00
David Garske 3bbf27bcbe Fix MacOS broker test. 2026-05-15 11:52:58 -07:00
David Garske 196358454a Fixes from PR review: CI flake, retransmit DUP=1, key cache, schema header 2026-05-15 11:52:58 -07:00
David Garske 58e6c9d452 Add optional AES-GCM encryption at rest for persisted broker records 2026-05-15 11:52:58 -07:00
David Garske b7406a2f7a Add broker persistence layer (hooks API, POSIX backend, sessions, subscriptions, retained messages, schema-wipe-on-mismatch, static-memory restore) 2026-05-15 11:52:58 -07:00
David Garske 329fbc2ca9 Add per-subscriber outbound queue with v5 Receive Maximum honoring and inflight cap 2026-05-15 11:52:58 -07:00
David Garske 13f42e6a58 Fix for MQTTv5 QoS 2 interop 2026-05-13 11:21:45 -07:00
Eric Blankenhorn ddda148dcb Fixes from review 2026-04-23 17:08:58 -05:00
Eric Blankenhorn 958e355fa2 Fix from review 2026-04-23 10:19:40 -05:00
Eric Blankenhorn 6cdcbea1ae Fix f-2348 Keepalive timeout tests 2026-04-23 08:03:22 -05:00
Aidan Garske 73ccdb38d4 Fix CI segfault and address PR #480 review comments
- Fix unit test SIGSEGV on macOS: call MqttProps_Init/ShutDown for v5
    static property pool semaphore initialization
  - Use xfer instead of client->write.len for tx_buf clearing (write.len
    is zeroed by MqttWriteStop before the XMEMSET)
  - Free decoded v5 props in roundtrip test to prevent pool exhaustion
  - Remove unused T24_PLUS_RC/T24_HASH_RC variables in broker.test
  - Change TLS credential warning guard from WOLFMQTT_DEBUG_CLIENT to
    DEBUG_WOLFMQTT for broader coverage
2026-04-09 10:19:07 -07:00
Aidan Garske 1d15bdccb4 F-2022 - https://fenrir.wolfssl.com/finding/2022 - Fix BrokerTopicMatch parent match for x/# vs x [MQTT-4.7.1.2] 2026-04-08 11:56:10 -07:00
Aidan Garske 0140692575 F-2342 - https://fenrir.wolfssl.com/finding/2342 - Add broker test for PUBLISH topic wildcard rejection [MQTT-3.3.2-2] 2026-04-08 11:05:40 -07:00
Aidan Garske 567b0f13bb F-2341 - https://fenrir.wolfssl.com/finding/2341 - Add broker test for hmtBcprefix wildcard guard [MQTT-4.7.2] 2026-04-08 10:54:17 -07:00
David Garske 4778e62713 Add libFuzzer-based broker fuzzing infrastructure and fix security issues identified through automated review and fuzz testing. 2026-03-18 15:19:03 -07:00
Eric Blankenhorn 84f94ada91 Fix port collision with ephemeral range in broker.test
generate_port previously produced ports in [49152, 65535), which
overlaps ~72% of the Linux default ephemeral port range (32768-60999).
Under CI load the generated port could already be in use, causing
bind() to fail with EADDRINUSE and the broker to exit silently.
Dual-port tests (10a/10b/10c) needed two simultaneous free ports,
doubling the exposure.

Changes:
- generate_port: use od -tu2 (unsigned decimal) and range [15000,32000)
  which is safely below both Linux and macOS ephemeral ranges
- check_broker: emit a WARNING when the broker does not become ready
  within the timeout, so failures are visible rather than silent
- start_broker / start_broker_dual: redirect broker output to a named
  log file in TMP_DIR so the CI "Show logs on failure" step captures
  the broker's error messages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-18 10:19:04 -06:00
Eric Blankenhorn dba0ca83ad Add WebSocket broker configurations to CI workflow
Add two new matrix entries to broker-check.yml for testing the broker
with WebSocket support: plain WebSocket and WebSocket + TLS. Installs
libwebsockets-dev and configures wolfSSL with --enable-opensslcoexist
for system lws compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:08:51 -06:00
Eric Blankenhorn a4299c576d Add WebSocket transport support to MQTT broker
Add server-side WebSocket support via libwebsockets, allowing
MQTT-over-WebSocket clients to connect alongside regular TCP clients.
The broker listens on two ports simultaneously (TCP and WebSocket)
with per-client rx/tx buffers bridging the lws push-based callback
model to the broker's pull-based polling model.

- Add BrokerWsCtx per-client context and WebSocket fields to MqttBroker
- Add lws server callback, WS-specific MqttNet read/write/disconnect
- Add BrokerClient_AddWs for WebSocket client initialization
- Add -w <port> CLI option to enable WebSocket listening
- Add local TLS IO callbacks when both WebSocket and TLS are enabled
- Fix wolfSSL/OpenSSL header conflict in net_libwebsockets.c client
- Link libwebsockets for broker when BUILD_WEBSOCKET is enabled
- Add WebSocket test case to broker.test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 15:08:51 -06:00
David Garske 83b4e90187 Improved broker.test to run faster 2026-02-16 15:07:18 -08:00
David Garske 055418e83a Expanded MQTT broker edge case testing for retained, graceful disconnect, unsubscribe removes subscription, duplicate subscribe QoS update and session persistence. 2026-02-16 14:04:17 -08:00
David Garske 3118b143e9 Peer review fixes 2026-02-16 14:03:59 -08:00
David Garske 924e2ba85e Support for broker to listen on secure and non-secure ports 2026-02-12 14:58:53 -08:00
David Garske 2d7eaf438c Lightweight MQTT Broker 2026-02-09 18:15:01 -08:00
Lealem Amedie 70b924f5f3 Update expired test certs 2025-11-05 10:01:47 -07:00
Eric Blankenhorn 448103d357 v1.19.1 release prep 2024-11-05 10:45:39 -06:00
philljj 2bb400b0e2 Add stress test. 2023-12-27 15:21:57 -06:00
Eric Blankenhorn ef9c6e35d3 Add broker check to scripts 2023-12-21 10:31:38 -06:00
jordan ce679c97e9 Add curl easy socket backend: configure checks, handle STDIN_WAKE and TIMEOUT, fix tests. 2023-12-10 14:41:43 -06:00
philljj c329ef77b3 Add curl easy socket backend: fix warning, fix multithread test. 2023-12-08 15:07:33 -06:00
philljj 6cdc376103 Add curl easy socket backend: fix tests, add curl readme. 2023-12-08 10:08:52 -06:00
David Garske 2f7506a8ca More logs on failure/timeout. 2023-11-21 16:08:54 -08:00
David Garske da5f1989f7 Enable firmware test without TLS support. 2023-11-21 15:45:45 -08:00
David Garske e46c2e9507 For systems without bwrap use a random port and no TLS. 2023-11-21 15:09:21 -08:00
David Garske bffe15c839 Improvements to the tests. MacOS local broker. Improve `WOLFMQTT_TEST_NONBLOCK`. 2023-11-21 15:08:25 -08:00
David Garske 694e37997d Peer review feedback. Keep cancel private function unless non-block or multi-thread. Fix for `--disable-tls` and added tests. 2023-11-21 15:08:25 -08:00
Eric Blankenhorn 65f3241505 Fixes for release 2023-11-02 08:25:11 -05:00
Eric Blankenhorn 9bc0925734 wolfMQTT Release v1.17.0 preparation 2023-11-01 10:01:19 -05:00
David Garske c973f0f966 * Added write WOLFMQTT_TEST_NONBLOCK support.
* Fix to make sure ctrl+c is honored during a want read/write case.
* Fix the firmware update example to properly synchronize publish and use a unique topic name.
* Improve multi-thread test message to use larger size (> tx but) and in test mode check for actual message.
* Improve remote test done logic.
* Only run GitHub CI for PR's, not local push.
* Properly set `WOLFMQTT_NO_EXTERNAL_BROKER_TESTS` for each test.
* Use cat for logs, not more.
2023-10-27 11:19:47 -07:00
Eric Blankenhorn eb057eabf6 Add mosquitto to CI tests 2023-10-26 11:57:28 -05:00
Eric Blankenhorn 06465df3dd Exclude CI tests with external brokers 2023-10-17 15:51:54 -05:00
Juliusz Sosinowicz d69c7b5a30 Fix script bwrap calls 2023-05-12 09:13:33 +02:00
Juliusz Sosinowicz dde03b3c9d Remove sleep calls in scripts 2023-05-11 17:12:19 +02:00
Juliusz Sosinowicz ceee98d4a1 bwrap tests when using local mosquitto instance 2023-05-11 17:08:38 +02:00
Lealem Amedie b3cabf49d3 Add testing for mqtt client mutual auth 2023-03-16 14:39:59 -06:00
Anthony Hu 297c6d8f9c Support post-quantum KYBER_LEVEL1 and P256_KYBER_LEVEL1 in wolfMQTT. 2022-06-06 14:39:22 -04:00