File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ Parameters
29
29
| add-to-path | true | Whether to add Cygwin's ` /bin ` directory to the system ` PATH `
30
30
| allow-test-packages | false | Consider package versions marked test for installation
31
31
| check-hash | true | Whether to check the hash of the downloaded Cygwin installer.
32
+ | check-installer-sig | true | Whether to check the Authenticode signature of the downloaded Cygwin installer.
32
33
| work-vol | D: | Volume on which to store setup and packages, and install Cygwin.
33
34
34
35
Line endings
@@ -100,7 +101,9 @@ Mirrors and signatures
100
101
----------------------
101
102
102
103
You probably don't need to change the setting for ` site ` , and you shouldn't
103
- change ` check-sig ` unless you're very confident it's appropriate and necessary.
104
+ change ` check-installer-sig ` or ` check-sig ` unless you're very confident it's
105
+ appropriate and necessary.
106
+
104
107
These options are very unlikely to be useful except in some very isolated
105
108
circumstances, such as using the [ Cygwin Time
106
109
Machine] ( http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html ) .
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ inputs:
37
37
description : Check the hash of the installer
38
38
required : false
39
39
default : ' true'
40
+ check-installer-sig :
41
+ description : Check the Autheticode signature of the installer
42
+ required : false
43
+ default : ' true'
40
44
work-vol :
41
45
description : Volume on which to store setup and packages, and install Cygwin
42
46
required : false
@@ -102,6 +106,15 @@ runs:
102
106
throw "The downloaded setup has a zero length!"
103
107
}
104
108
109
+ $signature = Get-AuthenticodeSignature -FilePath $setupExe
110
+ echo "Signature status: $($signature.Status) fingerprint: $($signature.SignerCertificate.GetCertHashString("SHA256"))"
111
+ # TBD: this should check against a list of fingerprints for valid certs we have used
112
+ if (!$signature.Status -ne 'Valid' -or $signature.SignerCertificate.GetCertHashString("SHA256") -ne '2ce11da3a675a9d631e06a28ddfd6f730b9cc6989b43bd30ad7cc79d219cf2bd') {
113
+ if ('${{ inputs.check-installer-sig }}' -eq 'true') {
114
+ throw "Invalid CodeSign signature on the downloaded setup!"
115
+ }
116
+ }
117
+
105
118
if ('${{ inputs.check-hash }}' -eq 'true') {
106
119
$hashFile = "$vol\sha512.sum"
107
120
Invoke-WebRequest-With-Retry https://cygwin.com/sha512.sum $hashFile
You can’t perform that action at this time.
0 commit comments