Decode responses with Asn1.BER not Asn1.DER
According to RFC 4511 section 5.1: The protocol elements of LDAP SHALL be encoded for exchange using the Basic Encoding Rules [BER] of [ASN.1] with the following restrictions [...] The library does not have much choice except accepting everything the server throws at it, therefore it makes sense using the more lax BER encoding to parse server responses. Using DER is still ok for the encoding part since DER is still a subset of BER, and anything accepting BER will accept DER too.
This commit is contained in:
parent
b92564e783
commit
824b44ac22
@ -193,7 +193,7 @@ input inq conn = wrap . flip fix [] $ \loop chunks -> do
|
||||
0 -> throwIO (IO.mkIOError IO.eofErrorType "Ldap.Client.input" Nothing Nothing)
|
||||
_ -> do
|
||||
let chunks' = chunk : chunks
|
||||
case Asn1.decodeASN1 Asn1.DER (ByteString.Lazy.fromChunks (reverse chunks')) of
|
||||
case Asn1.decodeASN1 Asn1.BER (ByteString.Lazy.fromChunks (reverse chunks')) of
|
||||
Left Asn1.ParsingPartial
|
||||
-> loop chunks'
|
||||
Left e -> throwIO e
|
||||
|
||||
Loading…
Reference in New Issue
Block a user