KEMBAR78
Lint/DeprecatedOpenSSLConstant: Typo in autocrrect "cip-her-aes" · Issue #14563 · rubocop/rubocop · GitHub
Skip to content

Lint/DeprecatedOpenSSLConstant: Typo in autocrrect "cip-her-aes" #14563

@matobinder

Description

@matobinder

When running rubocop on some opensssl code, its autofix will put an invalid cipher name in.
Example

require 'openssl'
encrypt_cipher = OpenSSL::Cipher::Cipher.new('AES-256-ECB').encrypt

When I run rubocop it will report.

W: [Correctable] Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Cipher.new('cip-her-aes') instead of OpenSSL::Cipher::Cipher.new('AES-256-ECB').
encrypt_cipher = OpenSSL::Cipher::Cipher.new('AES-256-ECB').encrypt

When I give it the -a
It will change it to

encrypt_cipher = OpenSSL::Cipher.new('cip-her-aes').encrypt

Which errors for me, and that is not a cipher that I am aware of

Change the code manually to fixes it, so it got rid of my extra cipher and it works and is happy

OpenSSL::Cipher.new('aes-256-ecb').encrypt

rubocop -V output

rubocop -V
1.81.0 (using Parser 3.3.9.0, Prism 1.5.1, rubocop-ast 1.47.1, analyzing as Ruby 3.4, running on ruby 3.4.5) [x86_64-linux]
  - rubocop-performance 1.26.0

Running on Ruby 3.4.5, under Ubuntu 22.04.5 LTS (ruby was built via rbenv)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions