aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2022-09-08 15:37:15 +0900
committerGitHub <noreply@github.com>2022-09-08 15:37:15 +0900
commitf54b5e568273a9e29782dfd86f0367721e6cb24a (patch)
tree66159c0e3e05d1bb93c1728efab3d426357d1ab5 /test
parent9302d4863d9762c3196b724f605dcd5c7ca84a8b (diff)
parentf6ee0fa4dee17f586eeaa0c1ca533c73c51ca9f7 (diff)
downloadruby-openssl-f54b5e568273a9e29782dfd86f0367721e6cb24a.tar.gz
Merge pull request #541 from rhenium/ky/pkey-ec-export-segfault-regression
pkey/ec: check existence of public key component before exporting
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_pkey_ec.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/openssl/test_pkey_ec.rb b/test/openssl/test_pkey_ec.rb
index 23c6c4d4..9a4818de 100644
--- a/test/openssl/test_pkey_ec.rb
+++ b/test/openssl/test_pkey_ec.rb
@@ -61,8 +61,10 @@ class OpenSSL::TestEC < OpenSSL::PKeyTestCase
def test_generate_key
ec = OpenSSL::PKey::EC.new("prime256v1")
assert_equal false, ec.private?
+ assert_raise(OpenSSL::PKey::ECError) { ec.to_der }
ec.generate_key!
assert_equal true, ec.private?
+ assert_nothing_raised { ec.to_der }
end if !openssl?(3, 0, 0)
def test_marshal