Skip to content

Commit b1b5bc3

Browse files
WimRooseUGcbergmann
authored andcommitted
revert new string indexing
1 parent 49616ec commit b1b5bc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/puppet/type/openldap_database.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ def insync?(is)
8888
when %r{^\{MD5\}.+}
8989
"{MD5}#{Digest::MD5.hexdigest(should)}" == is
9090
when %r{^\{SMD5\}.+}
91-
salt = is[16..]
91+
salt = is[16..-1]
9292
md5_hash_with_salt = "#{Digest::MD5.digest(should + salt)}#{salt}"
9393
is == "{SMD5}#{[md5_hash_with_salt].pack('m').delete("\n")}"
9494
when %r{^\{SSHA\}.+}
9595
decoded = Base64.decode64(is.gsub(%r{^\{SSHA\}}, ''))
96-
salt = decoded[20..]
96+
salt = decoded[20..-1]
9797
"{SSHA}#{Base64.encode64("#{Digest::SHA1.digest("#{should}#{salt}")}#{salt}").chomp}" == is
9898
when %r{^\{SHA\}.+}
9999
"{SHA}#{Digest::SHA1.hexdigest(should)}" == is

0 commit comments

Comments
 (0)