You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Considering jruby 9.4.5.0 should support Ruby 3.1.x, the auth_tag method on Cipher should support an optional parameter of tag length, documentation in 3.1.2
But when auth_tag is used with tag-length parameter in jruby 9.4.5.0 it throws ArgumentError. This issue in turn causes error while generating new rails application when some customisation params are given. rails/rails#49737
Code snippet to reproduce:
Following code works on ruby 3.1.2 but fails on jruby 9.4.5.0
require "openssl"
cipher=OpenSSL::Cipher.new('aes-128-gcm').tap do |c|
c.encrypt
c.key="\xCB\u0013\xB1\xBD\x9A\x91\xA8\xBA \xA7\xE3\x8B\u000E\xCCR\u001D"
c.random_iv
c.final
end
cipher.auth_tag(16)
Error / Stacktrace in Jruby:
irb(main):008> cipher.auth_tag(16)
(irb):8:in `evaluate': `auth_tag': wrong number of arguments (given 1, expected 0) (ArgumentError)
from org/jruby/RubyKernel.java:1161:in `eval'
from org/jruby/RubyKernel.java:1603:in `loop'
from org/jruby/RubyKernel.java:1310:in `catch'
from /Users/hardik_joshi/.rbenv/versions/jruby-9.4.5.0/lib/ruby/gems/shared/gems/irb-1.11.1/exe/irb:9:in `<main>'
from org/jruby/RubyKernel.java:1107:in `load'
from /Users/hardik_joshi/.rbenv/versions/jruby-9.4.5.0/bin/irb:25:in `<main>'
The text was updated successfully, but these errors were encountered:
Issue:
Considering jruby 9.4.5.0 should support Ruby 3.1.x, the
auth_tag
method onCipher
should support an optional parameter of tag length, documentation in 3.1.2But when
auth_tag
is used with tag-length parameter injruby 9.4.5.0
it throwsArgumentError
. This issue in turn causes error while generating new rails application when some customisation params are given. rails/rails#49737Code snippet to reproduce:
Following code works on
ruby 3.1.2
but fails onjruby 9.4.5.0
Error / Stacktrace in Jruby:
The text was updated successfully, but these errors were encountered: