Skip to content

OF-3359: Do not let unofferable FAST mechanisms shape the stream features - #3477

Open
guusdk wants to merge 1 commit into
igniterealtime:mainfrom
guusdk:OF-3359_FAST-mechanisms-leak-in-features
Open

OF-3359: Do not let unofferable FAST mechanisms shape the stream features#3477
guusdk wants to merge 1 commit into
igniterealtime:mainfrom
guusdk:OF-3359_FAST-mechanisms-leak-in-features

Conversation

@guusdk

@guusdk guusdk commented Sep 2, 2026

Copy link
Copy Markdown
Member

The FAST mechanisms were carried into two calculations that cannot use them: the channel-binding types, which were derived from HT-*-UNIQ/ENDP/EXPR variants even when the FAST inline feature was not being advertised, and the emptiness check that suppresses a SASL1 mechanisms element, which counted mechanisms that a SASL1 element never renders.

appendSASLFeatures now passes on only what is actually offered, and the element builder distinguishes the two profiles rather than re-deciding whether FAST is enabled.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 58765351-7ccf-49c5-9b9d-a633520648d5

📥 Commits

Reviewing files that changed from the base of the PR and between 08f74f1 and 7f61fa5.

📒 Files selected for processing (2)
  • xmppserver/src/main/java/org/jivesoftware/openfire/net/SaslStreamFeatures.java
  • xmppserver/src/test/java/org/jivesoftware/openfire/net/SaslStreamFeaturesTest.java

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

SaslStreamFeatures now separates standard and FAST mechanisms. It advertises FAST mechanisms and channel-binding types only when the FAST feature is offered. SASL1 omits empty mechanism elements when only FAST mechanisms are eligible. SASL2 retains the mechanism element and exposes FAST through its inline feature. Tests cover FAST state reset, SASL1 suppression, disabled SASL2, and SASL2 FAST advertisement.

Merge Risk: ⚪ Minimal · up to 7f61f

SASL stream features now advertise FAST mechanisms only when available for the session, avoiding incorrect mechanism and channel-binding advertisement. The covered SASL1 and SASL2 cases indicate no remaining merge-blocking risk.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the FAST mechanism handling changes, including channel-binding calculations and SASL1 emptiness checks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation aligns offered/recorded SASL state with what is actually rendered on the wire, and the new tests cover the previously incorrect FAST-driven edge cases.

Pull request overview

This PR fixes how SASL stream features are computed/recorded when FAST (XEP-0484) mechanisms are eligible but not actually offerable (notably when SASL2 isn’t being advertised). It ensures that only mechanisms that will truly be offered influence (a) channel-binding capability advertisement/recording and (b) suppression of empty SASL1 <mechanisms/> elements.

Changes:

  • Filter FAST mechanisms out of the “offered” set unless the SASL2 inline feature is actually advertised, preventing FAST-only mechanisms from affecting channel-binding type advertisement/recording.
  • Adjust SASL1 empty-element suppression to consider only standard (non-FAST) mechanisms, as FAST mechanisms are never rendered as SASL1 <mechanism/> children.
  • Add/extend tests to cover FAST-only eligibility scenarios for SASL1/SASL2 and to verify channel-binding/FAST advertisement state is recorded consistently.
File summaries
File Description
xmppserver/src/main/java/org/jivesoftware/openfire/net/SaslStreamFeatures.java Ensures only actually-offered mechanisms (and only SASL2 when applicable) influence rendered features and recorded advertised state.
xmppserver/src/test/java/org/jivesoftware/openfire/net/SaslStreamFeaturesTest.java Adds regression coverage for FAST-only eligibility and for avoiding FAST-driven channel-binding advertisement when SASL2 is unavailable.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…ures

The FAST mechanisms were carried into two calculations that cannot use them: the channel-binding types, which were derived from HT-*-UNIQ/ENDP/EXPR variants even
when the FAST inline feature was not being advertised, and the emptiness check that suppresses a SASL1 mechanisms element, which counted mechanisms that a SASL1 element never renders.

appendSASLFeatures now passes on only what is actually offered, and the element builder distinguishes the two profiles rather than re-deciding whether FAST is enabled.
@guusdk
guusdk force-pushed the OF-3359_FAST-mechanisms-leak-in-features branch from 08f74f1 to 7f61fa5 Compare September 8, 2026 12:09
@guusdk

guusdk commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

Rebased

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.

2 participants