CODE_SIGNING.md 9.9 KB

Code signing (SignPath Foundation)

Windows SmartScreen warns about LYNX.exe because it is not signed. The SignPath Foundation signs open-source software for free, with a certificate issued to "SignPath Foundation", as long as the project follows their terms. This page lists what the repository already does for that and what the maintainer has to do by hand.

What the repository already provides

Requirement Where
OSI-approved licence for LYNX and every component, no proprietary code LICENSE (AGPL-3.0), THIRD_PARTY.md
Binaries built automatically from the public source .github/workflows/release.yml: tag push v* or manual run
Product name and version in the exe VERSIONINFO in resources/LYNX.rc; version from project(LYNX VERSION ...) in CMakeLists.txt
Code signing policy on the README and website README, lynx-share.com (section Code signing & privacy)
Privacy statement PRIVACY.md
SignPath step in CI, off until approved job sign in release.yml, switched on by the repository variable SIGNPATH_ENABLED

The release workflow: build (Ubuntu) cross-compiles LYNX.exe with Zig 0.14.1 and JUCE 8.0.4 (both downloaded and checked by SHA-256) → sign (SignPath, when enabled) → package (Windows) checks the version resource and the signature, runs LYNX.exe --selftest, writes Demo.lynx, builds LYNX-<version>-windows-x64.zip and SHA256SUMS.txt, and on a tag push attaches them to the GitHub release (creating a draft release if none exists).

Step by step for the maintainer

1. Turn on two-factor authentication

SignPath requires MFA for everyone with commit or approval rights.

  1. GitHub → Settings → Password and authentication → Enable two-factor authentication (authenticator app or security key). Save the recovery codes.
  2. Optional but recommended: Settings → Branches on the repo, protect main (no force-push, no deletion).

2. Apply

  1. Open https://signpath.org/apply (linked from https://signpath.org) and fill in the form. Suggested answers:
  2. Wait for their e-mail. They may ask questions or request changes; the README and website already say "pending approval".

3. After approval: set up SignPath

SignPath creates an organization for LYNX and invites you to https://app.signpath.io.

  1. Log in, enable MFA on the SignPath account too.
  2. Trusted build system: link GitHub.com (Trusted Build Systems → GitHub.com) and install the SignPath GitHub app on Ka1-S/LYNX-SHARE when asked. This lets SignPath verify that the artifact came from this repository's workflow.
  3. Project: create (or check) the project with slug LYNX, repository https://github.com/Ka1-S/LYNX-SHARE.
  4. Artifact configuration (the GitHub artifact LYNX-unsigned is a zip containing LYNX.exe):

    <?xml version="1.0" encoding="utf-8"?>
    <artifact-configuration xmlns="http://signpath.io/artifact-configuration/v1">
     <zip-file>
       <pe-file path="LYNX.exe">
         <authenticode-sign/>
       </pe-file>
       <!-- the 32-bit plugin bridge (round 176a), started by LYNX.exe for 32-bit plugins -->
       <pe-file path="LYNX-bridge32.exe">
         <authenticode-sign/>
       </pe-file>
     </zip-file>
    </artifact-configuration>
    

SignPath can also check the exe's product name/version here; see their artifact configuration docs.

  1. Signing policy: slug release-signing, certificate from SignPath Foundation, approver Ka1-S, and limit it to the main branch / v* tags if offered.
  2. CI user: Users → add a CI user with the Submitter role on the project, create an API token.

4. Connect the GitHub repository

GitHub → repo Settings → Secrets and variables → Actions:

Kind Name Value
Secret SIGNPATH_API_TOKEN the CI user's API token
Variable SIGNPATH_ORGANIZATION_ID organization id (SignPath → Settings, a GUID)
Variable SIGNPATH_PROJECT_SLUG LYNX (only needed if different)
Variable SIGNPATH_POLICY_SLUG release-signing (only needed if different)
Variable SIGNPATH_ENABLED true

