Repository navigation
Fix/bind protocol error handling - #83
Merged
Firstyear merged 7 commits intoOct 27, 2026
Merged
Conversation
RFC 4511 §4.2 assigns bind error handling to the server: unsupported protocol versions must be answered with protocolError, unsupported authentication choices with authMethodNotSupported. The parser previously rejected these PDUs up front — some even hung the lber parse loop forever — so servers never got the chance to respond. - LdapBindRequest now stores the protocol version; versions other than 3 parse successfully. - LdapBindCred::Unsupported covers AuthenticationChoice tags other than simple [0] and sasl [3]. - Absent SaslCredentials.credentials (OPTIONAL per the ASN.1) decodes as empty. - lber: a non-TLV child inside a fully-consumed constructed tag is malformed, not truncated; keep the decoded prefix instead of reporting Incomplete forever. BREAKING CHANGE: LdapBindRequest gains a version field and LdapBindCred gains an Unsupported variant.
- LdapResultCode::AssertionFailed (122) per RFC 4528 §2, including the numeric decode mapping. - LdapModifyType::Increment (3) per RFC 4525 §2, including the numeric decode mapping.
canceled (118), noSuchOperation (119), tooLate (120), cannotCancel (121) per RFC 3909 §2.2, with numeric decode mappings.
RFC 4370 §6 assigns result code 123 for a proxy authorization request the server does not honor.
The recently added probe tests used unwrap/unwrap_err/unreachable! and explicit .into_iter() calls, violating the crate-wide deny lints (clippy::unwrap_used, clippy::unreachable, clippy::panic). Rewritten to expect/panic-with-message and implicit iteration, matching the crate's convention (expect_used is allowed).
draft-ietf-ldapext-ldapv3-vlv-09 section 6.2.1 registers result code 76 (virtualListViewError). Needed by LDAP servers implementing the VLV control.
Member
|
Thanks, I'll review this next week (I'm away this week) :) |
Firstyear
approved these changes
Oct 27, 2026
Member
|
Thank you so much, the contribution is really appreciated. Glad to know that we help you by maintaining this library :) |
Contributor
Author
|
Incredibly so, my own projects use this. I am learning a lot. |
Member
If you ever have any questions, please let us know, we're always happy to help out. |
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.
Hello again,
I found more protocol issues in the crate. This PR fixes them. These changes are based on my reading of the LDAP RFCs. Please correct me if I misread them.
I changed how the parser handles bind requests. RFC 4511 §4.2 says the server must report bind errors. The parser must pass the message through. As it stands, it does not. A server built on this crate cannot be RFC compliant.
Changes made
These changes are breaking.
I added result codes from RFC 3909, 4528, 4370, and the VLV draft:
I also added the Increment modify operation (value 3, RFC 4525).
I added tests for the new bind behavior.
As suggested in the last PR, I added myself to the contributor list.
Thanks for maintaining this project. It saves me a lot of time. ❤️