Skip to content

Commit

Permalink
fix(app-builder-lib): signing certificate selection by sha1 (#4499)
Browse files Browse the repository at this point in the history
  • Loading branch information
torywheelwright authored and develar committed Jan 16, 2020
1 parent f1e3242 commit 1f2865b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/app-builder-lib/src/codeSign/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<CertInfo>(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
}

Expand Down

1 comment on commit 1f2865b

@Feverqwe
Copy link

@Feverqwe Feverqwe commented on 1f2865b Jan 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it return true when certificateSha1 in undefined and set correct certificateSubjectName.

(('b' != null && !'abc'.includes('b')) || 'some hash' !== undefined) // true

#4499

Please sign in to comment.