win32-certstore 0.6.12 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc1e81bec9382196d23ef1bd3cd6c344e9b86052387d1b2682172ec38e11289c
|
4
|
+
data.tar.gz: ccf51ca4d89cab428740dfdb2befb578936cea342251cafa03a07b57a657d90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb20d4faed9a9325bbea782ac186317627f55ca14c2bcedcee8ad0424510a06649836f4f97c5727d2eb3d01e698ea4935b7debee016449fe8bf2df417d7d8531
|
7
|
+
data.tar.gz: b0bed942d330d7ed0e86132c0f1172deb28877648ebc431da7922a8ad8e73898580ed909852ca5a646c8c1f6f1ea8912cf4717ade0d528d07ff2236652fe35a4
|
@@ -43,7 +43,7 @@ module Win32
|
|
43
43
|
|
44
44
|
# Validate thumbprint
|
45
45
|
def validate_thumbprint(cert_thumbprint)
|
46
|
-
if cert_thumbprint.nil? || cert_thumbprint.empty? || cert_thumbprint.strip.empty?
|
46
|
+
if cert_thumbprint.nil? || cert_thumbprint.empty? || cert_thumbprint.strip.empty? || cert_thumbprint.length < 40
|
47
47
|
raise ArgumentError, "Invalid certificate thumbprint."
|
48
48
|
end
|
49
49
|
end
|
@@ -24,7 +24,11 @@ module Win32
|
|
24
24
|
def cert_ps_cmd(thumbprint, store_location: "LocalMachine", store_name: "My")
|
25
25
|
# the PowerShell block below uses a "Here-String" - it is explicitly formatted against the left margin.
|
26
26
|
<<-EOH
|
27
|
-
$cert = Get-ChildItem Cert:\\#{store_location}\\#{store_name} -Recurse | Where-Object { $_.Thumbprint -eq "#{thumbprint}" }
|
27
|
+
$cert = Get-ChildItem Cert:\\#{store_location}\\#{store_name} -Recurse -Force | Where-Object { $_.Thumbprint -eq "#{thumbprint}" }
|
28
|
+
|
29
|
+
if ([string]::IsNullOrEmpty($cert)){
|
30
|
+
return "Certificate Not Found"
|
31
|
+
}
|
28
32
|
|
29
33
|
$certdata = [System.Convert]::ToBase64String($cert.RawData, 'InsertLineBreaks')
|
30
34
|
$content = $null
|
@@ -96,6 +96,7 @@ module Win32
|
|
96
96
|
validate_thumbprint(certificate_thumbprint)
|
97
97
|
thumbprint = update_thumbprint(certificate_thumbprint)
|
98
98
|
cert_pem = get_cert_pem(thumbprint)
|
99
|
+
return cert_pem if cert_pem == "Certificate Not Found"
|
99
100
|
cert_pem = format_pem(cert_pem)
|
100
101
|
verify_certificate(cert_pem)
|
101
102
|
build_openssl_obj(cert_pem)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-certstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|