forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new Windows signature APIs from
Microsoft.Security.Extensions
p…
…ackage (PowerShell#17159) Co-authored-by: Anam Navied <[email protected]> Co-authored-by: Travis Plunk <[email protected]>
- Loading branch information
1 parent
c2e11e9
commit 8d453da
Showing
8 changed files
with
211 additions
and
268 deletions.
There are no files selected for viewing
186 changes: 93 additions & 93 deletions
186
src/Microsoft.PowerShell.Security/security/CertificateProvider.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
Describe "Windows platform file signatures" -Tags 'Feature' { | ||
|
||
It "Verifies Get-AuthenticodeSignature returns correct signature for catalog signed file" -Skip:(!$IsWindows) { | ||
|
||
if ($null -eq $env:windir) { | ||
throw "Expected Windows platform environment path variable '%windir%' not available." | ||
} | ||
|
||
$filePath = Join-Path -Path $env:windir -ChildPath 'System32\ntdll.dll' | ||
if (! (Test-Path -Path $filePath)) { | ||
throw "Expected Windows PowerShell platform module path '$filePath' not found." | ||
} | ||
|
||
$signature = Get-AuthenticodeSignature -FilePath $filePath | ||
$signature | Should -Not -BeNullOrEmpty | ||
$signature.Status | Should -BeExactly 'Valid' | ||
$signature.SignatureType | Should -BeExactly 'Catalog' | ||
} | ||
} |
This file contains 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