summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-03 03:12:30 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-03 03:12:30 +0000
commitbb9435a75ca13504304ef000a1469b096fdce4c2 (patch)
tree3e74211fdda9c8a9b892be39a40273c87e01fad6 /lib/net
parent0f9422ef230c0f7d873563e5ab29230ad54c6d41 (diff)
* lib/net/imap.rb (hmac_md5): should use String#ord to get ascii
code from the one-character string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/imap.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb
index 09b5349298..d07dd42722 100644
--- a/lib/net/imap.rb
+++ b/lib/net/imap.rb
@@ -3151,8 +3151,8 @@ module Net
k_ipad = key + "\0" * (64 - key.length)
k_opad = key + "\0" * (64 - key.length)
for i in 0..63
- k_ipad[i] ^= 0x36
- k_opad[i] ^= 0x5c
+ k_ipad[i] = (k_ipad[i].ord ^ 0x36).chr
+ k_opad[i] = (k_opad[i].ord ^ 0x5c).chr
end
digest = Digest::MD5.digest(k_ipad + text)