Harden CONNECT credential handling compliance - #572
Merged
Conversation
aidangarske
commented
Aug 12, 2026
Member
aidangarske
requested review from
wolfSSL-Fenrir-bot
and
a lite review from Copilot
August 12, 2026 03:51
There was a problem hiding this comment.
Pull request overview
This PR updates the CONNECT encoder’s credential validation to better align with MQTT protocol requirements across versions, and extends packet-level tests to cover the updated behavior.
Changes:
- Adjust
MqttEncode_Connectto only enforce the “password requires username” constraint for non-v5 CONNECT attempts, while allowing the v5 case. - Add new CONNECT encoding tests for protocol-level-specific password/username combinations, including a v5 wire-format fixture.
- Update the existing “password without username” test to explicitly exercise MQTT v3.1.1 behavior by setting protocol level 4.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_mqtt_packet.c | Adds protocol-level-specific CONNECT credential tests, including a v5 expected-bytes fixture. |
| src/mqtt_packet.c | Updates CONNECT credential validation to permit v5 password-without-username while keeping v3.1.1 restrictions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #572
Scan targets checked: wolfmqtt-bugs, wolfmqtt-src
Findings: 6
6 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
aidangarske
force-pushed
the
fix/v5-password-only-connect
branch
from
August 12, 2026 17:01
d4180c9 to
7322efa
Compare
aidangarske
marked this pull request as ready for review
August 12, 2026 19:09
embhorn
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.