diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/net/smtp.rb | 6 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Wed Aug 9 16:53:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/net/smtp.rb (Net::SMTP::auth_cram_md5): use ord to retrieve + bytes from strings. a patch from WATANABE Tetsuya + <Tetsuya.WATANABE at nifty.com>. [ruby-dev:29240] + Tue Aug 8 23:49:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/irb/extend-command.rb (IRB::ExtendCommandBundle): pacify diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 5becf2b36b..f68c47a9a7 100644 --- a/lib/net/smtp.rb +++ b/lib/net/smtp.rb @@ -699,8 +699,10 @@ module Net isecret = secret + "\0" * (64 - secret.size) osecret = isecret.dup 0.upto(63) do |i| - isecret[i] ^= 0x36 - osecret[i] ^= 0x5c + c = isecret[i].ord ^ 0x36 + isecret[i] = c.chr + c = osecret[i].ord ^ 0x5c + osecret[i] = c.chr end tmp = Digest::MD5.digest(isecret + challenge) tmp = Digest::MD5.hexdigest(osecret + tmp) |