Skip to content

Fix ExtendedRequest requestValue RFC4511 encoding - #629

Closed
michele-deluca wants to merge 1 commit into
go-ldap:masterfrom
michele-deluca:fix-rfc4511-extended-request-value
Closed

michele-deluca wants to merge 1 commit into
go-ldap:masterfrom
michele-deluca:fix-rfc4511-extended-request-value

Conversation

@michele-deluca

Copy link
Copy Markdown

Problem
RFC 4511 defines ExtendedRequest as:

ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
requestName [0] LDAPOID,
requestValue [1] OCTET STRING OPTIONAL
}

The current implementation appends er.Value directly as a child of the ExtendedRequest:

if er.Value != nil {
pkt.AppendChild(er.Value)
}

ExtendedRequest
├─ requestName [0]
└─ SEQUENCE {...}

ExtendedRequest
├─ requestName [0]
└─ requestValue [1] OCTET STRING

This breaks interoperability with LDAP extensions expecting RFC-compliant encoding.

One example is the eDirectory NMAS Universal Password extension (OID 2.16.840.1.113719.1.39.42.100.13), which returns:

NMAS Extension invalid version

with the current implementation.

Fix

Serialize er.Value and encode it as the context-specific [1] requestValue field defined by RFC 4511.

Validation

Validated against eDirectory/OpenLDAP interoperability tests.

Before patch:

NMAS Extension invalid version

SEQUENCE {
INTEGER 1
INTEGER 0
OCTET STRING ""
}

@cpuschma

Copy link
Copy Markdown
Member

Fixed in #628 with tests. Needs overall work done.

@cpuschma cpuschma closed this Sep 23, 2026
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