From a19c8fe6acb2b53b1e51937886e0f4479706f0ca Mon Sep 17 00:00:00 2001 From: Kai Leonhardt <8343141+Mik4sa@users.noreply.github.com> Date: Sun, 22 Sep 2024 09:39:19 +0200 Subject: [PATCH] Support Windows Server 2022 for --append-signature flag --- src/AzureSignTool/Program.cs | 4 ++-- .../AuthenticodeKeyVaultSignerTests.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/AzureSignTool/Program.cs b/src/AzureSignTool/Program.cs index f1b6879..d492568 100644 --- a/src/AzureSignTool/Program.cs +++ b/src/AzureSignTool/Program.cs @@ -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; } diff --git a/test/AzureSign.Core.Tests/AuthenticodeKeyVaultSignerTests.cs b/test/AzureSign.Core.Tests/AuthenticodeKeyVaultSignerTests.cs index df5bbb4..b25ae07 100644 --- a/test/AzureSign.Core.Tests/AuthenticodeKeyVaultSignerTests.cs +++ b/test/AzureSign.Core.Tests/AuthenticodeKeyVaultSignerTests.cs @@ -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); @@ -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); @@ -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); @@ -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); @@ -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);