Factored out BindResponse handling, to support SASL server creds.

This commit is contained in:
blackhedd 2006-09-30 12:12:52 +00:00
parent 54d929dae5
commit af27b55d89

View file

@ -82,7 +82,7 @@ class LdapPdu
case @app_tag case @app_tag
when BindResult when BindResult
parse_ldap_result ber_object[1] parse_bind_response ber_object[1]
when SearchReturnedData when SearchReturnedData
parse_search_return ber_object[1] parse_search_return ber_object[1]
when SearchResultReferral when SearchResultReferral
@ -129,6 +129,18 @@ class LdapPdu
end end
private :parse_ldap_result private :parse_ldap_result
#
# parse_bind_response
# A Bind Response may have an additional field, ID [7], serverSaslCreds, per RFC 2251 pgh 4.2.3.
#
def parse_bind_response sequence
sequence.length >= 3 or raise LdapPduError
@ldap_result = {:resultCode => sequence[0], :matchedDN => sequence[1], :errorMessage => sequence[2]}
@ldap_result[:serverSaslCreds] = sequence[3] if sequence.length >= 4
@ldap_result
end
private :parse_bind_response
# #
# parse_search_return # parse_search_return
# Definition from RFC 1777 (we're handling application-4 here) # Definition from RFC 1777 (we're handling application-4 here)