summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--ext/openssl/lib/openssl/x509-internal.rb1
-rw-r--r--test/openssl/test_pair.rb1
-rw-r--r--test/openssl/test_pkcs7.rb10
-rw-r--r--test/openssl/test_ssl.rb13
-rw-r--r--test/openssl/test_x509name.rb4
6 files changed, 22 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index bd743d9eb0..400be6f252 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Sep 10 17:49:34 2010 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * ext/openssl/lib/openssl/x509-internal.rb: removed unused local
+ variable.
+
+ * test/openssl/*: less warnings while test running with -w.
+
Fri Sep 10 16:49:20 2010 Akinori MUSHA <knu@iDaemons.org>
* class.c (rb_scan_args): Add support for optional keyword
diff --git a/ext/openssl/lib/openssl/x509-internal.rb b/ext/openssl/lib/openssl/x509-internal.rb
index c3de83be66..11dc2f2722 100644
--- a/ext/openssl/lib/openssl/x509-internal.rb
+++ b/ext/openssl/lib/openssl/x509-internal.rb
@@ -109,7 +109,6 @@ module OpenSSL
ary = []
while true
if md = TypeAndValue.match(str)
- matched = md.to_s
remain = md.post_match
type = md[1]
value, tag = expand_value(md[2], md[3], md[4]) rescue nil
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index d25a59b740..0f54e5b893 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -195,7 +195,6 @@ class OpenSSL::TestPair < Test::Unit::TestCase
ctx = OpenSSL::SSL::SSLContext.new()
ctx.ciphers = "ADH"
serv = TCPServer.new(host, port)
- ssls = OpenSSL::SSL::SSLServer.new(serv, ctx)
port = serv.connect_address.ip_port
diff --git a/test/openssl/test_pkcs7.rb b/test/openssl/test_pkcs7.rb
index 85e9b89b55..fa71b9e938 100644
--- a/test/openssl/test_pkcs7.rb
+++ b/test/openssl/test_pkcs7.rb
@@ -22,16 +22,16 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
["subjectKeyIdentifier","hash",false],
["authorityKeyIdentifier","keyid:always",false],
]
- @ca_cert = issue_cert(ca, @rsa2048, 1, Time.now, Time.now+3600, ca_exts,
+ @ca_cert = issue_cert(ca, @rsa2048, 1, now, now+3600, ca_exts,
nil, nil, OpenSSL::Digest::SHA1.new)
ee_exts = [
["keyUsage","Non Repudiation, Digital Signature, Key Encipherment",true],
["authorityKeyIdentifier","keyid:always",false],
["extendedKeyUsage","clientAuth, emailProtection, codeSigning",false],
]
- @ee1_cert = issue_cert(ee1, @rsa1024, 2, Time.now, Time.now+1800, ee_exts,
+ @ee1_cert = issue_cert(ee1, @rsa1024, 2, now, now+1800, ee_exts,
@ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
- @ee2_cert = issue_cert(ee2, @rsa1024, 3, Time.now, Time.now+1800, ee_exts,
+ @ee2_cert = issue_cert(ee2, @rsa1024, 3, now, now+1800, ee_exts,
@ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
end
@@ -109,7 +109,9 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
flag = OpenSSL::PKCS7::BINARY|OpenSSL::PKCS7::DETACHED
tmp = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, ca_certs, flag)
p7 = OpenSSL::PKCS7.new(tmp.to_der)
- a1 = OpenSSL::ASN1.decode(p7)
+ assert_nothing_raised do
+ OpenSSL::ASN1.decode(p7)
+ end
certs = p7.certificates
signers = p7.signers
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 558bf1bce4..73c35c0749 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -286,12 +286,13 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ssl.sync_close = true
str = "x" * 1000 + "\n"
- ITERATIONS.times{
- ssl.puts(str)
- assert_equal(str, ssl.gets)
- }
-
- starttls(ssl)
+ OpenSSL::TestUtils.silent do
+ ITERATIONS.times{
+ ssl.puts(str)
+ assert_equal(str, ssl.gets)
+ }
+ starttls(ssl)
+ end
ITERATIONS.times{
ssl.puts(str)
diff --git a/test/openssl/test_x509name.rb b/test/openssl/test_x509name.rb
index fb5a1ae4ff..292a59f612 100644
--- a/test/openssl/test_x509name.rb
+++ b/test/openssl/test_x509name.rb
@@ -120,14 +120,14 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
assert_equal(OpenSSL::ASN1::UTF8STRING, ary[2][2])
dn2 = "DC=org, DC=ruby-lang, CN=www.ruby-lang.org"
- name = OpenSSL::X509::Name.parse(dn)
+ name = OpenSSL::X509::Name.parse(dn2)
ary = name.to_a
assert_equal(dn, name.to_s)
assert_equal("org", ary[0][1])
assert_equal("ruby-lang", ary[1][1])
assert_equal("www.ruby-lang.org", ary[2][1])
- name = OpenSSL::X509::Name.parse(dn, @obj_type_tmpl)
+ name = OpenSSL::X509::Name.parse(dn2, @obj_type_tmpl)
ary = name.to_a
assert_equal(OpenSSL::ASN1::IA5STRING, ary[0][2])
assert_equal(OpenSSL::ASN1::IA5STRING, ary[1][2])