From 1f2865b1f317ab4671b76f490584749518120176 Mon Sep 17 00:00:00 2001 From: Tory Wheelwright Date: Thu, 16 Jan 2020 04:29:49 -0500 Subject: [PATCH] fix(app-builder-lib): signing certificate selection by sha1 (#4499) --- packages/app-builder-lib/src/codeSign/windowsCodeSign.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts b/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts index 58a33df212..113c7eb750 100644 --- a/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts +++ b/packages/app-builder-lib/src/codeSign/windowsCodeSign.ts @@ -116,12 +116,8 @@ export async function getCertificateFromStoreInfo(options: WindowsConfiguration, const rawResult = await vm.exec("powershell.exe", ["Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress"]) const certList = rawResult.length === 0 ? [] : asArray(JSON.parse(rawResult)) for (const certInfo of certList) { - if (certificateSubjectName != null) { - if (!certInfo.Subject.includes(certificateSubjectName)) { - continue - } - } - else if (certInfo.Thumbprint !== certificateSha1) { + if ((certificateSubjectName != null && !certInfo.Subject.includes(certificateSubjectName)) + || certInfo.Thumbprint !== certificateSha1) { continue }