Skip to content

Harden CONNECT credential handling compliance - #572

Merged
embhorn merged 1 commit into
wolfSSL:masterfrom
aidangarske:fix/v5-password-only-connect
Aug 12, 2026
Merged

Harden CONNECT credential handling compliance#572
embhorn merged 1 commit into
wolfSSL:masterfrom
aidangarske:fix/v5-password-only-connect

Conversation

@aidangarske

Copy link
Copy Markdown
Member
F-8597

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_Connect to 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.

Comment thread src/mqtt_packet.c Outdated
Comment thread tests/test_mqtt_packet.c
Comment thread tests/test_mqtt_packet.c

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/mqtt_packet.c Outdated
Comment thread tests/test_mqtt_packet.c
Comment thread tests/test_mqtt_packet.c
Comment thread tests/test_mqtt_packet.c
Comment thread tests/test_mqtt_packet.c
Comment thread src/mqtt_packet.c Outdated
@aidangarske
aidangarske force-pushed the fix/v5-password-only-connect branch from d4180c9 to 7322efa Compare August 12, 2026 17:01
@aidangarske
aidangarske marked this pull request as ready for review August 12, 2026 19:09
@aidangarske
aidangarske requested a review from embhorn August 12, 2026 19:09
@embhorn
embhorn merged commit 84b43d7 into wolfSSL:master Aug 12, 2026
47 of 48 checks passed
@aidangarske
aidangarske deleted the fix/v5-password-only-connect branch August 12, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants