Sitelet https://github.com/jruby/jruby/issues/5776
Skip to content

cipher.reset differs from MRI (raises error) when cipher.key is unset #5776

Description

@shibz

Environment

  • Reproduced in:
    • jruby 9.2.8.0-SNAPSHOT (2.5.3) 2019-06-24 5bc9b15 OpenJDK 64-Bit Server VM 25.201-b09 on 1.8.0_201-b09 +jit [linux-x86_64]
    • jruby 9.1.14.0 (2.3.3) 2017-11-08 2176f24 OpenJDK 64-Bit Server VM 25.212-b03 on 1.8.0_212-b03 +jit [linux-x86_64]
  • Linux 4.14.114-105.126.amzn2.x86_64 break script engine #1 SMP Tue May 7 02:26:40 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

Tested in MRI Ruby 2.5 (ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux])

require 'openssl'
cipher = OpenSSL::Cipher.new("AES-128-CBC")
cipher.reset
# success, no error is raised

Actual Behavior

require 'openssl'
cipher = OpenSSL::Cipher.new("AES-128-CBC")
cipher.reset
# raises error:
OpenSSL::Cipher::CipherError: key not specified
from org/jruby/ext/openssl/Cipher.java:944:in `reset'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions