mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
aamine
* lib/net/smtp.rb: uses Digest::MD5 instead of MD5 (again). * lib/net/pop.rb: ditto. * lib/net/http.rb (HTTP#request): must pass block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9a697aeb95
commit
772678cb7a
8 changed files with 24 additions and 16 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
Fri Dec 7 19:20:44 2001 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* lib/net/smtp.rb: uses Digest::MD5 instead of MD5 (again).
|
||||||
|
|
||||||
|
* lib/net/pop.rb: ditto.
|
||||||
|
|
||||||
|
* lib/net/http.rb (HTTP#request): must pass block.
|
||||||
|
|
||||||
Fri Dec 7 18:47:54 2001 Minero Aoki <aamine@loveruby.net>
|
Fri Dec 7 18:47:54 2001 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* lib/net/smtp.rb: SMTP.new requires at least one arg.
|
* lib/net/smtp.rb: SMTP.new requires at least one arg.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/http.rb version 1.1.36
|
= net/http.rb version 1.1.37
|
||||||
|
|
||||||
== このライブラリについて
|
== このライブラリについて
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/pop.rb version 1.1.36
|
= net/pop.rb version 1.1.37
|
||||||
|
|
||||||
== このライブラリについて
|
== このライブラリについて
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/smtp.rb version 1.1.36
|
= net/smtp.rb version 1.1.37
|
||||||
|
|
||||||
== このライブラリについて
|
== このライブラリについて
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/http.rb version 1.1.36
|
= net/http.rb version 1.1.37
|
||||||
|
|
||||||
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
||||||
|
|
||||||
|
|
@ -591,11 +591,11 @@ module Net
|
||||||
define_http_method_interface :Post, true, true
|
define_http_method_interface :Post, true, true
|
||||||
define_http_method_interface :Put, false, true
|
define_http_method_interface :Put, false, true
|
||||||
|
|
||||||
def request( req, body = nil )
|
def request( req, body = nil, &block )
|
||||||
unless active? then
|
unless active? then
|
||||||
start {
|
start {
|
||||||
req['connection'] = 'close'
|
req['connection'] = 'close'
|
||||||
return request(req, body)
|
return request(req, body, &block)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/pop.rb version 1.1.36
|
= net/pop.rb version 1.1.37
|
||||||
|
|
||||||
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
||||||
|
|
||||||
|
|
@ -287,7 +287,7 @@ A class of mail which exists on POP server.
|
||||||
=end
|
=end
|
||||||
|
|
||||||
require 'net/protocol'
|
require 'net/protocol'
|
||||||
require 'md5'
|
require 'digest/md5'
|
||||||
|
|
||||||
|
|
||||||
module Net
|
module Net
|
||||||
|
|
@ -570,7 +570,7 @@ module Net
|
||||||
critical {
|
critical {
|
||||||
@socket.writeline sprintf( 'APOP %s %s',
|
@socket.writeline sprintf( 'APOP %s %s',
|
||||||
account,
|
account,
|
||||||
MD5.new(@stamp + pass).hexdigest )
|
Digest::MD5.hexdigest(@stamp + pass) )
|
||||||
check_reply_auth
|
check_reply_auth
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/protocol.rb version 1.1.36
|
= net/protocol.rb version 1.1.37
|
||||||
|
|
||||||
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ module Net
|
||||||
|
|
||||||
class Protocol
|
class Protocol
|
||||||
|
|
||||||
Version = '1.1.36'
|
Version = '1.1.37'
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
=begin
|
=begin
|
||||||
|
|
||||||
= net/smtp.rb version 1.1.36
|
= net/smtp.rb version 1.1.37
|
||||||
|
|
||||||
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
Copyright (c) 1999-2001 Yukihiro Matsumoto
|
||||||
|
|
||||||
|
|
@ -191,7 +191,7 @@ SMTP objects raise these exceptions:
|
||||||
=end
|
=end
|
||||||
|
|
||||||
require 'net/protocol'
|
require 'net/protocol'
|
||||||
require 'md5'
|
require 'digest/md5'
|
||||||
|
|
||||||
|
|
||||||
module Net
|
module Net
|
||||||
|
|
@ -317,7 +317,7 @@ module Net
|
||||||
critical {
|
critical {
|
||||||
rep = getok( 'AUTH CRAM-MD5', ContinueCode )
|
rep = getok( 'AUTH CRAM-MD5', ContinueCode )
|
||||||
challenge = rep.msg.split(' ')[1].unpack('m')[0]
|
challenge = rep.msg.split(' ')[1].unpack('m')[0]
|
||||||
secret = MD5.new( secret ).digest if secret.size > 64
|
secret = Digest::MD5.digest( secret ) if secret.size > 64
|
||||||
|
|
||||||
isecret = secret + "\0" * (64 - secret.size)
|
isecret = secret + "\0" * (64 - secret.size)
|
||||||
osecret = isecret.dup
|
osecret = isecret.dup
|
||||||
|
|
@ -325,8 +325,8 @@ module Net
|
||||||
isecret[i] ^= 0x36
|
isecret[i] ^= 0x36
|
||||||
osecret[i] ^= 0x5c
|
osecret[i] ^= 0x5c
|
||||||
end
|
end
|
||||||
tmp = MD5.new( isecret + challenge ).digest
|
tmp = Digest::MD5.digest( isecret + challenge )
|
||||||
tmp = MD5.new( osecret + tmp ).hexdigest
|
tmp = Digest::MD5.hexdigest( osecret + tmp )
|
||||||
|
|
||||||
getok [user + ' ' + tmp].pack('m').chomp
|
getok [user + ' ' + tmp].pack('m').chomp
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue