summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorNobuhiro IMAI <nov@yo.rim.or.jp>2022-08-05 18:42:06 +0900
committerKazuki Yamaguchi <k@rhe.jp>2022-10-17 16:35:35 +0900
commita98096349ec7280edabf3822d2c6932ac6e63634 (patch)
tree03df05a79ed6729b2a285a140e5b7205360075ac /test/openssl
parentc865e8d161f40c6e9cce411c92e313a91b14124e (diff)
downloadruby-a98096349ec7280edabf3822d2c6932ac6e63634.tar.gz
[ruby/openssl] Check if the option is an Hash in `pkey_ctx_apply_options0()`
causes SEGV if it is an Array or something like that. https://github.com/ruby/openssl/commit/ef23525210
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_pkey_rsa.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/openssl/test_pkey_rsa.rb b/test/openssl/test_pkey_rsa.rb
index 4bb39ed4a6..fa84b76f4b 100644
--- a/test/openssl/test_pkey_rsa.rb
+++ b/test/openssl/test_pkey_rsa.rb
@@ -108,6 +108,11 @@ class OpenSSL::TestPKeyRSA < OpenSSL::PKeyTestCase
salt_length: 20, mgf1_hash: "SHA1")
# Defaults to PKCS #1 v1.5 padding => verification failure
assert_equal false, key.verify("SHA256", sig_pss, data)
+
+ # option type check
+ assert_raise_with_message(TypeError, /expected Hash/) {
+ key.sign("SHA256", data, ["x"])
+ }
end
def test_sign_verify_raw