Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expired Windows certificate and release workflow #265

Closed
nop33 opened this issue Jan 15, 2024 · 4 comments · Fixed by #261
Closed

Update expired Windows certificate and release workflow #265

nop33 opened this issue Jan 15, 2024 · 4 comments · Fixed by #261
Assignees
Labels
🖥 DW Desktop wallet

Comments

@nop33
Copy link
Member

nop33 commented Jan 15, 2024

Microsoft changed the way they provide code-signing certificates. They want the signing to be FIPS-140 compliant. That's a very restrictive security standard. Our current release workflow that uses electron-builder needs to be updated.

Related issues:

@nop33 nop33 added the 🖥 DW Desktop wallet label Jan 15, 2024
@nop33 nop33 changed the title Update expired Windows certificate Update expired Windows certificate and release workflow Jan 16, 2024
@nop33
Copy link
Member Author

nop33 commented Jan 16, 2024

@nop33
Copy link
Member Author

nop33 commented Jan 17, 2024

Ledger is utilizing the sign hook of electron-builder with their own script.

@nop33
Copy link
Member Author

nop33 commented Jan 17, 2024

Summary of current status

Our app's executables are being built using electron-builder as a step in our release-desktop.yml GitHub workflow (through the nop33/action-electron-builder GitHub action). That's how the following release files get generated:

  • .exe: executable binary
  • .exe.blockmap: stores delta between version updates
  • .exe.checksum: well, checksum, dah
  • latest.yml: used by the updater to refer to the latest version, .exe, and hash of .exe

@killerwhile has implemented the signing of the above .exe as an additional step of our release-desktop.yml GitHub workflow using the GitHub action sslcom/esigner-codesign.

Problem

The .exe.blockmap, .exe.checksum and latest.yml are created BEFORE the signed Windows .exe file is created: #272. This breaks the checksum check and the auto-update system.

Possible solution 1

Thankfully, electron-builder exposes the sign hook in their config. This allows us to create a signWindows.js file that will be used to sign the .exe BEFORE creating all release-additional files:

// package.json

"build:{
  "win": {
    "sign": "signWindows.js",
  },
},

So, the idea is:

💡 Don't use the sslcom/esigner-codesign GitHub action as a step of our GitHub workflow and create a JS file to do the signing.

This is what this person has done.

I started working on this idea by creating a .signWindows.js file and hooking it up to the electron-builder config (see this WIP PR: #276)

I am stuck at this problem: How do I make the CodeSignTool-v1.3.0-windows executable available to the script? It's 333Mb big and I don't think we should commit that to our repo... Wouldn't it make sense that the JS script downloads and unpacks the CodeSignTool and somehow caches it instead of downloading it on every CI run?

The source code of the GitHub action the @killerwhile used, suggests that this is what they do.

Possible solution 2

Another person managed to solve this using the codesign support in electron-builder along with SSL.com's Cloud Key Adapter.

Related sources

@killerwhile
Copy link
Member

killerwhile commented Jan 17, 2024

The second option is also downloading the eSigner tool, but a version which is only 15MB (https://github.com/element-hq/element-desktop/blob/develop/.github/workflows/build_windows.yaml#L117C1-L117C153).
A more official version seems to be here: https://github.com/SSLcom/eSignerCKA/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥 DW Desktop wallet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants