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

Allow DSA private keys to be initialized from parameters #83

Merged
merged 1 commit into from
Mar 10, 2016

Conversation

philr
Copy link
Contributor

@philr philr commented Mar 8, 2016

It is currently not possible to initialize an instance of OpenSSL::PKey::DSA for use as a private key by setting the individual parameters. This is because the priv_key= method is missing and setKeySpecComponent() only handles the creation of the publicKey.

This pull request adds a priv_key= method and modifies setKeySpecComponent() method to initialize privateKey in addition to publicKey.

Similarly to #82 the DSA p, q and g parameters are shared between the private and public keys. I've changed setKeySpecComponent() to read these parameters from privateKey or publicKey if necessary.

@philr
Copy link
Contributor Author

philr commented Mar 9, 2016

The Travis CI build has failed due to my use of the refute method in two of the test cases (which appears to not exist in older versions of JRuby). I will update the PR to fix the error.

Verified

This commit was signed with the committer’s verified signature.
StollD Dorian Stoll
- OpenSSL::PKey::DSA was missing a priv_key= method.
- setKeySpecComponent() only handled the creation of the DSAPrivateKey.
@philr philr force-pushed the set_dsa_private_key_from_params branch from ee332db to d219115 Compare March 9, 2016 21:00
@philr
Copy link
Contributor Author

philr commented Mar 9, 2016

I have amended my commit to replace the problematic refute calls. The remaining build failure is unrelated to this change.

@kares
Copy link
Member

kares commented Mar 10, 2016

thanks, esp. that you got us some new tests - much appreciated!

kares added a commit that referenced this pull request Mar 10, 2016
Allow DSA private keys to be initialized from parameters
@kares kares merged commit e6dcdcf into jruby:master Mar 10, 2016
@philr philr deleted the set_dsa_private_key_from_params branch March 12, 2016 20:38
philr added a commit to philr/putty-key that referenced this pull request Mar 28, 2016
DSA/DSS keys will be supported once
jruby/jruby-openssl#82 is released.

RSA keys will be instantiated correctly once
jruby/jruby-openssl#83 is released.
@kares kares added this to the 0.9.17 milestone Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants