fix (code-signing): Disable code-signing of nuget package's contents - causes identity problems for "dotnet run" - #24
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With the
--recurse-containers falseflag, the step applies only the NuGet author signature to the package itself (.signature.p7s) and leaves the container contents untouched. Nothing of value is lost:dotnet pack, so the package embeds already-signed assemblies. The container pass was merely re-signing them redundantly.dotnet nuget verifycontinues to pass.This also generalizes: any of our ASP.NET Core / Blazor packages that ship static web assets (JS/CSS with SRI hashes in
Microsoft.AspNetCore.StaticWebAssets.props) has the same hazard, and--recurse-containers falseis the same one-line fix, provided assemblies are signed pre-pack.Motivation / Context
Fixes #267 —
Failed to find a valid digest in the 'integrity' attribute for resource '...IgniteUI.Blazor.Lite.*.lib.module.js' ... The resource has been blocked.when consuming the published package in a .NET 10 Blazor WebAssembly app.Referencing
IgniteUI.Blazor.Lite0.1.0 from a stock .NET 10 Blazor WebAssembly Standalone app and runningdotnet runleaves the app stuck at "Loading". The browser console shows:Because the blocked file is a Blazor JS initializer (
*.lib.module.js), the WASM runtime fails to start entirely (MONO_WASM: Failed to import library initializer).By default the
signtool treats the nupkg as a container and recursively Authenticode-signs every supported file inside it — including all 8.jsstatic web assets (.jsis a signable WSH-script type for the tool, signed by appending a// SIG // ... // SIG // End signature blockcomment trailer).The failure chain:
dotnet packcomputes SHA-256 hashes of every static web asset and freezes them as<Integrity>values inbuild/Microsoft.AspNetCore.StaticWebAssets.propsinside the package..jsfiles inside the nupkg by appending the// SIG //signature block — invalidating the frozen hashes. Audit of the shipped 0.1.0 package: 27 of 81 manifest entries mismatched (every.jsasset).integrityattributes (via the importmap generated byOverrideHtmlAssetPlaceholders), the browser's subresource-integrity check fails, and the file is blocked.It only manifests in
dotnet run/ development becausedotnet publishre-fingerprints and recomputes asset integrity, masking the corruption.Note: Authenticode signing of
.jsfiles exists for Windows Script Host scripts (AppLocker/WDAC script enforcement). It is meaningless for browser-delivered JavaScript — browsers don't verify Authenticode, and Microsoft does not Authenticode-signdotnet.js/blazor.webassembly.jseither. For static web assets the signature block is pure corruption.Type of Change (check all that apply):
Component(s) / Area(s) Affected:
N/A
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
README.MDCHANGELOG.MDupdates for newly added functionality