File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ def set_key(pub_key, priv_key)
1414
1515 def set_pqg ( p , q , g )
1616 self . p = p
17- if respond_to? ( :q )
17+ if respond_to? ( :q= )
1818 self . q = q
19- else # TODO self.q = q
19+ else
2020 OpenSSL . warn "JRuby-OpenSSL does not support setting q param on #{ inspect } " if q
2121 end
2222 self . g = g
Original file line number Diff line number Diff line change @@ -83,6 +83,20 @@ def test_pkey_pem_file_error
8383 end
8484 end
8585
86+ def test_pkey_dh
87+ dh = OpenSSL ::PKey ::DH . new
88+ assert_equal nil , dh . p
89+ assert_equal nil , dh . priv_key
90+
91+ # OpenSSL::PKey::PKeyError: dh#set_pqg= is incompatible with OpenSSL 3.0
92+ if defined? JRUBY_VERSION
93+ dh . set_pqg ( 1_000_000 , nil , 10 )
94+ assert_equal 1_000_000 , dh . p
95+ assert_equal 10 , dh . g
96+ end
97+ assert_equal nil , dh . q
98+ end
99+
86100 def test_to_java
87101 pkey = OpenSSL ::PKey . read ( KEY )
88102 assert_kind_of java . security . PublicKey , pkey . to_java
You can’t perform that action at this time.
0 commit comments