Skip to content

fix: #9 adapt initialiser parameter to OpenSSL::PKey implementation#11

Open
Quantenradierer wants to merge 1 commit intorylarson:masterfrom
Quantenradierer:fix/issue9/adapt_initialiser_to_pkey_implementation
Open

fix: #9 adapt initialiser parameter to OpenSSL::PKey implementation#11
Quantenradierer wants to merge 1 commit intorylarson:masterfrom
Quantenradierer:fix/issue9/adapt_initialiser_to_pkey_implementation

Conversation

@Quantenradierer
Copy link
Copy Markdown

@Quantenradierer Quantenradierer commented Jun 3, 2022

Fixes #9

Instead of one parameters it allows a series of parameters (including none). The parameters are now conform with the actual implementation, see e.g.: https://ruby-doc.org/stdlib-2.6.1/libdoc/openssl/rdoc/OpenSSL/PKey/RSA.html

This mostly caused issues when none was given - part of the jwt gem initialisation process at it seems - since at least one parameter was expected.

However, it also adds an additional check to avoid issues when a different number of parameters are given: otherwise der_to_pem could raise an error - hiding the true error from the PKey initialisers

Also, it should be backwards compatible for older jwt gem versions.

instead of one parameters it allows a series of parameters (including none). This mostly caused issues when none was given - part of the rails initialisation - since at least one parameter was expected

However, it also adds an additional check to avoid issues when a different number of parameters are given: otherwise `der_to_pem` could raise an error - hiding the true error from the PKey initialisers
@Quantenradierer
Copy link
Copy Markdown
Author

@rylarson @danleyden @atreat please review

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.

ArgumentError (given 0, expected 1) with jwt 2.3.0

1 participant