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

OpenSSL issue when decrypting token #22

Open
saemideluxe opened this issue Jul 27, 2023 · 1 comment
Open

OpenSSL issue when decrypting token #22

saemideluxe opened this issue Jul 27, 2023 · 1 comment

Comments

@saemideluxe
Copy link

Hi there

When I call

JOSE::JWK.from_oct(my_key)
JOSE::JWE.block_decrypt(jwk, token)

I get the following error from OpenSSL:

/home/sam/test_ruby/vendor/bundle/ruby/3.1.0/gems/jose-1.1.3/lib/jose/jwe/enc_aes_gcm.rb:46:in `final': OpenSSL::Cipher::CipherError
        from /home/sam/test_ruby/vendor/bundle/ruby/3.1.0/gems/jose-1.1.3/lib/jose/jwe/enc_aes_gcm.rb:46:in `block_decrypt'
        from /home/sam/test_ruby/vendor/bundle/ruby/3.1.0/gems/jose-1.1.3/lib/jose/jwe.rb:602:in `block_decrypt'
        from /home/sam/test_ruby/vendor/bundle/ruby/3.1.0/gems/jose-1.1.3/lib/jose/jwe.rb:584:in `block_decrypt'
        from /home/sam/test_ruby/test.rb:11:in `<top (required)>'
        from /usr/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
        from /usr/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
        from /usr/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
        from /usr/lib/ruby/3.1.0/bundler/cli.rb:484:in `exec'
        from /usr/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from /usr/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
        from /usr/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from /usr/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
        from /usr/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <top (required)>'
        from /usr/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
        from /usr/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<top (required)>'
        from /usr/bin/bundle3.1:25:in `load'
        from /usr/bin/bundle3.1:25:in `<main>'

Decrypting the token and the key work when using jose for nodejs. Any idea what could be the problem?

@nebula28
Copy link

I'm receiving this same error

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