minor fix to allow building on some older machines

Oder editbin.exe files from Microsoft were signed with a different cert thumbprint. This update makes it easier to add additional valid thumbprints for MS signed tools
This commit is contained in:
David Sparer
2017-06-27 12:20:39 -05:00
parent d88c5b9db2
commit 664799c01b
2 changed files with 16 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
param (
# Full path to the Microsoft executable to validate
$Path
)
$valid_microsoft_cert_thumbprints = @("3BDA323E552DB1FDE5F4FBEE75D6D5B2B187EEDC", "108E2BA23632620C427C570B6D9DB51AC31387FE")
$exe_signature = Get-AuthenticodeSignature -FilePath $Path
$baseErrorMsg = "Could not validate the certificate of $Path. "
if ($exe_signature.Status -ne "Valid") {
Write-Error -Message ($baseErrorMsg+"The signature was invalid.") -ErrorAction Stop
}
elseif ($valid_microsoft_cert_thumbprints -notcontains $exe_signature.SignerCertificate.Thumbprint) {
Write-Error -Message ($baseErrorMsg+"The certificate thumbprint ($($exe_signature.SignerCertificate.Thumbprint)) is not trusted.") -ErrorAction Stop
}