Skip to content

Commit

Permalink
Merge pull request #281 from ruby-ldap/sasl-fix
Browse files Browse the repository at this point in the history
Sasl fix
  • Loading branch information
jch authored Feb 8, 2017
2 parents e4c46a2 + 5bcde6e commit 8031bf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/net/ldap/auth_adapter/sasl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module Net
class LDAP
class AuthAdapter
class Sasl < Net::LDAP::AuthAdapter
MAX_SASL_CHALLENGES = 10

#--
# Required parameters: :mechanism, :initial_credential and
# :challenge_response
Expand Down Expand Up @@ -47,7 +49,7 @@ def bind(auth)
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
Expand Down
1 change: 0 additions & 1 deletion lib/net/ldap/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class Net::LDAP::Connection #:nodoc:
DefaultConnectTimeout = 5

LdapVersion = 3
MaxSaslChallenges = 10

# Initialize a connection to an LDAP server
#
Expand Down

0 comments on commit 8031bf5

Please sign in to comment.