Skip to content

Clarify SignCheck skip reason for files that can't be PGP/Pkg/Mach-O verified - #7216

Merged
mmitche merged 1 commit into
dotnet:mainfrom
akoeplinger:ClarifySignCheckSkipReason
Jun 22, 2026
Merged

mmitche merged 1 commit into
dotnet:mainfrom
akoeplinger:ClarifySignCheckSkipReason

Conversation

@akoeplinger

@akoeplinger akoeplinger commented Jun 12, 2026 •

Copy link
Copy Markdown
Member

What

Replaces the misleading Skipped (unsupported file type) message in SignCheck output with a composable skip detail that clearly states why the file's own signature wasn't verified and what happened to the archive's nested contents:

Skipped (<reason>; <contents disposition>)

Why

Today, any .tar.gz whose detached .sig sidecar isn't present (or where gpg/MacOsPkg/codesign can't run on the current platform) is reported as a flat Skipped (unsupported file type) — which reads as "the whole archive was ignored", when in fact ArchiveVerifier.VerifyContent still recurses into the archive when --recursive is enabled. This caused confusion when triaging signing-validation output on Windows for .tar.gz artifacts that only ship .sig files on the Linux package feeds.

How

Reason fragment comes from one of two places:

  • PlatformNotSupportedException.Message thrown by the verifier when its signature check can't run on the current platform. The existing PNSE messages were reworded as user-facing fragments (no trailing period, no internal jargon like "MacOsPkg tooling") so they can be reused for output.
  • An explicit reason string passed to a new VerifySkipped(path, parent, virtualPath, reason) helper, used by PgpVerifier in the no-.sig path (the only case that isn't a PNSE).

Contents disposition is computed from VerifyRecursive and a new ContentVerificationSupported virtual that subclasses override when archive extraction itself is platform-gated. Branches:

  • archive contents recursively verified — --recursive is on and the platform can unpack
  • archive contents not verified — run with --recursive to verify nested files
  • archive contents not verified — not supported on this platform — platform-unsupported wins over no-recursive, because even with --recursive the platform still can't unpack

PkgVerifier overrides ContentVerificationSupported to RuntimeInformation.IsOSPlatform(OSPlatform.OSX) so off-macOS the message correctly says contents weren't verified either.

MachOVerifier derives from FileVerifier (not ArchiveVerifier, no nested contents) and keeps a Mach-O-specific message for PlatformNotSupportedException while falling back to Skipped (unsupported file type) for InvalidDataException (file genuinely isn't Mach-O).

Examples

Scenario Output
.tar.gz without .sig, --recursive on Skipped (no PGP signature available to verify; archive contents recursively verified)
.tar.gz without .sig, --recursive off Skipped (no PGP signature available to verify; archive contents not verified — run with --recursive to verify nested files)
.pkg on Windows, --recursive on Skipped (.pkg signature verification is only supported on macOS; archive contents not verified — not supported on this platform)
Truly unknown file type Skipped (unsupported file type) (unchanged)

Also

  • Fixed a double-period typo in UnsupportedFileTypeResult's XML doc comment.

Copilot AI review requested due to automatic review settings June 12, 2026 17:20
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team June 12, 2026 17:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines SignCheck “Skipped (unsupported file type)” reporting so archives that cannot have their own signature verified (missing detached signatures or platform-limited verifiers) can emit verifier-specific skip reasons, reducing confusion while triaging signing output.

Changes:

  • Added an overload to create “unsupported file type” results with a custom skip detail string.
  • Introduced ArchiveVerifier.UnsupportedFileTypeDetail so archive verifiers can provide more precise skip reasons without changing helper method signatures.
  • Updated PGP/.pkg and Mach-O verifiers plus resource strings to surface clearer platform/signature-availability messaging.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/arcade/src/Microsoft.DotNet.SignCheckLibrary/Verification/SignatureVerificationResult.cs Adds an overload to attach a custom skip detail for unsupported/skipped results.
src/arcade/src/Microsoft.DotNet.SignCheckLibrary/Verification/PkgVerifier.cs Overrides archive skip detail for .pkg/.app verification.
src/arcade/src/Microsoft.DotNet.SignCheckLibrary/Verification/PgpVerifier.cs Overrides archive skip detail for “no PGP signature verified” scenarios and updates comments/doc.
src/arcade/src/Microsoft.DotNet.SignCheckLibrary/Verification/MachOVerifier.cs Uses exception-type-specific skip detail to distinguish unsupported platform vs non–Mach-O inputs.
src/arcade/src/Microsoft.DotNet.SignCheckLibrary/Verification/ArchiveVerifier.cs Adds a virtual skip-detail hook and wires it into unsupported file handling.
src/arcade/src/Microsoft.DotNet.SignCheckLibrary/SignCheckResources.resx Adds new localized skip-detail strings for PGP/.pkg/Mach-O scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@akoeplinger
akoeplinger force-pushed the ClarifySignCheckSkipReason branch from 7933f13 to 7e28109 Compare June 13, 2026 09:54
Replace the misleading 'Skipped (unsupported file type)' message with a
composable detail of the form 'Skipped (<reason>; <contents disposition>)':

- Reason comes from PlatformNotSupportedException.Message (reworded as
  user-facing fragments) or, for PgpVerifier's no-.sig path, from an
  explicit string passed to a new VerifySkipped helper.
- Contents disposition is 'recursively verified', 'not verified — run
  with --recursive', or 'not verified — not supported on this platform',
  based on VerifyRecursive and a new ContentVerificationSupported virtual
  (overridden by PkgVerifier off macOS).

MachOVerifier keeps a Mach-O-specific message for PNSE and the generic
'unsupported file type' for InvalidDataException. Also fixes a
double-period typo in UnsupportedFileTypeResult's doc comment.

Co-authored-by: Copilot <[email protected]>
@akoeplinger
akoeplinger force-pushed the ClarifySignCheckSkipReason branch from 7e28109 to 1b55c80 Compare June 15, 2026 08:04
@mmitche
mmitche merged commit 8b3881c into dotnet:main Jun 22, 2026
11 checks passed
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team June 22, 2026 23:04
@akoeplinger
akoeplinger deleted the ClarifySignCheckSkipReason branch June 25, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants