Skip to content

OpenSSL usage deprecation warnings from Rubocop #501

Open
@tas50

Description

@tas50

Rubocop has a new cop that detects an upcoming deprecation to the OpenSSL gem that's built into Ruby.

The openssl introducing the deprecation:
ruby/openssl#366

The new rubocop rule currently only in master:
rubocop/rubocop#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)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UntriagedAn issue that has yet to be triaged.Type: BugDoes not work as expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions