mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
3216cb5839
commit
5059c5a53b
2 changed files with 25 additions and 8 deletions
|
@ -76,12 +76,21 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
|
||||||
]
|
]
|
||||||
name = OpenSSL::X509::Name.new(dn)
|
name = OpenSSL::X509::Name.new(dn)
|
||||||
ary = name.to_a
|
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[0][0])
|
||||||
assert_equal("DC", ary[1][0])
|
assert_equal("DC", ary[1][0])
|
||||||
assert_equal("CN", ary[2][0])
|
assert_equal("CN", ary[2][0])
|
||||||
assert_equal("emailAddress", ary[3][0])
|
if OpenSSL::OPENSSL_VERSION_NUMBER < 0x00907000
|
||||||
assert_equal("serialNumber", ary[4][0])
|
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("org", ary[0][1])
|
||||||
assert_equal("ruby-lang", ary[1][1])
|
assert_equal("ruby-lang", ary[1][1])
|
||||||
assert_equal("GOTOU Yuuzou", ary[2][1])
|
assert_equal("GOTOU Yuuzou", ary[2][1])
|
||||||
|
@ -140,12 +149,21 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
|
||||||
name = OpenSSL::X509::Name.new
|
name = OpenSSL::X509::Name.new
|
||||||
dn.each{|attr| name.add_entry(*attr) }
|
dn.each{|attr| name.add_entry(*attr) }
|
||||||
ary = name.to_a
|
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[0][0])
|
||||||
assert_equal("DC", ary[1][0])
|
assert_equal("DC", ary[1][0])
|
||||||
assert_equal("CN", ary[2][0])
|
assert_equal("CN", ary[2][0])
|
||||||
assert_equal("emailAddress", ary[3][0])
|
if OpenSSL::OPENSSL_VERSION_NUMBER < 0x00907000
|
||||||
assert_equal("serialNumber", ary[4][0])
|
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("org", ary[0][1])
|
||||||
assert_equal("ruby-lang", ary[1][1])
|
assert_equal("ruby-lang", ary[1][1])
|
||||||
assert_equal("GOTOU Yuuzou", ary[2][1])
|
assert_equal("GOTOU Yuuzou", ary[2][1])
|
||||||
|
|
|
@ -109,8 +109,7 @@ class OpenSSL::TestX509Store < Test::Unit::TestCase
|
||||||
|
|
||||||
store = OpenSSL::X509::Store.new
|
store = OpenSSL::X509::Store.new
|
||||||
store.purpose = OpenSSL::X509::PURPOSE_ANY
|
store.purpose = OpenSSL::X509::PURPOSE_ANY
|
||||||
store.flags =
|
store.flags = OpenSSL::X509::V_FLAG_CRL_CHECK
|
||||||
OpenSSL::X509::V_FLAG_CRL_CHECK #|OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
|
|
||||||
store.add_cert(ca1_cert)
|
store.add_cert(ca1_cert)
|
||||||
store.add_crl(crl1) # revoke no cert
|
store.add_crl(crl1) # revoke no cert
|
||||||
store.add_crl(crl2) # revoke ee2_cert
|
store.add_crl(crl2) # revoke ee2_cert
|
||||||
|
|
Loading…
Reference in a new issue