OpenSSL usage deprecation warnings from Rubocop
Nobody has claimed this yet.
- Dominant language
- Erlang
- Stars
- 303
- Forks
- 211
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 5
Description
Rubocop has a new cop that detects an upcoming deprecation to the OpenSSL gem that's built into Ruby.
The openssl introducing the deprecation:
https://github.com/ruby/openssl/pull/366
The new rubocop rule currently only in master:
https://github.com/rubocop-hq/rubocop/pull/7950
/Users/tsmith/dev/work/chef-server/src/oc-id/app/models/signature.rb:17:5: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.hexdigest('SHA1', canonical_string) instead of OpenSSL::Digest::SHA1.hexdigest(canonical_string).
OpenSSL::Digest::SHA1.hexdigest(canonical_string)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/chef-server/src/oc_erchef/apps/oc_chef_wm/test/password_gen.rb:13:9: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.hexdigest('SHA1', "--#{salt}--#{password}--") instead of OpenSSL::Digest::SHA1.hexdigest("--#{salt}--#{password}--").
OpenSSL::Digest::SHA1.hexdigest("--#{salt}--#{password}--")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/chef-server/src/oc_erchef/apps/oc_chef_wm/test/password_gen.rb:15:9: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.hexdigest('SHA1', "#{salt}--#{password}--") instead of OpenSSL::Digest::SHA1.hexdigest("#{salt}--#{password}--").
OpenSSL::Digest::SHA1.hexdigest("#{salt}--#{password}--")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aha! Link: https://chef.aha.io/features/SH-3048
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review src/oc-id/app/models/signature.rb and src/oc_erchef/apps/oc_chef_wm/test/password_gen.rb, starting with the OpenSSL calls shown in the warning. Update the deprecated usage to the replacement form described by Rubocop, then run Rubocop to confirm that Lint/DeprecatedOpenSSLConstant no longer reports these locations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- cryptography
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100