* ext/openssl/lib/openssl/x509-internal.rb: removed unused local

variable.

        * test/openssl/*: less warnings while test running with -w.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2010-09-10 08:54:50 +00:00
Родитель cb81b56de2
Коммит 7f438d8402
6 изменённых файлов: 22 добавлений и 14 удалений

Просмотреть файл

@ -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> Fri Sep 10 16:49:20 2010 Akinori MUSHA <knu@iDaemons.org>
* class.c (rb_scan_args): Add support for optional keyword * class.c (rb_scan_args): Add support for optional keyword

Просмотреть файл

@ -109,7 +109,6 @@ module OpenSSL
ary = [] ary = []
while true while true
if md = TypeAndValue.match(str) if md = TypeAndValue.match(str)
matched = md.to_s
remain = md.post_match remain = md.post_match
type = md[1] type = md[1]
value, tag = expand_value(md[2], md[3], md[4]) rescue nil value, tag = expand_value(md[2], md[3], md[4]) rescue nil

Просмотреть файл

@ -195,7 +195,6 @@ class OpenSSL::TestPair < Test::Unit::TestCase
ctx = OpenSSL::SSL::SSLContext.new() ctx = OpenSSL::SSL::SSLContext.new()
ctx.ciphers = "ADH" ctx.ciphers = "ADH"
serv = TCPServer.new(host, port) serv = TCPServer.new(host, port)
ssls = OpenSSL::SSL::SSLServer.new(serv, ctx)
port = serv.connect_address.ip_port port = serv.connect_address.ip_port

Просмотреть файл

@ -22,16 +22,16 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
["subjectKeyIdentifier","hash",false], ["subjectKeyIdentifier","hash",false],
["authorityKeyIdentifier","keyid:always",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) nil, nil, OpenSSL::Digest::SHA1.new)
ee_exts = [ ee_exts = [
["keyUsage","Non Repudiation, Digital Signature, Key Encipherment",true], ["keyUsage","Non Repudiation, Digital Signature, Key Encipherment",true],
["authorityKeyIdentifier","keyid:always",false], ["authorityKeyIdentifier","keyid:always",false],
["extendedKeyUsage","clientAuth, emailProtection, codeSigning",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) @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) @ca_cert, @rsa2048, OpenSSL::Digest::SHA1.new)
end end
@ -109,7 +109,9 @@ class OpenSSL::TestPKCS7 < Test::Unit::TestCase
flag = OpenSSL::PKCS7::BINARY|OpenSSL::PKCS7::DETACHED flag = OpenSSL::PKCS7::BINARY|OpenSSL::PKCS7::DETACHED
tmp = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, ca_certs, flag) tmp = OpenSSL::PKCS7.sign(@ee1_cert, @rsa1024, data, ca_certs, flag)
p7 = OpenSSL::PKCS7.new(tmp.to_der) p7 = OpenSSL::PKCS7.new(tmp.to_der)
a1 = OpenSSL::ASN1.decode(p7) assert_nothing_raised do
OpenSSL::ASN1.decode(p7)
end
certs = p7.certificates certs = p7.certificates
signers = p7.signers signers = p7.signers

Просмотреть файл

@ -286,12 +286,13 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
ssl.sync_close = true ssl.sync_close = true
str = "x" * 1000 + "\n" str = "x" * 1000 + "\n"
ITERATIONS.times{ OpenSSL::TestUtils.silent do
ssl.puts(str) ITERATIONS.times{
assert_equal(str, ssl.gets) ssl.puts(str)
} assert_equal(str, ssl.gets)
}
starttls(ssl) starttls(ssl)
end
ITERATIONS.times{ ITERATIONS.times{
ssl.puts(str) ssl.puts(str)

Просмотреть файл

@ -120,14 +120,14 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
assert_equal(OpenSSL::ASN1::UTF8STRING, ary[2][2]) assert_equal(OpenSSL::ASN1::UTF8STRING, ary[2][2])
dn2 = "DC=org, DC=ruby-lang, CN=www.ruby-lang.org" 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 ary = name.to_a
assert_equal(dn, name.to_s) assert_equal(dn, name.to_s)
assert_equal("org", ary[0][1]) assert_equal("org", ary[0][1])
assert_equal("ruby-lang", ary[1][1]) assert_equal("ruby-lang", ary[1][1])
assert_equal("www.ruby-lang.org", ary[2][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 ary = name.to_a
assert_equal(OpenSSL::ASN1::IA5STRING, ary[0][2]) assert_equal(OpenSSL::ASN1::IA5STRING, ary[0][2])
assert_equal(OpenSSL::ASN1::IA5STRING, ary[1][2]) assert_equal(OpenSSL::ASN1::IA5STRING, ary[1][2])