Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

wants to merge 1 commit into from


None yet
2 participants
Copy link

commented Nov 13, 2013

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.


This comment has been minimized.

Copy link

commented Nov 17, 2013

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

@headius headius closed this Nov 17, 2013


This comment has been minimized.

Copy link
Contributor Author

commented 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 arnehormann:openssl-mpint branch Nov 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.