Skip to content

Commit

Permalink
fix: remove matchedDN and diagnosticMessage on SearchResponseEntry
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
xunleii committed Dec 20, 2023
1 parent a03d7c0 commit 286281a
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
Expand Down

0 comments on commit 286281a

Please sign in to comment.