summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-30 18:21:39 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-30 18:21:39 +0000
commit907911fedadd71950413f555342bcb8a18252553 (patch)
treee6d1224b20f87d8d7cae95775ecdbabf04fc9522 /test/openssl
parent8f77ea14b47ae50245e32e4f895f681a0d8aebdf (diff)
* ext/openssl/ossl_ssl.c (ossl_ssl_read): take optional second argument
to specify a string to be written. * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#read): take optional second argument to specify a string to be written. * ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#gets): refine regexp for end-of-line. * ext/opnessl/lib/openssl/ssl.rb (OpenSSL::SSL::SocketForwarder#listen): fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_ssl.rb2
-rw-r--r--test/openssl/test_x509name.rb30
-rw-r--r--test/openssl/test_x509store.rb3
-rw-r--r--test/openssl/utils.rb2
4 files changed, 27 insertions, 10 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 3ca25cbfe1..55f7920313 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -61,7 +61,7 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
cmd << "-d" if $DEBUG
cmd << SSL_SERVER << port.to_s << verify_mode.to_s
cmd << (start_immediately ? "yes" : "no")
- server = IO.popen(cmd, "w+")
+ server = IO.popen(cmd.join(" "), "w+")
server.write(@ca_cert.to_pem)
server.write(@svr_cert.to_pem)
server.write(@svr_key.to_pem)
diff --git a/test/openssl/test_x509name.rb b/test/openssl/test_x509name.rb
index 0fbe2c2569..14004a4e20 100644
--- a/test/openssl/test_x509name.rb
+++ b/test/openssl/test_x509name.rb
@@ -76,12 +76,21 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
]
name = OpenSSL::X509::Name.new(dn)
ary = name.to_a
- assert_equal("/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/emailAddress=gotoyuzo@ruby-lang.org/serialNumber=123", name.to_s)
+ if OpenSSL::OPENSSL_VERSION_NUMBER < 0x00907000
+ assert_equal("/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/Email=gotoyuzo@ruby-lang.org/SN=123", name.to_s)
+ else
+ assert_equal("/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/emailAddress=gotoyuzo@ruby-lang.org/serialNumber=123", name.to_s)
+ end
assert_equal("DC", ary[0][0])
assert_equal("DC", ary[1][0])
assert_equal("CN", ary[2][0])
- assert_equal("emailAddress", ary[3][0])
- assert_equal("serialNumber", ary[4][0])
+ if OpenSSL::OPENSSL_VERSION_NUMBER < 0x00907000
+ assert_equal("Email", ary[3][0])
+ assert_equal("SN", ary[4][0])
+ else
+ assert_equal("emailAddress", ary[3][0])
+ assert_equal("serialNumber", ary[4][0])
+ end
assert_equal("org", ary[0][1])
assert_equal("ruby-lang", ary[1][1])
assert_equal("GOTOU Yuuzou", ary[2][1])
@@ -140,12 +149,21 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
name = OpenSSL::X509::Name.new
dn.each{|attr| name.add_entry(*attr) }
ary = name.to_a
- assert_equal("/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/emailAddress=gotoyuzo@ruby-lang.org/serialNumber=123", name.to_s)
+ if OpenSSL::OPENSSL_VERSION_NUMBER < 0x00907000
+ assert_equal("/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/Email=gotoyuzo@ruby-lang.org/SN=123", name.to_s)
+ else
+ assert_equal("/DC=org/DC=ruby-lang/CN=GOTOU Yuuzou/emailAddress=gotoyuzo@ruby-lang.org/serialNumber=123", name.to_s)
+ end
assert_equal("DC", ary[0][0])
assert_equal("DC", ary[1][0])
assert_equal("CN", ary[2][0])
- assert_equal("emailAddress", ary[3][0])
- assert_equal("serialNumber", ary[4][0])
+ if OpenSSL::OPENSSL_VERSION_NUMBER < 0x00907000
+ assert_equal("Email", ary[3][0])
+ assert_equal("SN", ary[4][0])
+ else
+ assert_equal("emailAddress", ary[3][0])
+ assert_equal("serialNumber", ary[4][0])
+ end
assert_equal("org", ary[0][1])
assert_equal("ruby-lang", ary[1][1])
assert_equal("GOTOU Yuuzou", ary[2][1])
diff --git a/test/openssl/test_x509store.rb b/test/openssl/test_x509store.rb
index d17a7133b2..0887bf6ea9 100644
--- a/test/openssl/test_x509store.rb
+++ b/test/openssl/test_x509store.rb
@@ -109,8 +109,7 @@ class OpenSSL::TestX509Store < Test::Unit::TestCase
store = OpenSSL::X509::Store.new
store.purpose = OpenSSL::X509::PURPOSE_ANY
- store.flags =
- OpenSSL::X509::V_FLAG_CRL_CHECK #|OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
+ store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK
store.add_cert(ca1_cert)
store.add_crl(crl1) # revoke no cert
store.add_crl(crl2) # revoke ee2_cert
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 8c0d34c938..c923705b86 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -99,8 +99,8 @@ Q1VB8qkJN7rA7/2HrCR3gTsWNb1YhAsnFsoeRscC+LxXoXi9OAIUBG98h4tilg6S
def issue_crl(revoke_info, serial, lastup, nextup, extensions,
issuer, issuer_key, digest)
crl = OpenSSL::X509::CRL.new
- crl.version = 1
crl.issuer = issuer.subject
+ crl.version = 1
crl.last_update = lastup
crl.next_update = nextup
revoke_info.each{|serial, time, reason_code|