1.9 net/smtp.rb cram_md5

e$BEOJUE/Li$G$9!#e(B

ruby 1.9 e$B$Ne(B net/smtp.rb e$B$K$Fe(B CRAM-MD5
e$B$N%a!<%kAw?.$,%(%i!<e(B
e$B$K$J$j$^$7$?!#DL?.@h$Oe(B @nifty e$B$K$J$j$^$9!#e(B


$ ruby -v
ruby 1.9.0 (2007-05-07 patchlevel 0) [i686-linux]

e$B<!$N%Q%C%A$G%a!<%k$rAw$k$3$H$,$G$-$^$7$?$N$G!"$*CN$i$;$7$^e(B
e$B$9!#e(B

smtp.rb.org 2007-04-15 01:53:25.000000000 +0900
+++ smtp.rb 2007-05-07 22:50:16.000000000 +0900
@@ -745,7 +745,7 @@
def auth_cram_md5(user, secret)
check_auth_args user, secret
res = critical {

  •    check_auth_continue get_response('AUTH CRAM-MD5')
    
  •    res = check_auth_continue get_response('AUTH CRAM-MD5')
       crammed = cram_md5_response(secret, res.cram_md5_challenge)
       get_response(base64_encode("#{user} #{crammed}"))
     }
    

@@ -793,7 +793,7 @@
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
    

@@ -943,6 +943,7 @@
unless res.continue?
raise res.exception_class, res.message
end

  •  res
    

    end

    class Response

e$B@DLZ$G$9!#e(B

On 2007/05/07, at 23:02, WATANABE Tetsuya wrote:

e$BEOJUE/Li$G$9!#e(B

ruby 1.9 e$B$Ne(B net/smtp.rb e$B$K$Fe(B CRAM-MD5 e$B$N%a!<%kAw?.e(B
e$B$,%(%i!<e(B
e$B$K$J$j$^$7$?!#DL?.@h$Oe(B @nifty e$B$K$J$j$^$9!#e(B

e$B<!$N%Q%C%A$G%a!<%k$rAw$k$3$H$,$G$-$^$7$?$N$G!"$*CN$i$;$7$^e(B
e$B$9!#e(B

e$B%Q%C%A$"$j$,$H$&$4$6$$$^$9!#e(B
e$BBgJQCY$/$J$j$^$7$?$,BP1~$7$^$7$?!#e(B

e$BEOJUE/Li$G$9!#e(B

e$B@DLZ$5$s!“BP1~$”$j$,$H$&$4$6$$$^$9!#e(B

smtp.rb e$B$de(B pop.rb e$B$$$D$b;H$o$;$F$b$i$C$F$$$^$9!#e(B

In message “[ruby-dev:30797] Re: 1.9 net/smtp.rb cram_md5”
on 07/05/21, Minero A. e$B$5$se(B writes:

|e$B@DLZ$G$9!#e(B

|e$B%Q%C%A$"$j$,$H$&$4$6$$$^$9!#e(B
|e$BBgJQCY$/$J$j$^$7$?$,BP1~$7$^$7$?!#e(B