Skip to content

Sasl fix #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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