summaryrefslogtreecommitdiff
path: root/test/openssl/test_x509cert.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_x509cert.rb')
-rw-r--r--test/openssl/test_x509cert.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb
index 8b88ad4ddd..786eebb368 100644
--- a/test/openssl/test_x509cert.rb
+++ b/test/openssl/test_x509cert.rb
@@ -153,10 +153,18 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
cert.not_after = Time.now
assert_equal(false, cert.verify(@dsa512))
- assert_raise(OpenSSL::X509::CertificateError){
+ begin
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
nil, nil, OpenSSL::Digest::DSS1.new)
- }
+ assert_equal(false, cert.verify(@rsa1024))
+ assert_equal(true, cert.verify(@rsa2048))
+ assert_equal(false, certificate_error_returns_false { cert.verify(@dsa256) })
+ assert_equal(false, certificate_error_returns_false { cert.verify(@dsa512) })
+ cert.subject = @ee1
+ assert_equal(false, cert.verify(@rsa2048))
+ rescue OpenSSL::X509::CertificateError
+ end
+
assert_raise(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
nil, nil, OpenSSL::Digest::MD5.new)