Skip to content

Commit

Permalink
Issue #387: Certificate password can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-shilo committed Jun 6, 2018
1 parent 90111a5 commit aa27aa2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Source/src/WixSharp/CommonTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static public int DigitalySign(string fileToSign, string pfxFile, string timeURL
string certPlace = useCertificateStore ? "/n" : "/f";

string args = $"sign /v {certPlace} \"{pfxFile}\"";
if (password != null)
if (password.IsNotEmpty())
args += $" /p \"{password}\"";

string sha1 = args;
Expand All @@ -211,10 +211,12 @@ static public int DigitalySign(string fileToSign, string pfxFile, string timeURL
@"C:\Program Files (x86)\Windows Kits\10\bin\x86;" +
@"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86",
ExePath = "signtool.exe",
Arguments = sha1,
ConsoleOut = (line) => Compiler.OutputWriteLine(line.Replace(password, "***"))
Arguments = sha1
};

if (password.IsNotEmpty())
tool.ConsoleOut = (line) => Compiler.OutputWriteLine(line.Replace(password, "***"));

var retval = tool.ConsoleRun();
var sha1Signed = retval == 0 || retval == 2;
if (!dualSign || !sha1Signed)
Expand Down

0 comments on commit aa27aa2

Please sign in to comment.