-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
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').encryptWhen 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').encryptWhich 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)