lib/net/ldap/auth_adapter/sasl.rb in net-ldap-0.15.0 vs lib/net/ldap/auth_adapter/sasl.rb in net-ldap-0.16.0
- old
+ new
@@ -2,10 +2,12 @@
module Net
class LDAP
class AuthAdapter
class Sasl < Net::LDAP::AuthAdapter
+ MAX_SASL_CHALLENGES = 10
+
#--
# Required parameters: :mechanism, :initial_credential and
# :challenge_response
#
# Mechanism is a string value that will be passed in the SASL-packet's
@@ -45,10 +47,10 @@
if !pdu || pdu.app_tag != Net::LDAP::PDU::BindResult
raise Net::LDAP::NoBindResultError, "no bind result"
end
return pdu unless pdu.result_code == Net::LDAP::ResultCodeSaslBindInProgress
- raise Net::LDAP::SASLChallengeOverflowError, "sasl-challenge overflow" if ((n += 1) > MaxSaslChallenges)
+ raise Net::LDAP::SASLChallengeOverflowError, "sasl-challenge overflow" if ((n += 1) > MAX_SASL_CHALLENGES)
cred = chall.call(pdu.result_server_sasl_creds)
end
raise Net::LDAP::SASLChallengeOverflowError, "why are we here?"