|
1 |
| -<Project> |
| 1 | +<Project InitialTargets="SetupFilesToSign"> |
2 | 2 |
|
3 | 3 | <!-- If this file was pulled in via prepare-artifacts.proj (a non-SDK project, these files are already
|
4 | 4 | imported. -->
|
|
12 | 12 |
|
13 | 13 | During post build signing, there are no packages to sign during SignFinalPackages.
|
14 | 14 | -->
|
15 |
| - <AllowEmptySignList Condition="'$(SignFinalPackages)' != 'true' or '$(PostBuildSign)' == 'true'">true</AllowEmptySignList> |
| 15 | + <AllowEmptySignList>true</AllowEmptySignList> |
16 | 16 | </PropertyGroup>
|
17 | 17 |
|
18 | 18 | <ItemGroup>
|
|
22 | 22 | -->
|
23 | 23 | <ItemsToSign Remove="@(ItemsToSign)" />
|
24 | 24 |
|
25 |
| - <!-- Find bundle artifacts, which need multiple stages to fully sign. --> |
26 |
| - <BundleInstallerEngineArtifact Include="$(ArtifactsPackagesDir)**/*engine.exe" /> |
27 |
| - <BundleInstallerExeArtifact Include="$(ArtifactsPackagesDir)**/*.exe" /> |
28 |
| - |
29 | 25 | <!-- apphost and comhost template files are not signed, by design. -->
|
30 | 26 | <FileSignInfo Include="apphost.exe;singlefilehost.exe;comhost.dll" CertificateName="None" />
|
31 | 27 |
|
|
49 | 45 | <FileExtensionSignInfo Include=".deb;.rpm" CertificateName="LinuxSign" />
|
50 | 46 | </ItemGroup>
|
51 | 47 |
|
52 |
| - <!-- When doing post build signing, the file containers (e.g. nupkg, msi, etc.) are |
53 |
| - processed for signing (opened up, individually signed, etc.) and these individual ItemsToSign |
54 |
| - elements are unnecessary. When signing within the build, we need to individually process |
55 |
| - dll's, exes, etc. that go into msi's because these containers are not able to be processed |
56 |
| - by SignTool after they are packed up. What makes this possible for post build signing |
57 |
| - is that the build will produce a zip file containing the inputs to the Wix light linker |
58 |
| - which can be used to create the installer later, after the inputs have been signed and replaced. --> |
59 |
| - <Choose> |
60 |
| - <When Condition="'$(PostBuildSign)' != 'true'"> |
61 |
| - <ItemGroup Condition="'$(SignBinaries)' == 'true'"> |
62 |
| - <!-- Sign CoreCLR. --> |
63 |
| - <ItemsToSign Include="$(CoreCLRSharedFrameworkDir)*.dll" /> |
64 |
| - <ItemsToSign Include="$(CoreCLRSharedFrameworkDir)*.exe" /> |
65 |
| - |
66 |
| - <ItemsToSign Include="$(CoreCLRArtifactsPath)System.Private.CoreLib.dll" /> |
67 |
| - |
68 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.exe" /> |
69 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)crossgen2.dll" /> |
70 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.DependencyAnalysisFramework.dll" /> |
71 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.ReadyToRun.dll" /> |
72 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)ILCompiler.TypeSystem.ReadyToRun.dll" /> |
73 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)jitinterface_$(TargetArchitecture).dll" /> |
74 |
| - |
75 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjit_win_x86_$(TargetArchitecture).dll" /> |
76 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjit_win_arm_$(TargetArchitecture).dll" /> |
77 |
| - <ItemsToSign Include="$(CoreCLRCrossgen2Dir)clrjit_unix_arm_$(TargetArchitecture).dll" /> |
78 |
| - <ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_win_x64_$(TargetArchitecture).dll" /> |
79 |
| - <ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_win_arm64_$(TargetArchitecture).dll" /> |
80 |
| - <ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_unix_x64_$(TargetArchitecture).dll" /> |
81 |
| - <ItemsToSign Condition="'$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'x64'" Include="$(CoreCLRCrossgen2Dir)clrjit_unix_arm64_$(TargetArchitecture).dll" /> |
82 |
| - |
83 |
| - <ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/*.dll" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" /> |
84 |
| - <ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/*.exe" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" /> |
85 |
| - |
86 |
| - <!-- Sign api-ms-win-core-xstate-l2-1-0 binary as it is only catalog signed in the current SDK. --> |
87 |
| - <ItemsToSign |
88 |
| - Condition="'$(Configuration)' == 'Release' and '$(TargetArchitecture)' == 'x86'" |
89 |
| - Include="$(CoreCLRArtifactsPath)Redist\ucrt\DLLs\$(TargetArchitecture)\api-ms-win-core-xstate-l2-1-0.dll" /> |
90 |
| - |
91 |
| - <!-- Sign libraries. --> |
92 |
| - <ItemsToSign Include="$(LibrariesNativeArtifactsPath)*.dll" /> |
93 |
| - <ItemsToSign Include="$(LibrariesSharedFrameworkRefArtifactsPath)*.dll" /> |
94 |
| - <!-- Most runtime artifacts will be crossgenned, so sign them post-crossgen. mscorlib isn't. --> |
95 |
| - <ItemsToSign Include="$(LibrariesSharedFrameworkBinArtifactsPath)mscorlib.dll" /> |
96 |
| - |
97 |
| - <!-- Sign the host. --> |
98 |
| - <ItemsToSign Include="$(BaseOutputRootPath)corehost/**/hostfxr.dll" /> |
99 |
| - <ItemsToSign Include="$(BaseOutputRootPath)corehost/**/hostpolicy.dll" /> |
100 |
| - <ItemsToSign Include="$(BaseOutputRootPath)corehost/**/dotnet.exe" /> |
101 |
| - <ItemsToSign Include="$(BaseOutputRootPath)corehost/**/ijwhost.dll" /> |
102 |
| - <ItemsToSign Include="$(BaseOutputRootPath)corehost/**/nethost.dll" /> |
103 |
| - |
104 |
| - <!-- Sign managed libraries in installer subset. --> |
105 |
| - <ItemsToSign Include="$(ArtifactsBinDir)Microsoft.NET.HostModel/**/*.dll" /> |
106 |
| - </ItemGroup> |
107 |
| - |
108 |
| - <!-- Sign ready-to-run binaries after crossgen is applied. --> |
109 |
| - <ItemGroup Condition="'$(SignR2RBinaries)' == 'true'"> |
110 |
| - <ItemsToSign Include="$(CrossGenRootPath)**/*.dll" /> |
111 |
| - </ItemGroup> |
112 |
| - |
113 |
| - <ItemGroup Condition="'$(SignMsiFiles)' == 'true'"> |
114 |
| - <ItemsToSign Include="$(ArtifactsPackagesDir)**/*.msi" /> |
115 |
| - <ItemsToSign Include="$(ArtifactsPackagesDir)**/*.cab" /> |
116 |
| - </ItemGroup> |
117 |
| - |
118 |
| - <ItemGroup Condition="'$(SignBurnEngineFiles)' == 'true'"> |
119 |
| - <ItemsToSign Include="@(BundleInstallerEngineArtifact)" /> |
120 |
| - </ItemGroup> |
121 |
| - |
122 |
| - <ItemGroup Condition="'$(SignBurnBundleFiles)' == 'true'"> |
123 |
| - <!-- Sign the bundles, now that the engine is reattached. Avoid re-signing the engine. --> |
124 |
| - <ItemsToSign |
125 |
| - Include="@(BundleInstallerExeArtifact)" |
126 |
| - Exclude="@(BundleInstallerEngineArtifact)" /> |
127 |
| - <!-- Note: wixstdba is internal to the engine bundle and does not get signed. --> |
128 |
| - </ItemGroup> |
129 |
| - |
130 |
| - <ItemGroup Condition="'$(SignFinalPackages)' == 'true'"> |
131 |
| - <DownloadedSymbolPackages Include="$(DownloadDirectory)**\*.symbols.nupkg" /> |
132 |
| - <ItemsToSign Include="$(DownloadDirectory)**\*.nupkg" Exclude="@(DownloadedSymbolPackages)" /> |
133 |
| - |
134 |
| - <!-- The cross OS diagnostics symbol packages need to be signed as they are the only packages |
135 |
| - that have a specific version of assets that are only meant to be indexed in symbol servers. |
136 |
| - Since only *symbols.nupkg get indexed, and installer doesn't produce these, we need to glob them for signing. --> |
137 |
| - <ItemsToSign Include="$(DownloadDirectory)**\*CrossOsDiag*.symbols.nupkg" /> |
138 |
| - |
139 |
| - <ItemsToSign Include="$(DownloadDirectory)**\*.deb" /> |
140 |
| - <ItemsToSign Include="$(DownloadDirectory)**\*.rpm" /> |
141 |
| - </ItemGroup> |
142 |
| - </When> |
143 |
| - |
144 |
| - <!-- When doing post build signing, we sign all artifacts we would push. |
145 |
| - Symbol packages are included too. --> |
146 |
| - <When Condition="'$(PostBuildSign)' == 'true'"> |
147 |
| - <ItemGroup> |
148 |
| - <ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.msi" Condition="'$(PrepareArtifacts)' == 'true'" /> |
149 |
| - <ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.exe" Condition="'$(PrepareArtifacts)' == 'true'" /> |
150 |
| - <ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.nupkg" Condition="'$(PrepareArtifacts)' == 'true'" /> |
151 |
| - <ItemsToSignWithPaths Include="$(DownloadDirectory)**/*.zip" Condition="'$(PrepareArtifacts)' == 'true'" /> |
152 |
| - |
153 |
| - <ItemsToSignWithoutPaths Include="@(ItemsToSignWithPaths->'%(Filename)%(Extension)')" /> |
154 |
| - <ItemsToSignPostBuild Include="@(ItemsToSignWithoutPaths->Distinct())" /> |
155 |
| - </ItemGroup> |
156 |
| - |
157 |
| - <!-- Even when doing post build signing, sign mscordaccore*.dll and mscordbi.dll --> |
158 |
| - <ItemGroup Condition="'$(SignBinaries)' == 'true'"> |
159 |
| - <ItemsToSign Include="$(CoreCLRSharedFrameworkDir)mscordaccore*.dll" /> |
160 |
| - <ItemsToSign Include="$(CoreCLRSharedFrameworkDir)mscordbi.dll" /> |
161 |
| - <ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/mscordaccore*.dll" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" /> |
162 |
| - <ItemsToSign Include="$(CoreCLRArtifactsPath)$(CoreCLRCrossTargetComponentDirName)/sharedFramework/mscordbi.dll" Condition="'$(CoreCLRCrossTargetComponentDirName)' != ''" /> |
163 |
| - </ItemGroup> |
164 |
| - |
165 |
| - <ItemGroup Condition="'$(SignFinalPackages)' == 'true'"> |
166 |
| - <!-- The cross OS diagnostics symbol packages need to be signed as they are the only packages |
167 |
| - that have a specific version of assets that are only meant to be indexed in symbol servers. |
168 |
| - Since only *symbols.nupkg get indexed, and installer doesn't produce these, we need to glob them for signing. --> |
169 |
| - <ItemsToSign Include="$(DownloadDirectory)**\*CrossOsDiag*.nupkg" /> |
170 |
| - </ItemGroup> |
171 |
| - </When> |
172 |
| - </Choose> |
| 48 | + <Target Name="SetupFilesToSign"> |
| 49 | + <!-- Ensure that we don't miss the DAC or DBI with the globbing below --> |
| 50 | + <PropertyGroup Condition="'$(SignDiagnostics)' == 'true'"> |
| 51 | + <AllowEmptySignList>false</AllowEmptySignList> |
| 52 | + </PropertyGroup> |
| 53 | + |
| 54 | + <ItemGroup Condition="'$(SignDiagnostics)' == 'true'"> |
| 55 | + <ItemsToSign Include="$(DiagnosticsFilesRoot)/**/mscordaccore*.dll" /> |
| 56 | + <ItemsToSign Include="$(DiagnosticsFilesRoot)/**/mscordbi.dll" /> |
| 57 | + <!-- |
| 58 | + The DAC should be signed with the SHA2 cert (both long and short name). |
| 59 | + We already add the short-name DAC above, so add the long-name DAC here. |
| 60 | + --> |
| 61 | + <DacFileSignInfo Include="@(ItemsToSign->'%(FileName)%(Extension)')" |
| 62 | + Condition="$([System.String]::new('%(FileName)').StartsWith('mscordaccore'))" /> |
| 63 | + <FileSignInfo Include="@(DacFileSignInfo->ClearMetadata()->Distinct())" |
| 64 | + Exclude="mscordaccore.dll" |
| 65 | + CertificateName="MicrosoftSHA2" /> |
| 66 | + </ItemGroup> |
| 67 | + |
| 68 | + <ItemGroup Condition="'$(SignFinalPackages)' == 'true'"> |
| 69 | + <!-- The cross OS diagnostics symbol packages need to be signed as they are the only packages |
| 70 | + that have a specific version of assets that are only meant to be indexed in symbol servers. |
| 71 | + Since only *symbols.nupkg get indexed, and installer doesn't produce these, we need to glob them for signing. --> |
| 72 | + <ItemsToSign Include="$(DownloadDirectory)**\*CrossOsDiag*.nupkg" /> |
| 73 | + </ItemGroup> |
| 74 | + </Target> |
173 | 75 |
|
174 | 76 | </Project>
|
0 commit comments