1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Reflect the update of the MD5 module which is now Digest::MD5.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2001-12-01 14:07:01 +00:00
parent 3dfb98cea2
commit 31e15f7606
5 changed files with 14 additions and 21 deletions

View file

@ -2499,8 +2499,7 @@ module Net
def hmac_md5(text, key)
if key.length > 64
md5 = MD5.new(key)
key = md5.digest
key = Digest::MD5.digest(key)
end
k_ipad = key + "\0" * (64 - key.length)
@ -2510,15 +2509,9 @@ module Net
k_opad[i] ^= 0x5c
end
md5 = MD5.new
md5.update(k_ipad)
md5.update(text)
digest = md5.digest
digest = Digest::MD5.digest(k_ipad + text)
md5 = MD5.new
md5.update(k_opad)
md5.update(digest)
return md5.hexdigest
return Digest::MD5.hexdigest(k_opad + digest)
end
end
add_authenticator "CRAM-MD5", CramMD5Authenticator