feat: include channel-binding data in SCRAM proofs - #6
Merged
Conversation
AuthMessage c= is base64(gs2-header || cbind-data) when the GS2 flag is p. Without that, SCRAM-SHA-256-PLUS clients fail even when the header parses. Also add a PLUS client and reject the RFC 5802 y downgrade. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 31, 2026
Rejecting n is this server's require-channel-binding policy, not a section 6 MUST. Co-authored-by: Cursor <cursoragent@cursor.com>
levkk
approved these changes
Aug 31, 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.
Summary
c=is nowbase64(gs2-header || cbind-data)when the GS2 flag isp, which is what libpq and rust-postgres sign over forSCRAM-SHA-256-PLUS.client-firstbut verified the proof as ifc=were only the GS2 header, so a real handshake would fail.ScramClient::new_with_channel_binding) so the handshake can be tested end-to-end, including the stored-key path.ydowngrade when the server is configured for channel binding.Needed for pgdogdev/pgdog#1453 (see also the follow-up pgdog PR).
Test plan
cargo test— existing non-PLUS handshakes stay greentls-server-end-pointdataNotAuthenticatedpg_shadow) PLUS handshake succeedsy/n/ type-mismatch still rejected when the server requires bindingMade with Cursor