Skip to content

Commit 3a85f07

Browse files
Allow untrusted dry-run module signatures
Treat NotTrusted as an intact Authenticode signature during module payload verification so test-environment Key Vault certificates can exercise the signing flow without requiring a trusted root on the runner. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2e4ad93 commit 3a85f07

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎PowerShell/sign-module.ps1‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,13 @@ function Assert-PsignModuleSignatures {
9797

9898
foreach ($target in $Targets) {
9999
$signature = Get-PsignSignature -LiteralPath $target -ErrorAction Stop
100-
if ($signature.Status -ne [System.Management.Automation.SignatureStatus]::Valid) {
100+
if ($signature.SignatureType -ne [System.Management.Automation.SignatureType]::Authenticode -or
101+
$signature.Status -notin @(
102+
[System.Management.Automation.SignatureStatus]::Valid,
103+
[System.Management.Automation.SignatureStatus]::NotTrusted
104+
)) {
101105
$relativePath = Resolve-Path -LiteralPath $target -Relative
102-
throw "Expected valid Authenticode signature for '$relativePath', got '$($signature.Status)': $($signature.StatusMessage)"
106+
throw "Expected intact Authenticode signature for '$relativePath', got '$($signature.Status)': $($signature.StatusMessage)"
103107
}
104108
}
105109
}

0 commit comments

Comments
 (0)