chef / knife-windows

Plugin for Chef's knife tool for working with Windows nodes
Apache License 2.0
152 stars 110 forks source link

OpenSSL usage deprecation warnings from Rubocop #501

Open tas50 opened 4 years ago

tas50 commented 4 years ago

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/knife-azure/lib/azure/service_management/certificate.rb:88:20: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.new('SHA256') instead of OpenSSL::Digest::SHA256.new.
      ca.sign(key, OpenSSL::Digest::SHA256.new)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/knife-azure/lib/azure/service_management/certificate.rb:90:22: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.new('SHA1', ca.to_der) instead of OpenSSL::Digest::SHA1.new(ca.to_der).
      @fingerprint = OpenSSL::Digest::SHA1.new(ca.to_der)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/knife-azure/lib/azure/service_management/certificate.rb:219:26: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.new('SHA1') instead of OpenSSL::Digest::SHA1.new.
      cert.sign(rsa_key, OpenSSL::Digest::SHA1.new)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/knife-azure/lib/azure/service_management/certificate.rb:220:21: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.new('SHA1', cert.to_der) instead of OpenSSL::Digest::SHA1.new(cert.to_der).
      @thumbprint = OpenSSL::Digest::SHA1.new(cert.to_der)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/knife-windows/lib/chef/knife/windows_cert_generate.rb:101:28: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.new('SHA1') instead of OpenSSL::Digest::SHA1.new.
        cert.sign(rsa_key, OpenSSL::Digest::SHA1.new)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/tsmith/dev/work/knife-windows/lib/chef/knife/windows_cert_generate.rb:102:23: W: Lint/DeprecatedOpenSSLConstant: Use OpenSSL::Digest.new('SHA1', cert.to_der) instead of OpenSSL::Digest::SHA1.new(cert.to_der).
        @thumbprint = OpenSSL::Digest::SHA1.new(cert.to_der)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^