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)
14
14
15
15
def set_pqg ( p , q , g )
16
16
self . p = p
17
- if respond_to? ( :q )
17
+ if respond_to? ( :q= )
18
18
self . q = q
19
- else # TODO self.q = q
19
+ else
20
20
OpenSSL . warn "JRuby-OpenSSL does not support setting q param on #{ inspect } " if q
21
21
end
22
22
self . g = g
Original file line number Diff line number Diff line change @@ -83,6 +83,20 @@ def test_pkey_pem_file_error
83
83
end
84
84
end
85
85
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
+
86
100
def test_to_java
87
101
pkey = OpenSSL ::PKey . read ( KEY )
88
102
assert_kind_of java . security . PublicKey , pkey . to_java
You can’t perform that action at this time.
0 commit comments