Skip to content

Commit

Permalink
fix: windows signature verification special chars (#8409)
Browse files Browse the repository at this point in the history
* fix: windows signature verification special chars

by applying #8051 and noted in #8162 win signature verification of signatures created using certificates including special chars like german umlauts got broken in electron-updater >= 1.6.9. The issue at hand is that the windows set command does not terminate when reading semicolon `;` and setting %PATH% is a good example for this
c.f. https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb490998(v=technet.10) so instead commands should be concatenated using `&`

Closes #8162
  • Loading branch information
ckarich authored Aug 11, 2024
1 parent 1dcf6bc commit 5fae1cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/proud-cats-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

fix: windows signature verification special chars
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ export function verifySignature(publisherNames: Array<string>, unescapedTempUpda
// https://github.com/electron-userland/electron-builder/issues/2421
// https://github.com/electron-userland/electron-builder/issues/2535
// Resetting PSModulePath is necessary https://github.com/electron-userland/electron-builder/issues/7127
// semicolon wont terminate the set command and run chcp thus leading to verification errors on certificats with special chars like german umlauts, so rather

Check warning on line 36 in packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts

View workflow job for this annotation

GitHub Actions / test-linux (ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configura...

Delete `·`

Check warning on line 36 in packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts

View workflow job for this annotation

GitHub Actions / test-linux (snapTest,debTest,fpmTest,protonTest)

Delete `·`
// join commands using & https://github.com/electron-userland/electron-builder/issues/8162

Check warning on line 37 in packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts

View workflow job for this annotation

GitHub Actions / test-linux (ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configura...

Delete `·`

Check warning on line 37 in packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts

View workflow job for this annotation

GitHub Actions / test-linux (snapTest,debTest,fpmTest,protonTest)

Delete `·`
execFile(
`set "PSModulePath="; chcp 65001 >NUL & powershell.exe`,
`set "PSModulePath=" & chcp 65001 >NUL & powershell.exe`,
["-NoProfile", "-NonInteractive", "-InputFormat", "None", "-Command", `"Get-AuthenticodeSignature -LiteralPath '${tempUpdateFile}' | ConvertTo-Json -Compress"`],
{
shell: true,
Expand Down

0 comments on commit 5fae1cf

Please sign in to comment.