A smoll collection of LDAP protocol conformance fixes - #81
Merged
Conversation
Firstyear
approved these changes
Aug 14, 2026
Firstyear
left a comment
Member
There was a problem hiding this comment.
Very nice set of changes! Thank you!
I reviewed all your dot-points here and it does seem you are correct WRT to the RFC and these points.
Feel free to add yourself to contributors.md as well.
Do you have other changes you want to make as well? I think just out of an abundance of caution when I do the release I'll bump the version just in case the saslCred change causes a problem for someone.
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.
Protocol fixes
Thank you so much for providing this crate. It has been insanely helpful in my own work, and so I would like to contribute back a few fixes I have been running in my own fork for a while.
I do hope my understanding of the RFCs is correct here.
serverSaslCreds wire tag (RFC 4511 §4.2.2)
serverSaslCredsis now encoded as [7] IMPLICIT OCTET STRING (0x87) instead of a universal OCTET STRING (0x04). The previous encoding was rejected withLDAP_PROTOCOL_ERRORe.g. by Samba'sldbclient, Windows, andOpenLDAP. The encode side now matches the existing parse side.Server-Side Sort request control (RFC 2891 §1.1)
1.2.840.113556.1.4.473request control:SortKeyListwithattributeType, optional [0] orderingRule, optional [1] reverseOrder.attributeTypemust be an OCTET STRING; unknown tags are aControlBererror.reverseOrderis no longer emitted whenFALSE— RFC 4511 §5.1 requires default values to be absent.SearchResultReference builder (RFC 4511 §4.5.3)
New
SearchRequest::gen_result_referencehelper so servers can emit continuation references, plus aLdapSearchResultReferencere-export.SIZE (1..MAX) enforcement
Empty
SearchResultReferenceURI lists and empty sort key lists are rejected at parse time.Bind version enforcement tests (RFC 4511 §4.2)
Tests for the existing version-3-only parse check (version 2 rejected, version 3 accepted).
Testing
I added some regression tests this time: