Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LDAP GetError and LDAP search #509

Merged
merged 35 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
14fb4c6
When trying to parse ldap error, value can be nil
gustavoluvizotto Sep 11, 2023
a93329e
change module name
gustavoluvizotto Sep 11, 2023
93d87c2
update v3 module name and README
gustavoluvizotto Sep 11, 2023
ae81db6
When trying to parse ldap v3 error, value can be nil
gustavoluvizotto Sep 11, 2023
3222984
chore: update go-asn1-ber to v1.5.5 (#464)
cpuschma Sep 14, 2023
1b699fc
fix: request timeout race condition (#465)
raymonstah Sep 15, 2023
87ffed5
feat: add cifuzz workflow (#460)
0x34d Sep 15, 2023
169c1c9
fix: Limit maximum BER packet length in `FuzzParseDN` to 65536 bytes …
cpuschma Sep 15, 2023
aa49216
chore: Mirror v3 to root directory (#468)
cpuschma Sep 16, 2023
3cacdbe
fix: add a setup process in TestMain to prevent DATA RACE as a result…
t2y Nov 21, 2023
13ecd9c
refactor: match the result code with IsErrorAnyOf even if an error is…
t2y Nov 21, 2023
707a142
fix: update golangci/golangci-lint-action since a deprecated warning …
t2y Nov 21, 2023
032ab34
feat: extend SearchResult `Unmarshal` to support *string as field typ…
cpuschma Dec 11, 2023
36b6245
Bump golang.org/x/crypto from 0.13.0 to 0.17.0 in /v3 (#478)
dependabot[bot] Dec 18, 2023
a84bee4
Bump golang.org/x/crypto from 0.13.0 to 0.17.0 (#479)
dependabot[bot] Dec 18, 2023
a690afb
feat: Add support for children scope choice const (#480)
sirzzang Jan 13, 2024
ee111be
Add `EnforceSizeLimit` to enforce the specified search request size l…
cpuschma Jan 28, 2024
e42f79a
ci: Add go 1.22 build/testing to github workflow (#485)
t2y Feb 11, 2024
1463798
feat: GSSAPI client (with unix support) (#449)
levkohimins Mar 14, 2024
2d3dcd0
fix: mark functions as deprecated with doc comment (#491)
donatello Mar 22, 2024
0d764b0
Refactor the context handling with receiving an ldap response in sear…
t2y Apr 1, 2024
c75e537
Update README to include new features and implemented RFCs
cpuschma Apr 1, 2024
64975db
chore: add comment to `Start` function to inform about possible insta…
cpuschma Apr 1, 2024
b3dfcb5
feat: Refactor `ParseDN` function to fix resource usage and invalid p…
cpuschma Apr 1, 2024
cbf5d2c
Revert "fix: Limit maximum BER packet length in `FuzzParseDN` to 6553…
cpuschma Apr 1, 2024
fd4938d
Update golang.org/x/crypto (#502)
johnweldon Apr 2, 2024
6b123c1
feat: Add tests to parseDN (fuzzing, roundtrip ...) (#504)
inteon Apr 6, 2024
6fbeed8
fix: Replace DER with ASN1 BER encoding when parsing distinguishedNam…
cpuschma Apr 7, 2024
fe10864
Merge branch 'go-ldap:master' into research-scanner
gustavoluvizotto Apr 11, 2024
ad842dc
fix search when cannot unpack ber packet due to no attributes
gustavoluvizotto Apr 11, 2024
8f1f383
remove references of forked repo
gustavoluvizotto Apr 16, 2024
9194b9f
remove references of forked repo in README
gustavoluvizotto Apr 16, 2024
9d6d375
Merge branch 'master' into research-scanner
gustavoluvizotto Apr 17, 2024
83f92f3
reflect changes on v3 to toplevel
gustavoluvizotto May 3, 2024
a70e8e3
Merge branch 'master' into research-scanner
gustavoluvizotto May 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func GetLDAPError(packet *ber.Packet) error {
return &Error{
ResultCode: resultCode,
MatchedDN: response.Children[1].Value.(string),
Err: fmt.Errorf("%s", response.Children[2].Value.(string)),
Err: fmt.Errorf("%v", response.Children[2].Value),
Packet: packet,
}
}
Expand Down
6 changes: 5 additions & 1 deletion search.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,13 @@ func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) {
return result, ErrSizeLimitExceeded
}

attr := make([]*ber.Packet, 0)
if len(packet.Children[1].Children) > 1 {
attr = packet.Children[1].Children[1].Children
}
entry := &Entry{
DN: packet.Children[1].Children[0].Value.(string),
Attributes: unpackAttributes(packet.Children[1].Children[1].Children),
Attributes: unpackAttributes(attr),
}
result.Entries = append(result.Entries, entry)
case 5:
Expand Down
2 changes: 1 addition & 1 deletion v3/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func GetLDAPError(packet *ber.Packet) error {
return &Error{
ResultCode: resultCode,
MatchedDN: response.Children[1].Value.(string),
Err: fmt.Errorf("%s", response.Children[2].Value.(string)),
Err: fmt.Errorf("%v", response.Children[2].Value),
Packet: packet,
}
}
Expand Down
6 changes: 5 additions & 1 deletion v3/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,13 @@ func (l *Conn) Search(searchRequest *SearchRequest) (*SearchResult, error) {
return result, ErrSizeLimitExceeded
}

attr := make([]*ber.Packet, 0)
if len(packet.Children[1].Children) > 1 {
attr = packet.Children[1].Children[1].Children
}
entry := &Entry{
DN: packet.Children[1].Children[0].Value.(string),
Attributes: unpackAttributes(packet.Children[1].Children[1].Children),
Attributes: unpackAttributes(attr),
}
result.Entries = append(result.Entries, entry)
case 5:
Expand Down
Loading