Skip to content

Commit

Permalink
Merge pull request #1737 from NJullienSweet/master
Browse files Browse the repository at this point in the history
Add "unspecified" store type to allow third-party tool AzureSignTool
  • Loading branch information
oleg-shilo authored Feb 5, 2025
2 parents 88acb4c + bd13294 commit 4ea49f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions Source/src/WixSharp/CommonTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,24 @@ static public int DigitalySign(string fileToSign, string certificateId, string t
bool shouldSignSHA1 = (hashAlgorithm & HashAlgorithmType.sha1) == HashAlgorithmType.sha1;
bool shouldSignSHA256 = (hashAlgorithm & HashAlgorithmType.sha256) == HashAlgorithmType.sha256;

string certPlace;
string certOption;
switch (certificateStore)
{
case StoreType.commonName:
certPlace = "/n";
certOption = "/n";
break;

case StoreType.sha1Hash:
certPlace = "/sha1";
certOption = "/sha1";
break;

case StoreType.file:
certOption = "/f";
break;

case StoreType.unspecified:
default:
certPlace = "/f";
certOption = string.Empty;
break;
}

Expand All @@ -240,7 +245,9 @@ static public int DigitalySign(string fileToSign, string certificateId, string t
break;
}

string args = $"sign {outputLevelArg}{certPlace} \"{certificateId}\"";
string certPart = certOption.IsEmpty() ? string.Empty : $"{certOption} \"{certificateId}\"";

string args = $"sign {outputLevelArg}{certPart}";
if (password.IsNotEmpty())
args += $" /p \"{password}\"";

Expand Down
3 changes: 2 additions & 1 deletion Source/src/WixSharp/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ public enum StoreType
{
file,
commonName,
sha1Hash
sha1Hash,
unspecified
}

[Flags]
Expand Down

0 comments on commit 4ea49f7

Please sign in to comment.