summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2020-08-08 19:28:11 +0900
committerKazuki Yamaguchi <k@rhe.jp>2021-03-16 19:16:11 +0900
commit08c99a4208af1a50e0ee2446ad4bb235edea00e5 (patch)
treecbd439c668af83bfcbcf18304b02dbab0a963482 /test/openssl
parent88b8b3ac15223d65cf4b40cfc7d193b54b6e2f09 (diff)
[ruby/openssl] x509store: emit warning if arguments are given to X509::Store.new
Anything passed to OpenSSL::X509::Store.new was always ignored. Let's emit an explicit warning to not confuse users. https://github.com/ruby/openssl/commit/d173700eeb
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4275
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_x509store.rb21
1 files changed, 13 insertions, 8 deletions
diff --git a/test/openssl/test_x509store.rb b/test/openssl/test_x509store.rb
index b3212e4bd4..4b02e6664f 100644
--- a/test/openssl/test_x509store.rb
+++ b/test/openssl/test_x509store.rb
@@ -16,14 +16,11 @@ class OpenSSL::TestX509Store < OpenSSL::TestCase
@ee2 = OpenSSL::X509::Name.parse("/DC=org/DC=ruby-lang/CN=EE2")
end
- def test_nosegv_on_cleanup
- cert = OpenSSL::X509::Certificate.new
- store = OpenSSL::X509::Store.new
- ctx = OpenSSL::X509::StoreContext.new(store, cert, [])
- EnvUtil.suppress_warning do
- ctx.cleanup
- end
- ctx.verify
+ def test_store_new
+ # v2.3.0 emits explicit warning
+ assert_warning(/new does not take any arguments/) {
+ OpenSSL::X509::Store.new(123)
+ }
end
def test_add_file_path
@@ -255,6 +252,14 @@ class OpenSSL::TestX509Store < OpenSSL::TestCase
ctx = OpenSSL::X509::StoreContext.new(store)
assert_raise(NoMethodError) { ctx.dup }
end
+
+ def test_ctx_cleanup
+ # Deprecated in Ruby 1.9.3
+ cert = OpenSSL::X509::Certificate.new
+ store = OpenSSL::X509::Store.new
+ ctx = OpenSSL::X509::StoreContext.new(store, cert, [])
+ assert_warning(/cleanup/) { ctx.cleanup }
+ end
end
end