1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Support OpenSSL 1.1; it supports RSA1024 and DSS1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-12-25 09:02:03 +00:00
parent e271684d2f
commit 9ff4e23741
2 changed files with 21 additions and 4 deletions

View file

@ -153,10 +153,18 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
cert.not_after = Time.now cert.not_after = Time.now
assert_equal(false, cert.verify(@dsa512)) assert_equal(false, cert.verify(@dsa512))
assert_raise(OpenSSL::X509::CertificateError){ begin
cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [], cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
nil, nil, OpenSSL::Digest::DSS1.new) 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){ assert_raise(OpenSSL::X509::CertificateError){
cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [], cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
nil, nil, OpenSSL::Digest::MD5.new) nil, nil, OpenSSL::Digest::MD5.new)

View file

@ -123,8 +123,17 @@ class OpenSSL::TestX509Request < Test::Unit::TestCase
req.public_key = @rsa1024.public_key req.public_key = @rsa1024.public_key
assert_equal(false, req.verify(@dsa512)) assert_equal(false, req.verify(@dsa512))
assert_raise(OpenSSL::X509::RequestError){ begin
issue_csr(0, @dn, @rsa1024, OpenSSL::Digest::DSS1.new) } req = issue_csr(0, @dn, @rsa1024, OpenSSL::Digest::DSS1.new)
assert_equal(true, req.verify(@rsa1024))
assert_equal(false, req.verify(@rsa2048))
assert_equal(false, request_error_returns_false { req.verify(@dsa256) })
assert_equal(false, request_error_returns_false { req.verify(@dsa512) })
req.version = 1
assert_equal(false, req.verify(@rsa1024))
rescue OpenSSL::X509::RequestError
end
assert_raise(OpenSSL::X509::RequestError){ assert_raise(OpenSSL::X509::RequestError){
issue_csr(0, @dn, @dsa512, OpenSSL::Digest::MD5.new) } issue_csr(0, @dn, @dsa512, OpenSSL::Digest::MD5.new) }
end end