Validate authenticode signature using the certificate Subject (#12474)

* Use cerificate subject to verify authenticode signature

* Use function instead of script variables

* Switch all places to using Get-MicrosoftPublisher

* Remove SignatureThumbprint

* Use common subject for the Edge driver
This commit is contained in:
Pavel Iakovenko
2025-06-30 21:33:57 -04:00
committed by GitHub
parent 0790ef6e2a
commit 7eede67cd0
25 changed files with 72 additions and 103 deletions

View File

@@ -24,7 +24,7 @@ $latestVersion = $minorVersions[0]
Install-Binary `
-Url "https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-$latestVersion-signed.msi" `
-ExtraInstallArgs @('TARGETDIR=C:\PROGRA~1\MongoDB ADDLOCAL=ALL') `
-ExpectedSignature $toolsetContent.mongodb.signature
-ExpectedSubject 'CN="MONGODB, INC.", O="MONGODB, INC.", L=New York, S=New York, C=US'
# Add mongodb to the PATH
$mongoPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'mongodb'").PathName
@@ -51,7 +51,7 @@ if (Test-IsWin25) {
Install-Binary -Type MSI `
-Url $mongoshDownloadUrl `
-ExtraInstallArgs @('ALLUSERS=1') `
-ExpectedSignature 'A5BBE2A6DA1D2A6E057EF870267E6A91E4D56BAA'
-ExpectedSubject 'CN="MongoDB, Inc.", O="MongoDB, Inc.", L=New York, S=New York, C=US'
}
Invoke-PesterTests -TestFile "Databases" -TestName "MongoDB"