From a87f8ca880c1398080d77eaaa27ff3f9eefdcbfb Mon Sep 17 00:00:00 2001 From: Alexandre Nicolaie Date: Wed, 20 Dec 2023 21:14:12 +0100 Subject: [PATCH] fix: remove matchedDN and diagnosticMessage on SearchResponseEntry Following some LDAP UI and Wireshark, these two elements should not be found inside a SearchResponseEntry (matchedDN doesn't make sense on this kind of message). Also, following https://ldap.com/ldapv3-wire-protocol-reference-search/, I didn't found anything about them: ``` SearchResultEntry ::= [APPLICATION 4] SEQUENCE { objectName LDAPDN, attributes PartialAttributeList } PartialAttributeList ::= SEQUENCE OF partialAttribute PartialAttribute LDAPDN ::= LDAPString -- Constrained to [RFC4514] LDAPString ::= OCTET STRING -- UTF-8 encoded, -- [ISO10646] characters PartialAttribute ::= SEQUENCE { type AttributeDescription, vals SET OF value AttributeValue } AttributeDescription ::= LDAPString -- Constrained to -- [RFC4512] AttributeValue ::= OCTET STRING ``` --- response.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/response.go b/response.go index b00b99b..b2ba6fb 100644 --- a/response.go +++ b/response.go @@ -241,9 +241,6 @@ func (r *SearchResponseEntry) packet() *packet { } resultPacket.AppendChild(attributesPacket) - // Add optional diagnostic message and matched DN - addOptionalResponseChildren(resultPacket, WithDiagnosticMessage(r.diagMessage), WithMatchedDN(r.matchedDN)) - replyPacket.AppendChild(resultPacket) return &packet{Packet: replyPacket} }