Skip to content
Browse files

Ruby 1.8.6 compatibility.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 236fe10 commit f2fb7111524835946913d8335acc7a6930991c9a @jeremy jeremy committed Feb 22, 2007
Showing with 3 additions and 3 deletions.
  1. +3 −3 activerecord/lib/active_record/vendor/mysql.rb
View
6 activerecord/lib/active_record/vendor/mysql.rb
@@ -563,9 +563,9 @@ def scramble(password, message, old_ver)
def scramble41(password, message)
return 0x00.chr if password.nil? or password.empty?
buf = [0x14]
- s1 = Digest::SHA1.new(password).digest
- s2 = Digest::SHA1.new(s1).digest
- x = Digest::SHA1.new(message + s2).digest
+ s1 = Digest::SHA1.digest(password)
+ s2 = Digest::SHA1.digest(s1)
+ x = Digest::SHA1.digest(message + s2)
(0..s1.length - 1).each {|i| buf.push(s1[i] ^ x[i])}
buf.pack("C*")
end

0 comments on commit f2fb711

Please sign in to comment.
Something went wrong with that request. Please try again.