prime? openssl error in 9.1.5.0 #4193

Closed
jzakiya opened this Issue Sep 30, 2016 · 5 comments

Projects

None yet

3 participants

@jzakiya
jzakiya commented Sep 30, 2016

Environment

$ jruby -v
jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 Java HotSpot(TM) 64-Bit Server VM 25.102-b14 on 1.8.0_102-b14 +jit [linux-x86_64]

$ uname -a
Linux localhost 4.7.5-pclos1 #1 SMP Sun Sep 25 17:05:47 CDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

> require 'openssl'
> 5.to_bn.prime?
 => true
> -5.to_bn.prime?
 => false

Actual Behavior

> require 'openssl'
> 5.to_bn.prime?
 => true
> -5.to_bn.prime?     
 => true                  -- should be false, this is an error for all negative primes
@headius
Member
headius commented Sep 30, 2016

Seems legit. Normally I'd ask you to re-file at jruby/jruby-openssl but this seems pretty trivial.

@headius
Member
headius commented Sep 30, 2016

@kares @mkristian Any reason we couldn't put out a jruby-openssl release right now?

@headius headius referenced this issue in jruby/jruby-openssl Sep 30, 2016
Closed

BN.prime? should return false for negative values #107

@headius headius added a commit to jruby/jruby-openssl that closed this issue Sep 30, 2016
@headius headius Negative values are always considered not prime. 2678bab
@headius headius added this to the JRuby 9.1.6.0 milestone Sep 30, 2016
@headius headius added the openssl label Sep 30, 2016
@headius
Member
headius commented Sep 30, 2016

This is fixed in jruby-openssl and just needs releases.

@headius
Member
headius commented Sep 30, 2016

Oh...we need tests for this. Want to PR something quick for jruby/jruby-openssl?

@headius headius added the needs tests label Sep 30, 2016
@kares
Member
kares commented Nov 10, 2016

this actually isn't in 9.1.6.0 unless gem install jruby-openssl, updated gem (0.9.18) should be in 9.1.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment