summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2021-03-03 08:00:15 -0800
committerJohn McCrae <john.mccrae@progress.com>2021-03-03 08:00:15 -0800
commit2cff7d0f55b02cd6aa41aed45e503da120b98943 (patch)
treecd08cef3a71fe52754f825cd1a3acc394c4a20d1
parenta3356ab3d719dce2d092bd8c282b1482da2a7d95 (diff)
downloadchef-jfm/pfx_support.tar.gz
corrected linting errorsjfm/pfx_support
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--lib/chef/resource/windows_certificate.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/chef/resource/windows_certificate.rb b/lib/chef/resource/windows_certificate.rb
index 91e7988a81..2b7b008870 100644
--- a/lib/chef/resource/windows_certificate.rb
+++ b/lib/chef/resource/windows_certificate.rb
@@ -24,8 +24,6 @@ module Win32
end
autoload :OpenSSL, "openssl"
require "chef-utils/dist" unless defined?(ChefUtils::Dist)
-require 'pathname'
-
class Chef
class Resource
@@ -82,7 +80,7 @@ class Chef
default: false
property :cert_path, String,
- description: "The path to the certificate."
+ description: "The path to save the certificate to on disk when using the Fetch action. "
# lazy used to set default value of sensitive to true if password is set
property :sensitive, [TrueClass, FalseClass],
@@ -224,9 +222,8 @@ class Chef
def fetch_pfx_certificate
store = ::Win32::Certstore.open(new_resource.store_name, store_location: native_cert_location)
cert_path = store.get_pfx(resolve_thumbprint(new_resource.source), store_location: native_cert_location, export_password: new_resource.pfx_password)
- p12 = OpenSSL::PKCS12.new(::File.binread(cert_path.strip),new_resource.pfx_password )
+ p12 = OpenSSL::PKCS12.new(::File.binread(cert_path.strip), new_resource.pfx_password )
p12.certificate
- # ::File.delete(cert_path) if ::File.exist?(cert_path)
end
# the call to get_pfx looks deceiving, we still pass the store_name and store_location because the ultimate recipient of that data
@@ -235,9 +232,8 @@ class Chef
def fetch_pfx_private_key
store = ::Win32::Certstore.open(new_resource.store_name, store_location: native_cert_location)
cert_path = store.get_pfx(resolve_thumbprint(new_resource.source), store_location: native_cert_location, export_password: new_resource.pfx_password)
- p12 = OpenSSL::PKCS12.new(::File.binread(cert_path.strip),new_resource.pfx_password )
+ p12 = OpenSSL::PKCS12.new(::File.binread(cert_path.strip), new_resource.pfx_password )
p12.key
- # ::File.delete(cert_path) if ::File.exist?(cert_path)
end
# Thumbprints should be exactly 40 Hex characters