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
2929| add-to-path | true | Whether to add Cygwin's ` /bin ` directory to the system ` PATH `
3030| allow-test-packages | false | Consider package versions marked test for installation
3131| 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.
3233| work-vol | D: | Volume on which to store setup and packages, and install Cygwin.
3334
3435Line endings
@@ -100,7 +101,9 @@ Mirrors and signatures
100101----------------------
101102
102103You 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+
104107These options are very unlikely to be useful except in some very isolated
105108circumstances, such as using the [ Cygwin Time
106109Machine] ( http://www.crouchingtigerhiddenfruitbat.org/Cygwin/timemachine.html ) .
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ inputs:
3737 description : Check the hash of the installer
3838 required : false
3939 default : ' true'
40+ check-installer-sig :
41+ description : Check the Autheticode signature of the installer
42+ required : false
43+ default : ' true'
4044 work-vol :
4145 description : Volume on which to store setup and packages, and install Cygwin
4246 required : false
@@ -102,6 +106,15 @@ runs:
102106 throw "The downloaded setup has a zero length!"
103107 }
104108
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+
105118 if ('${{ inputs.check-hash }}' -eq 'true') {
106119 $hashFile = "$vol\sha512.sum"
107120 Invoke-WebRequest-With-Retry https://cygwin.com/sha512.sum $hashFile
You can’t perform that action at this time.
0 commit comments