Skip to content

Commit 88f6066

Browse files
committed
replace tabs with double spaces
1 parent 33e452b commit 88f6066

File tree

9 files changed

+274
-289
lines changed

9 files changed

+274
-289
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ namespace :old do
7070
end
7171
end
7272

73-
desc "Run a full set of integration and unit tests"
73+
desc "Run a full set of integration and unit tests"
7474
task :cruise => [:test, :spec]
7575

7676
# vim: syntax=ruby

lib/net/ber/core_ext/string.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ def to_ber(code = 0x04)
1616
[code].pack('C') + raw_string.length.to_ber_length_encoding + raw_string
1717
end
1818

19-
##
20-
# Converts a string to a BER string but does *not* encode to UTF-8 first.
21-
# This is required for proper representation of binary data for Microsoft
22-
# Active Directory
23-
def to_ber_bin(code = 0x04)
24-
[code].pack('C') + length.to_ber_length_encoding + self
25-
end
19+
##
20+
# Converts a string to a BER string but does *not* encode to UTF-8 first.
21+
# This is required for proper representation of binary data for Microsoft
22+
# Active Directory
23+
def to_ber_bin(code = 0x04)
24+
[code].pack('C') + length.to_ber_length_encoding + self
25+
end
2626

2727
def raw_utf8_encoded
2828
if self.respond_to?(:encode)

lib/net/ldap.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class LdapError < StandardError; end
317317
DefaultPort = 389
318318
DefaultAuth = { :method => :anonymous }
319319
DefaultTreebase = "dc=com"
320-
DefaultForceNoPage = false
320+
DefaultForceNoPage = false
321321

322322
StartTlsOid = "1.3.6.1.4.1.1466.20037"
323323

@@ -398,7 +398,7 @@ def initialize(args = {})
398398
@verbose = false # Make this configurable with a switch on the class.
399399
@auth = args[:auth] || DefaultAuth
400400
@base = args[:base] || DefaultTreebase
401-
@force_no_page = args[:force_no_page] || DefaultForceNoPage
401+
@force_no_page = args[:force_no_page] || DefaultForceNoPage
402402
encryption args[:encryption] # may be nil
403403

404404
if pr = @auth[:password] and pr.respond_to?(:call)
@@ -1168,10 +1168,10 @@ def search_subschema_entry
11681168
# MUST refactor the root_dse call out.
11691169
#++
11701170
def paged_searches_supported?
1171-
# active directory returns that it supports paged results. However
1172-
# it returns binary data in the rfc2696_cookie which throws an
1173-
# encoding exception breaking searching.
1174-
return false if @force_no_page
1171+
# active directory returns that it supports paged results. However
1172+
# it returns binary data in the rfc2696_cookie which throws an
1173+
# encoding exception breaking searching.
1174+
return false if @force_no_page
11751175
@server_caps ||= search_root_dse
11761176
@server_caps[:supportedcontrol].include?(Net::LDAP::LDAPControls::PAGED_RESULTS)
11771177
end

lib/net/ldap/password.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ class << self
2121
#
2222
attribute_value = ""
2323
def generate(type, str)
24-
case type
25-
when :md5
26-
attribute_value = '{MD5}' + Base64.encode64(Digest::MD5.digest(str)).chomp!
27-
when :sha
28-
attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp!
29-
when :ssha
30-
salt = SecureRandom.random_bytes(16)
31-
attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp!
32-
else
33-
raise Net::LDAP::LdapError, "Unsupported password-hash type (#{type})"
34-
end
24+
case type
25+
when :md5
26+
attribute_value = '{MD5}' + Base64.encode64(Digest::MD5.digest(str)).chomp!
27+
when :sha
28+
attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp!
29+
when :ssha
30+
salt = SecureRandom.random_bytes(16)
31+
attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp!
32+
else
33+
raise Net::LDAP::LdapError, "Unsupported password-hash type (#{type})"
34+
end
3535
return attribute_value
3636
end
3737
end

0 commit comments

Comments
 (0)