Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Windows Server 2022 for --append-signature flag #270

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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