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

* lib/net/smtp.rb: CRAM-MD5 authentication did not work. [ruby-dev:30770]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2007-05-20 18:33:25 +00:00
parent 374e3d42d4
commit 696cbbd7a6
2 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,8 @@
Mon May 21 03:34:06 2007 Minero Aoki <aamine@loveruby.net>
* lib/net/smtp.rb: CRAM-MD5 authentication did not work.
[ruby-dev:30770]
Sat May 19 10:26:01 2007 Tadayoshi Funaba <tadf@dotrb.org>
* lib/date/format.rb (Date._parse): detects some OFX dates

View file

@ -745,8 +745,9 @@ module Net
def auth_cram_md5(user, secret)
check_auth_args user, secret
res = critical {
check_auth_continue get_response('AUTH CRAM-MD5')
crammed = cram_md5_response(secret, res.cram_md5_challenge)
res0 = get_response('AUTH CRAM-MD5')
check_auth_continue res0
crammed = cram_md5_response(secret, res0.cram_md5_challenge)
get_response(base64_encode("#{user} #{crammed}"))
}
check_auth_response res
@ -793,7 +794,7 @@ module Net
def cram_secret(secret, mask)
secret = Digest::MD5.digest(secret) if secret.size > CRAM_BUFSIZE
buf = secret.ljust(CRAM_BUFSIZE, "\0")
0.upto(buf.size) do |i|
0.upto(buf.size - 1) do |i|
buf[i] = (buf[i].ord ^ mask).chr
end
buf
@ -981,7 +982,7 @@ module Net
def capabilities
return {} unless @string[3, 1] == '-'
h = {}
@string.lines.to_a[1..-1].each do |line|
@string.lines.drop(1).each do |line|
k, *v = line[4..-1].chomp.split(nil)
h[k] = v
end