summaryrefslogtreecommitdiff
path: root/test/openssl/test_x509name.rb
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-24 16:57:44 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-05-24 16:57:44 +0000
commit5059c5a53b290b3772767ff8ab5f0c0d2db7e08d (patch)
tree55931a86b38b58cc913cd11ef8f1d9de10977fe9 /test/openssl/test_x509name.rb
parent3216cb5839b0e61aedd505cff1d783e15b306e90 (diff)
* test/openssl/test_x509name.rb: short names of some OIDs (serialNumber
and emailAddress) are mismatched between OpenSSL 0.9.6 and 0.9.7. * test/openssl/test_x509store.rb: get rid of unused flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_x509name.rb')
-rw-r--r--test/openssl/test_x509name.rb30
1 files changed, 24 insertions, 6 deletions
diff --git a/test/openssl/test_x509name.rb b/test/openssl/test_x509name.rb
index 0fbe2c2569d..14004a4e20d 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])