Skip to content

Commit 8031bf5

Browse files
authored
Merge pull request #281 from ruby-ldap/sasl-fix
Sasl fix
2 parents e4c46a2 + 5bcde6e commit 8031bf5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: lib/net/ldap/auth_adapter/sasl.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ module Net
44
class LDAP
55
class AuthAdapter
66
class Sasl < Net::LDAP::AuthAdapter
7+
MAX_SASL_CHALLENGES = 10
8+
79
#--
810
# Required parameters: :mechanism, :initial_credential and
911
# :challenge_response
@@ -47,7 +49,7 @@ def bind(auth)
4749
end
4850

4951
return pdu unless pdu.result_code == Net::LDAP::ResultCodeSaslBindInProgress
50-
raise Net::LDAP::SASLChallengeOverflowError, "sasl-challenge overflow" if ((n += 1) > MaxSaslChallenges)
52+
raise Net::LDAP::SASLChallengeOverflowError, "sasl-challenge overflow" if ((n += 1) > MAX_SASL_CHALLENGES)
5153

5254
cred = chall.call(pdu.result_server_sasl_creds)
5355
end

Diff for: lib/net/ldap/connection.rb

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class Net::LDAP::Connection #:nodoc:
77
DefaultConnectTimeout = 5
88

99
LdapVersion = 3
10-
MaxSaslChallenges = 10
1110

1211
# Initialize a connection to an LDAP server
1312
#

0 commit comments

Comments
 (0)