summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-05-22 10:13:51 -0700
committerTim Smith <tsmith84@gmail.com>2020-05-22 10:13:51 -0700
commit003fbc132935961e93667f11c3f45ce4914b83ac (patch)
tree473cf75cf4442ac5424b70197ad278ac670407d3 /lib/chef/mixin
parentc6666085f6a47bcb1b32446750760d6170927608 (diff)
downloadchef-003fbc132935961e93667f11c3f45ce4914b83ac.tar.gz
Update our usage of OpenSSL::Digest to avoid Ruby 3 breaking changeopenssl_fixes
There's a RuboCop cop to fix these before Ruby 3 breaks it. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/openssl_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/mixin/openssl_helper.rb b/lib/chef/mixin/openssl_helper.rb
index 7b94096a79..a30ccb5f69 100644
--- a/lib/chef/mixin/openssl_helper.rb
+++ b/lib/chef/mixin/openssl_helper.rb
@@ -218,7 +218,7 @@ class Chef
# Chef 12 backward compatibility
::OpenSSL::PKey::EC.send(:alias_method, :private?, :private_key?)
- request.sign(key, ::OpenSSL::Digest::SHA256.new)
+ request.sign(key, ::OpenSSL::Digest.new("SHA256"))
request
end
@@ -289,7 +289,7 @@ class Chef
cert.add_extension ef.create_extension("authorityKeyIdentifier",
"keyid:always,issuer:always")
- cert.sign(key, ::OpenSSL::Digest::SHA256.new)
+ cert.sign(key, ::OpenSSL::Digest.new("SHA256"))
cert
end
@@ -319,7 +319,7 @@ class Chef
crl.add_extension ::OpenSSL::X509::Extension.new("crlNumber", ::OpenSSL::ASN1::Integer(1))
crl.add_extension ef.create_extension("authorityKeyIdentifier",
"keyid:always,issuer:always")
- crl.sign(ca_private_key, ::OpenSSL::Digest::SHA256.new)
+ crl.sign(ca_private_key, ::OpenSSL::Digest.new("SHA256"))
crl
end
@@ -398,7 +398,7 @@ class Chef
::OpenSSL::ASN1::Integer(get_next_crl_number(crl)))]
crl.add_extension ef.create_extension("authorityKeyIdentifier",
"keyid:always,issuer:always")
- crl.sign(ca_private_key, ::OpenSSL::Digest::SHA256.new)
+ crl.sign(ca_private_key, ::OpenSSL::Digest.new("SHA256"))
crl
end