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 authored and jimlambrt committed Jan 15, 2024
1 parent 5a96260 commit a87f8ca
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 a87f8ca

Please sign in to comment.