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

OTP 21: public_key.pem_entry_decode #3

Closed
hauptbenutzer opened this issue Jun 24, 2018 · 3 comments
Closed

OTP 21: public_key.pem_entry_decode #3

hauptbenutzer opened this issue Jun 24, 2018 · 3 comments

Comments

@hauptbenutzer
Copy link
Contributor

First off, thanks for putting this together!

The signing worked flawlessly until we upgraded to Elixir 1.6.6 and OTP 21. It seems the issue you linked to has been resolved in OTP 21 and public_key.pem_entry_decode now returns a sane response for gcloud private keys. Unfortunately, that means the special handling no longer works as expected and we get an argument error, since elem(3) now returns an integer, instead of the private key binary.

I attempted to do a pattern match in order to keep backwards compatibility like this, which seems to work fine, at least for my keys.

What are your thoughts on this? I would clean this up a bit and open a PR.

@premist
Copy link
Member

premist commented Jun 25, 2018

Hi @hauptbenutzer! First of all, thank you for looking into this and opening an issue.

Your fix looks good to me, but I wonder that if there is a way to keep compatibility with OTP <=20. I don't mind bumping up OTP version for my own project but it might be a bit bothersome if someone else was depending on this library and it no longer works because of incompatibility with older OTP version.

Looking forward for your thoughts!

@hauptbenutzer
Copy link
Contributor Author

The pattern match should have worked for OTP <= 20, but I took the chance to make it more explicit by actually checking the OTP version. Due to the use of the module attribute, the if should be inlined by the compiler.

@premist
Copy link
Member

premist commented Jul 6, 2018

Resolved by #4.

@premist premist closed this as completed Jul 6, 2018
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

No branches or pull requests

2 participants