diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-08-09 07:56:30 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-08-09 07:56:30 +0000 |
| commit | 5629b5b4f6c71cbd752d0d489181e77ac6e666dd (patch) | |
| tree | e170f7ce7f9363c5f77264196cfd706780107de4 /lib/net | |
| parent | 03acb264f50437aa6a566e1359b418afb3e5d8cb (diff) | |
| download | ruby-5629b5b4f6c71cbd752d0d489181e77ac6e666dd.tar.gz ruby-5629b5b4f6c71cbd752d0d489181e77ac6e666dd.tar.xz ruby-5629b5b4f6c71cbd752d0d489181e77ac6e666dd.zip | |
* 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]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
| -rw-r--r-- | lib/net/smtp.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/net/smtp.rb b/lib/net/smtp.rb index 5becf2b36..f68c47a9a 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) |
