Skip to content

Commit

Permalink
Support Windows Server 2022 for --append-signature flag (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
vcsjones authored Sep 22, 2024
2 parents 68ac91f + a19c8fe commit 5c66f92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/AzureSignTool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ private bool ValidateArguments(CommandRunContext context)
valid = false;
}

if (AppendSignature && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
if (AppendSignature && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 20348))
{
context.Error.WriteLine("'--append-signature' requires Windows 11 or later.");
context.Error.WriteLine("'--append-signature' requires Windows Server 2022, Windows 11 or later.");
valid = false;
}

Expand Down
10 changes: 5 additions & 5 deletions test/AzureSign.Core.Tests/AuthenticodeKeyVaultSignerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void ShouldSignExeWithRSASigningCertificates_Sha1FileDigest(string certif
var fileToSign = GetFileToSign();
var result = signer.SignFile(fileToSign, null, null, null);
Assert.Equal(0, result);
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 20348))
{
result = signer.SignFile(fileToSign, null, null, null, appendSignature: true);
Assert.Equal(0, result);
Expand All @@ -45,7 +45,7 @@ public void ShouldSignExeWithRSASigningCertificates_Sha256FileDigest(string cert
var fileToSign = GetFileToSign();
var result = signer.SignFile(fileToSign, null, null, null);
Assert.Equal(0, result);
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 20348))
{
result = signer.SignFile(fileToSign, null, null, null, appendSignature: true);
Assert.Equal(0, result);
Expand All @@ -64,7 +64,7 @@ public void ShouldSignExeWithECDsaSigningCertificates_Sha256FileDigest(string ce
var fileToSign = GetFileToSign();
var result = signer.SignFile(fileToSign, null, null, null);
Assert.Equal(0, result);
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 20348))
{
result = signer.SignFile(fileToSign, null, null, null, appendSignature: true);
Assert.Equal(0, result);
Expand All @@ -83,7 +83,7 @@ public void ShouldSignExeWithECDsaSigningCertificates_Sha256FileDigest_WithTimes
var fileToSign = GetFileToSign();
var result = signer.SignFile(fileToSign, null, null, null);
Assert.Equal(0, result);
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 20348))
{
result = signer.SignFile(fileToSign, null, null, null, appendSignature: true);
Assert.Equal(0, result);
Expand All @@ -103,7 +103,7 @@ public void ShouldSignExeWithRSASigningCertificates_Sha256FileDigest_WithTimesta
var fileToSign = GetFileToSign();
var result = signer.SignFile(fileToSign, null, null, null);
Assert.Equal(0, result);
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 22000))
if (OperatingSystem.IsWindowsVersionAtLeast(10, 0, 20348))
{
result = signer.SignFile(fileToSign, null, null, null, appendSignature: true);
Assert.Equal(0, result);
Expand Down

0 comments on commit 5c66f92

Please sign in to comment.