summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-22 21:12:03 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-22 21:12:03 +0000
commit8fe0f23965b78cbc044f8c0d3feb54f0b7e453a2 (patch)
treed7f5195e0a2f836b683c87d6d9bf6dc53283b065
parent0502fcc1d143e95b8f563cc310c960e8d01df8f5 (diff)
downloadruby-8fe0f23965b78cbc044f8c0d3feb54f0b7e453a2.tar.gz
ruby-8fe0f23965b78cbc044f8c0d3feb54f0b7e453a2.tar.xz
ruby-8fe0f23965b78cbc044f8c0d3feb54f0b7e453a2.zip
* ext/openssl/lib/digest.rb: added SHA224, SHA256, SHA384 and SHA512.
these features are enabled if this library is compiled with OpenSSL 0.9.8 or later. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--ext/openssl/lib/openssl/digest.rb9
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 55da807d5..cfb299b3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Aug 23 06:07:02 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/lib/digest.rb: added SHA224, SHA256, SHA384 and SHA512.
+ these features are enabled if this library is compiled with
+ OpenSSL 0.9.8 or later.
+
Tue Aug 23 05:47:04 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ns_spki.c (ossl_spki_initialize): try to decode
diff --git a/ext/openssl/lib/openssl/digest.rb b/ext/openssl/lib/openssl/digest.rb
index 58622f543..5745661c3 100644
--- a/ext/openssl/lib/openssl/digest.rb
+++ b/ext/openssl/lib/openssl/digest.rb
@@ -21,8 +21,13 @@
module OpenSSL
module Digest
- %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1).each{|digest|
- eval(<<-EOD)
+ alg = %w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1)
+ if OPENSSL_VERSION_NUMBER > 0x00908000
+ alg += %w(SHA224 SHA256 SHA384 SHA512)
+ end
+
+ alg.each{|digest|
+ self.module_eval(<<-EOD)
class #{digest} < Digest
def initialize(data=nil)
super(\"#{digest}\", data)