openssl: add handling for base 0 to new and to_s #1221

wants to merge 1 commit into

2 participants


In OpenSSL::BN, base 0 is used in to_s and new to convert to and from a multi precision integer as specified in RFC #4251 Section 5: mpint.
I stumbled over this while fixing a pull request for sshkey running under JRuby.
That's also what I used for testing - I ran rake test with the JRuby rake implementation for my first commit from the sshkey pull request.

JRuby Team member

Thank you! Is there a test we could enable for this behavior?

@headius headius closed this Nov 17, 2013

I had to read the C documentation and experimented quite a lot with IRB to get this where it is now (and the MRI documentation is pretty much lacking in this regard). I would have attempted to write a test, but I didn't know where to put it.
I'll still try to write one, but when I do so, where do I put it and how do I enable it?
Would a new file test/test_openssl_stub_bn.rb load on its own?

@arnehormann arnehormann deleted the unknown repository branch Nov 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment