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

Fix Lint/DeprecatedOpenSSLConstant auto-correction of OpenSSL::Cipher to use lower case #8262

Merged
merged 1 commit into from Jul 7, 2020

Conversation

bdewater
Copy link
Contributor

@bdewater bdewater commented Jul 7, 2020

Testing on some Linux-based CI systems revealed the upper case cipher name is not always accepted, but lower case always is. I didn't ran into this when developing #7950

Example output on a random VM:

user@app1:~$ cat /etc/issue
Ubuntu 16.04.3 LTS \n \l
user@app1:~$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
user@app1:~$ irb
irb(main):001:0> require 'openssl'
=> true
irb(main):002:0> OpenSSL::Cipher.new('AES-256-GCM')
RuntimeError: unsupported cipher algorithm (AES-256-GCM)
	from (irb):2:in `initialize'
	from (irb):2:in `new'
	from (irb):2
	from /home/deploy/.rbenv/versions/2.3.1/bin/irb:11:in `<main>'
irb(main):003:0> OpenSSL::Cipher.new('aes-256-gcm')
=> #<OpenSSL::Cipher:0x00560ce9b75470>

Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

… to use lower case

Testing on some Linux-based CI systems revealed the upper case cipher name is not always accepted, but lower case always is.
@bdewater bdewater force-pushed the openssl-lower-case-constant branch from d9f1948 to d8541a4 Compare July 7, 2020 16:30
@koic koic merged commit 698a17f into rubocop:master Jul 7, 2020
@koic
Copy link
Member

koic commented Jul 7, 2020

Good catch! Thank you!

@bdewater bdewater deleted the openssl-lower-case-constant branch July 7, 2020 16:50
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

Successfully merging this pull request may close these issues.

None yet

2 participants