Then update the wording: in README.md (section Code signing policy) and website/index.html (#signing, English and PT strings) remove "pending approval", and drop the SmartScreen note from the Download section.

5. Every release

  1. Bump project(LYNX VERSION x.y.z) in CMakeLists.txt (the only version source), commit, then git tag vX.Y.Z-alpha && git push origin vX.Y.Z-alpha.
  2. The Release workflow starts; the sign job submits a signing request and waits.
  3. Open the request in https://app.signpath.io (you also get an e-mail), check that it comes from the expected commit and workflow run, and click Approve within 5 h 45 min (GitHub stops a hosted job at 6 h; if it times out, use the separate Sign release workflow, section 6).
  4. The package job self-tests the signed exe and attaches LYNX.exe, the zip and SHA256SUMS.txt to the release (a draft is created if the release does not exist yet). Edit the notes and publish.

Only binaries from this workflow may be signed; never upload a locally built exe for signing.

6. Signing a release later, or when the approval is late (workflow Sign release)

release-signing needs a manual approval in the SignPath web app. The sign job of release.yml waits for it for at most 5 h 45 min. The separate workflow sign-release.yml (Actions › Sign release › Run workflow) signs a release that already exists and can be run again as often as needed. It works on the files of the tag's draft or published release, so it is also the way to sign a release that was built unsigned.

Inputs: tag (e.g. v0.1.30-alpha), signing_request_id (optional), dry_run (optional).

  1. Run it with the tag. Job prepare downloads LYNX-<label>-windows-x64.zip from the release and takes the unsigned LYNX.exe and LYNX-bridge32.exe out of it. Job sign submits them to SignPath with the same project (SIGNPATH_PROJECT_SLUG, default LYNX), policy (SIGNPATH_POLICY_SLUG, default release-signing), organization and token as release.yml, and prints the request id and its SignPath link in the job summary. Running the workflow is the switch: SIGNPATH_ENABLED is not consulted.
  2. Approve in SignPath. Open the request link (or https://app.signpath.io › Signing requests), check that it comes from the expected tag and this repository, and click Approve. The job polls every minute and continues when the request is Completed; it stops with an error when the request is denied, failed or cancelled.
  3. Approval came late? The job gives up after 5 h 45 min. The request itself stays open in SignPath, so approve it whenever you like, then run Sign release again with the same tag and signing_request_id set to the id from the first run's summary: no new request is made, the workflow only downloads the signed files of that request.
  4. Only a verified signature changes the release. Job publish (Windows) checks the Authenticode signature of both files (Valid; with the test-signing policy: a signature from SignPath's test certificate, as in release.yml), checks the version resource, rebuilds the portable zip and the installer from the zip's contents with the signed files, self-tests the signed LYNX.exe and runs an install/uninstall of the new installer. Only then it uploads LYNX.exe, LYNX-<label>-windows-x64.zip, LYNX-<label>-setup-x64.exe and a SHA256SUMS.txt with those three lines updated (--clobber). Any failure leaves the release exactly as it was. The Store package is not touched (the Store signs it).
  5. dry_run: true only does step 1 (download, unpack, hash, upload the SignPath input as a workflow artifact): no SignPath request, no change to the release. Use it to check a tag before the first real run.

release.yml's own sign job keeps working as before (test signing, and release signing while the approval arrives within 5 h 45 min); the two paths are independent. The installer file itself is not Authenticode-signed (SignPath's artifact configuration lists LYNX.exe and LYNX-bridge32.exe); it contains the signed ones.

Things to keep in mind

  • SignPath signs only what the project builds itself. Do not bundle other people's binaries (plugins, DLLs) in a signed release.
  • The FL Studio behaviour reproduced in LYNX is documented clean-room work (docs/analise/), with no Image-Line code or content. If SignPath asks about it, point them to that folder and to the Credits and notice section of the README.
  • If an installer is added (scripts/make-installer.sh), add it to the build/package jobs and to the artifact configuration so it is signed too.