From 563fc272a36c8be317fbe95c8308ca2dfa29c3aa Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 7 Jul 2021 01:49:33 +0200 Subject: Vendor goldap, fix ASN.1 BER integer and length encoding - Add tests for goldap to prevent regressions - Disable reconnection for our functional tests --- goldap/uri.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 goldap/uri.go (limited to 'goldap/uri.go') diff --git a/goldap/uri.go b/goldap/uri.go new file mode 100644 index 0000000..b57874a --- /dev/null +++ b/goldap/uri.go @@ -0,0 +1,32 @@ +package message + +import "fmt" + +// +// URI ::= LDAPString -- limited to characters permitted in +// -- URIs +func readURI(bytes *Bytes) (uri URI, err error) { + var ldapstring LDAPString + ldapstring, err = readLDAPString(bytes) + // @TODO: check permitted chars in URI + if err != nil { + err = LdapError{fmt.Sprintf("readURI:\n%s", err.Error())} + return + } + uri = URI(ldapstring) + return +} + +// +// URI ::= LDAPString -- limited to characters permitted in +// -- URIs +func (u URI) write(bytes *Bytes) int { + return LDAPString(u).write(bytes) +} + +// +// URI ::= LDAPString -- limited to characters permitted in +// -- URIs +func (u URI) size() int { + return LDAPString(u).size() +} -- cgit v1.2.3