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

Erlang OTP 20 breaks JsonWebToken.Algorithm.Rsa.validate_key_size/1 #20

Closed
BrendonPierson opened this issue Jun 27, 2017 · 3 comments · Fixed by #22
Closed

Erlang OTP 20 breaks JsonWebToken.Algorithm.Rsa.validate_key_size/1 #20

BrendonPierson opened this issue Jun 27, 2017 · 3 comments · Fixed by #22

Comments

@BrendonPierson
Copy link

It appears the latest erlang release has removed :crypto.mpint/1. This is causing the JsonWebToken.Algorithm.Rsa.validate_key_size/1 to break. I think we will need a work around for validating key size.

@lachezar
Copy link

lachezar commented Jun 27, 2017

As a temporary solution I created a erl file with the mpint/1 implementation. I am not sure if there is a proper function in crypto or in other modules which can replace mpint/1 (I am not experienced with Erlang), but I can make a PR if this solution is good enough.

lachezar@e9b0faf

@BrendonPierson
Copy link
Author

BrendonPierson commented Jun 27, 2017

I've played around with it a bit and it looks like :crypto.mpint/1 was just moved to :ssh_bits.mpint/1. I'm not sure on the best practice here, but It's probably wise to run some logic that picks the correct version based on the erlang version.

Here is a simple workaround that runs a check for the Erlang version and picks the right function -> #21

@lachezar
Copy link

Looks very clean and nice!!

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 a pull request may close this issue.

2 participants