Skip to content

Commit 888eb19

Browse files
committed
[refactor] move _compat23.rb left-overs to native
1 parent 53901e5 commit 888eb19

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

lib/jopenssl/_compat23.rb

Lines changed: 0 additions & 30 deletions
This file was deleted.

lib/jopenssl/load.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,3 @@ def self.secure_compare(a, b)
6969
OpenSSL.fixed_length_secure_compare(hashed_a, hashed_b) && a == b
7070
end
7171
end
72-
73-
load 'jopenssl/_compat23.rb'

src/main/java/org/jruby/ext/openssl/PKeyDH.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,16 @@ public IRubyObject q(final ThreadContext context) {
381381
return context.nil;
382382
}
383383

384+
@JRubyMethod
385+
public IRubyObject set_pqg(final ThreadContext context, IRubyObject p, IRubyObject q, IRubyObject g) {
386+
set_p(p);
387+
if (!q.isNil()) {
388+
OpenSSL.warn(context, "JRuby-OpenSSL does not support setting q param on " + inspect());
389+
}
390+
set_g(g);
391+
return this;
392+
}
393+
384394
// don't need synchronized as value is volatile
385395
@JRubyMethod(name = "pub_key")
386396
public IRubyObject pub_key() {
@@ -421,6 +431,13 @@ public synchronized IRubyObject set_priv_key(IRubyObject arg) {
421431
return arg;
422432
}
423433

434+
@JRubyMethod
435+
public IRubyObject set_key(final ThreadContext context, IRubyObject pub_key, IRubyObject priv_key) {
436+
set_pub_key(pub_key);
437+
set_priv_key(priv_key);
438+
return this;
439+
}
440+
424441
private IRubyObject newBN(BigInteger value) {
425442
if (value == null) return getRuntime().getNil();
426443
return BN.newBN(getRuntime(), value);

0 commit comments

Comments
 (0)