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