Skip to content

Commit b195e25

Browse files
authored
Signing instructions for Newtonsoft.Json.dll added (#2601) (#2603)
* Signing instructions for Newtonsoft.Json.dll added * Added 3rdParty signature thumbprint to the accept list.
1 parent 0b1e2e5 commit b195e25

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

scripts/verify-sign.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $env:TP_TOOLS_DIR = Join-Path $env:TP_ROOT_DIR "tools"
3030
Write-Verbose "Setup build configuration."
3131
$TPB_SignCertificate = $Certificate
3232
$TPB_Configuration = $Configuration
33-
$TPB_AssembliesPattern = @("*test*.dll", "*qualitytools*.dll", "*test*.exe", "*datacollector*.dll", "*datacollector*.exe", "QTAgent*.exe", "VsWebSite.Interop.dll", "Microsoft.VisualStudio*.dll", "Microsoft.TestPlatform.Build.dll", "Microsoft.DiaSymReader.dll", "Microsoft.IntelliTrace*.dll", "concrt140.dll", "msvcp140.dll", "vccorlib140.dll", "vcruntime140.dll", "codecoveragemessages.dll", "covrun32.dll", "msdia140.dll", "covrun64.dll", "IntelliTrace.exe", "ProcessSnapshotCleanup.exe", "TDEnvCleanup.exe", "CodeCoverage.exe", "Microsoft.ShDocVw.dll", "UIAComwrapper.dll", "Interop.UIAutomationClient.dll", "SettingsMigrator.exe")
33+
$TPB_AssembliesPattern = @("*test*.dll", "*qualitytools*.dll", "*test*.exe", "*datacollector*.dll", "*datacollector*.exe", "QTAgent*.exe", "VsWebSite.Interop.dll", "Microsoft.VisualStudio*.dll", "Microsoft.TestPlatform.Build.dll", "Microsoft.DiaSymReader.dll", "Microsoft.IntelliTrace*.dll", "concrt140.dll", "msvcp140.dll", "vccorlib140.dll", "vcruntime140.dll", "codecoveragemessages.dll", "covrun32.dll", "msdia140.dll", "covrun64.dll", "IntelliTrace.exe", "ProcessSnapshotCleanup.exe", "TDEnvCleanup.exe", "CodeCoverage.exe", "Microsoft.ShDocVw.dll", "UIAComwrapper.dll", "Interop.UIAutomationClient.dll", "SettingsMigrator.exe", "Newtonsoft.Json.dll")
3434

3535
function Verify-Assemblies
3636
{
@@ -54,18 +54,22 @@ function Verify-Assemblies
5454
elseif ($signature.SignerCertificate.Thumbprint -eq "5EAD300DC7E4D637948ECB0ED829A072BD152E17") {
5555
Write-Log "Valid (Prod Signed): $($_.FullName)."
5656
}
57-
# For some dlls e.g. "Interop.UIAutomationClient.dll", sign certificate is different signature. Skip such binaries.
57+
# For some dlls e.g. "Interop.UIAutomationClient.dll", sign certificate is different signature. Skip such binaries.
5858
elseif ($signature.SignerCertificate.Thumbprint -eq "67B1757863E3EFF760EA9EBB02849AF07D3A8080") {
5959
Write-Log "Valid (Prod Signed): $($_.FullName)."
6060
}
61-
# For some dlls e.g. "Microsoft.VisualStudio.ArchitectureTools.PEReader.dll", sign certificate is different signature. Skip such binaries.
61+
# For some dlls e.g. "Microsoft.VisualStudio.ArchitectureTools.PEReader.dll", sign certificate is different signature. Skip such binaries.
6262
elseif ($signature.SignerCertificate.Thumbprint -eq "9DC17888B5CFAD98B3CB35C1994E96227F061675") {
6363
Write-Log "Valid (Prod Signed): $($_.FullName)."
6464
}
65-
# For some dlls sign certificate is different signature. Skip such binaries.
65+
# For some dlls sign certificate is different signature. Skip such binaries.
6666
elseif ($signature.SignerCertificate.Thumbprint -eq "62009AAABDAE749FD47D19150958329BF6FF4B34") {
6767
Write-Log "Valid (Prod Signed): $($_.FullName)."
6868
}
69+
# Microsoft 3rd Party Authenticode Signature
70+
elseif ($signature.SignerCertificate.Thumbprint -eq "899FA016DEE8E665FF2A315A1151C43FB96C430B") {
71+
Write-Log "Valid (Prod Signed): $($_.FullName)."
72+
}
6973
else {
7074
Write-FailLog "Incorrect certificate. File: $($_.FullName). Certificate: $($signature.SignerCertificate.Thumbprint)."
7175
}

src/package/sign/sign.proj

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@
155155
<AssembliesToSign Include="$(ArtifactsDirectory)CUITPlugins\Microsoft.VisualStudio.TestTools.UITest.Extension.Uia.dll" />
156156
<AssembliesToSign Include="$(ArtifactsDirectory)CUITPlugins\Microsoft.VisualStudio.TestTools.UITest.Extension.UiaWidget.dll" />
157157
<AssembliesToSign Include="$(ArtifactsDirectory)CUITPlugins\Microsoft.VisualStudio.TestTools.UITest.Extension.UiaWidget.UIAHtmlElementUtilities.dll" />
158+
159+
<!-- Third Party assemblies to sign -->
160+
<ThirdPartyAssembliesToSign Include="$(ArtifactsDirectory)Newtonsoft.Json.dll" />
158161
</ItemGroup>
159162

160163
<!-- Sign test platform v2 assemblies for .NET 4.6-->
@@ -200,6 +203,9 @@
200203
<!-- Localized resources -->
201204
<AssembliesToSign Include="$(ArtifactsDirectory)%(ResxLang.Identity)\*.*" />
202205
<AssembliesToSign Include="$(ArtifactsDirectory)Extensions\%(ResxLang.Identity)\*.*" />
206+
207+
<!-- Third Party assemblies to sign -->
208+
<ThirdPartyAssembliesToSign Include="$(ArtifactsDirectory)Newtonsoft.Json.dll" />
203209
</ItemGroup>
204210

205211
<!-- Intellitrace -->
@@ -308,6 +314,10 @@
308314
<CoreAssembliesToSign Include="$(ArtifactsCoreDirectory)%(ResxLang.Identity)\*.*" />
309315
<CoreAssembliesToSign Include="$(ArtifactsCoreDirectory)Extensions\%(ResxLang.Identity)\*.*" />
310316
<CoreAssembliesToSign Include="$(ArtifactsCoreDirectory)TestHost\%(ResxLang.Identity)\*.*" />
317+
318+
<!-- Third Party assemblies to sign -->
319+
<ThirdPartyAssembliesToSign Include="$(ArtifactsCoreDirectory)Newtonsoft.Json.dll" />
320+
<ThirdPartyAssembliesToSign Include="$(ArtifactsCoreDirectory)TestHost\Newtonsoft.Json.dll" />
311321
</ItemGroup>
312322

313323
<!-- Sign Microsoft.TestPlatform.Build -->
@@ -384,6 +394,11 @@
384394
<TestHostCoreAssembliesToSign Include="$(ArtifactsBaseDirectory)Microsoft.TestPlatform.TestHost\netcoreapp2.1\%(ResxLang.Identity)\*.*" />
385395
<TestHostCoreAssembliesToSign Include="$(ArtifactsBaseDirectory)Microsoft.TestPlatform.TestHost\net451\$(TargetRuntime)\%(ResxLang.Identity)\*.*" />
386396
<TestHostCoreAssembliesToSign Include="$(ArtifactsBaseDirectory)Microsoft.TestPlatform.TestHost\uap10.0\%(ResxLang.Identity)\*.*" />
397+
398+
<!-- Third Party assemblies to sign -->
399+
<ThirdPartyAssembliesToSign Include="$(ArtifactsBaseDirectory)Microsoft.TestPlatform.TestHost\netcoreapp2.1\Newtonsoft.Json.dll" />
400+
<ThirdPartyAssembliesToSign Include="$(ArtifactsBaseDirectory)Microsoft.TestPlatform.TestHost\uap10.0\Newtonsoft.Json.dll" />
401+
<ThirdPartyAssembliesToSign Include="$(ArtifactsBaseDirectory)Microsoft.TestPlatform.TestHost\net451\$(TargetRuntime)\Newtonsoft.Json.dll" />
387402
</ItemGroup>
388403

389404
<ItemGroup>
@@ -416,8 +431,18 @@
416431
<Authenticode>Microsoft402400</Authenticode>
417432
<StrongName>StrongName</StrongName>
418433
</CodeCoverageAssembliesToSign>
434+
435+
<ThirdPartyAssembliesToSign>
436+
<Authenticode>3PartySHA2</Authenticode>
437+
</ThirdPartyAssembliesToSign>
419438
</ItemGroup>
420439

440+
<Message Text="Signing 3rd party assemblies using authenticode certificate '%(ThirdPartyAssembliesToSign.Authenticode)' for @(CoreAssembliesToSign)"/>
441+
<SignFiles Files="@(ThirdPartyAssembliesToSign)"
442+
BinariesDirectory="$(ArtifactsBaseDirectory)"
443+
IntermediatesDirectory="$(IntermediatesDirectory)"
444+
Type="$(SignType)" />
445+
421446
<Message Text="Signing using authenticode certificate '%(AssembliesToSign.Authenticode)' for @(AssembliesToSign)"/>
422447
<SignFiles Files="@(AssembliesToSign)"
423448
BinariesDirectory="$(ArtifactsDirectory)"

0 commit comments

Comments
 (0)