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

JWK key signing is broken in OpenSSL 3.0 #19

Open
deepfryed opened this issue Oct 6, 2022 · 13 comments
Open

JWK key signing is broken in OpenSSL 3.0 #19

deepfryed opened this issue Oct 6, 2022 · 13 comments

Comments

@deepfryed
Copy link

https://github.com/potatosalad/ruby-jose/blob/master/lib/jose/jwk/kty_ec.rb#L20

does not work with OpenSSL 3.0 and fails with error "pkeys are immutable on OpenSSL 3.0"

Potential fix is to use ASN1 sequences as done in https://github.com/googleapis/google-auth-library-ruby/pull/397/files#diff-fda73a61a26353211e861c4b1519bd86ec9abd1bfa2a044601bae498679ea7e5R160-R165

@globewalldesk
Copy link

Are there any plans to update this gem? It's the only one I could find for JOSE signing.

@deepfryed
Copy link
Author

@potatosalad if you're not planning to maintain this library, could you please add a note on the README ? OpenSSL 1.1 will not be receiving security updates beyond 2023, so making it work with OpenSSL 3.x is quite important or people will need to switch to a different library.

thanks

@enriquez
Copy link

enriquez commented Feb 6, 2023

This is thrown together and seems to work for our use https://github.com/enriquez/ruby-jose/tree/convert-to-asn1

@deepfryed
Copy link
Author

thanks @enriquez - we're moving away from using this gem as it seems to be unmaintained.

@enriquez
Copy link

enriquez commented Feb 6, 2023

@deepfryed can you recommend alternatives?

@deepfryed
Copy link
Author

we're trying out https://rubygems.org/gems/jwt

@globewalldesk
Copy link

We're using jwt too. Works fine.

ronald05arias added a commit to ronald05arias/ruby-jose that referenced this issue Mar 15, 2023
See issue potatosalad#19
chore: Force OpenSSL 3 on dev.
chore: Upgrade Bundler.
@theDogOfPavlov
Copy link

This is still failing after the commit:

terminated with exception (report_on_exception is true):
/root/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/jose-1.1.3/lib/jose/jwk/kty_ec.rb:20:in `public_key=': pkeys are immutable on OpenSSL 3.0 (OpenSSL::PKey::PKeyError)
        from /root/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/jose-1.1.3/lib/jose/jwk/kty_ec.rb:20:in `from_map'
        from /root/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/jose-1.1.3/lib/jose/jwk.rb:1059:in `from_fields'
        from /root/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/jose-1.1.3/lib/jose/jwk.rb:123:in `from_map'
        from /root/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/jose-1.1.3/lib/jose/jwk.rb:76:in `from_binary'
        ```

@pean
Copy link

pean commented Jul 3, 2023

we're trying out https://rubygems.org/gems/jwt

Thanks for that tip. Looked pretty promising until I realized it does not support RSA-OAEP-256. This seems to be the only gem that I found that does.

@Physium
Copy link

Physium commented Oct 6, 2023

Are there alternatives for JWE encrypt/decrypt? seems like jose is the only one that support an algo of ECDH-ES+A256KW

@theDogOfPavlov
Copy link

I actually ended up just writing my own version in the end, as if you look at the actual sign/verify requirements, it's only a dozen lines of code to support a single set of ciphers etc.

@pean
Copy link

pean commented Oct 6, 2023

I actually ended up just writing my own version in the end, as if you look at the actual sign/verify requirements, it's only a dozen lines of code to support a single set of ciphers etc.

So did I, used JWT gem for JWT but ended up writing our own implementation for JWE with some "inspiration" from this gem to support RSA-OAEP-256.

@bnjix
Copy link

bnjix commented Mar 28, 2024

If anyone is still looking I believe this issue was addressed by #25 and goes away by updating to 1.2.0

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

7 participants