moriqe$B$G$9!#e(B
e$B<!$N$h$&$Ke(B RubyGems e$B$Ge(B require ‘md5’ e$B$r;H$C$F$$$k$N$Ge(B
ruby-1.8.6 e$B$K>e$2$k$H$&$^$/$$$+$J$/$J$j$=$&$G$9!#e(B
rubygems-0.9.2/lib/rubygems/validator.rb:
##
# Given a gem file's contents, validates against its own MD5
checksum
# gem_data:: [String] Contents of the gem file
def verify_gem(gem_data)
if(gem_data.size == 0) then
raise VerificationError.new(“Empty Gem file”)
end
require ‘md5’
unless(gem_data =~ /MD5SUM/m)
return # Don’t worry about it…this sucks. Need to fix MD5
stuff for
# new format
# FIXME
end
unless (MD5.md5(gem_data.gsub(/MD5SUM = “([a-z0-9]+)”/, “MD5SUM =
“” + (“F” * 32) + “””)) == $1.to_s)
raise VerificationError.new(“Invalid checksum for Gem file”)
end
end
e$B<!$NBP1~$rDs0F$7$^$9!#e(B
— ext/digest/lib/md5.rb Tue Feb 13 08:01:19 2007
+++ ext/digest/lib/md5.rb.new Tue Mar 6 17:21:53 2007
@@ -9,6 +9,6 @@
class MD5
def self.md5(*args)
- new.update(*args)
end
end
At Tue, 6 Mar 2007 17:37:28 +0900,
Kazuhiro Y. wrote:
moriqã§ã™ã€‚
次ã®ã‚ˆã†ã« RubyGems ã§ require ‘md5’ を使ã£ã¦ã„ã‚‹ã®ã§
ruby-1.8.6 ã«ä¸Šã’ã‚‹ã¨ã†ã¾ãã„ã‹ãªããªã‚Šãã†ã§ã™ã€‚
(snip)
end
end
確ã‹ã«ã€‚ナイスã‚ãƒ£ãƒƒãƒæ„Ÿè¬ã—ã¾ã™ã€‚
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”
At Tue, 6 Mar 2007 18:14:46 +0900,
I wrote:
At Tue, 6 Mar 2007 17:37:28 +0900,
Kazuhiro Y. wrote:
moriqã§ã™ã€‚
次ã®ã‚ˆã†ã« RubyGems ã§ require ‘md5’ を使ã£ã¦ã„ã‚‹ã®ã§
ruby-1.8.6 ã«ä¸Šã’ã‚‹ã¨ã†ã¾ãã„ã‹ãªããªã‚Šãã†ã§ã™ã€‚
(snip)
次ã®å¯¾å¿œã‚’ææ¡ˆã—ã¾ã™ã€‚
 MD5.new(“str”) ã‚‚å‹•ãよã†ã«ã—ã¾ã—ãŸã€‚new ã‚’ç½®ãæ›ãˆã¦ã—ã¾ã†ã®ã§ã€
MD5 㯠Digest::MD5 を指ã™ã®ã§ã¯ãªãサブクラスã«ã—ã¾ã—ãŸã€‚
 ã¾ãŸã€ sha1 ã«ã‚‚åŒæ§˜ã®å¤‰æ›´ã‚’åŠ ãˆã¾ã—ãŸã€‚
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”