diff --git a/ci/package-windows.py b/ci/package-windows.py index 3310fa5a..e7e92ba7 100644 --- a/ci/package-windows.py +++ b/ci/package-windows.py @@ -15,6 +15,7 @@ import json import pathlib +import struct import sys import zipfile @@ -26,6 +27,7 @@ def release(version: str, exe: str, out_dir: str) -> None: exe_path = pathlib.Path(exe) if exe_path.suffix != ".exe" or not exe_path.is_file(): sys.exit(f"not a Windows executable: {exe}") + signed = _has_authenticode_signature(exe_path) name = f"alkane-toolkit-v{version}-windows-x86_64" out = pathlib.Path(out_dir) / f"{name}.zip" out.parent.mkdir(parents=True, exist_ok=True) @@ -35,6 +37,14 @@ def release(version: str, exe: str, out_dir: str) -> None: "Run alkane-toolkit.exe. No installer and no extra runtime are needed:\r\n" "the executable is self-contained and runs on Windows 10 and 11.\r\n" "\r\n" + + ( + "The executable is signed by Blueflare (Azure Artifact Signing). To check:\r\n" + "right-click alkane-toolkit.exe > Properties > Digital Signatures.\r\n" + if signed else + "This build is not code-signed, so Windows SmartScreen may warn on first\r\n" + "run: choose More info > Run anyway.\r\n" + ) + + "\r\n" "Settings are kept in %APPDATA%\\alkane-toolkit.\r\n" "SSH-based actions use the OpenSSH client built into Windows (ssh.exe);\r\n" "HTTP actions use curl.exe, also built in.\r\n" @@ -49,6 +59,15 @@ def release(version: str, exe: str, out_dir: str) -> None: print(out) +def _has_authenticode_signature(exe: pathlib.Path) -> bool: + """True if the PE file carries a certificate table (an Authenticode signature).""" + data = exe.read_bytes() + pe = struct.unpack_from(" 0 + + def tests(cargo_json: str, out_zip: str) -> None: executables = [] for line in pathlib.Path(cargo_json).read_text().splitlines(): diff --git a/docs/windows.md b/docs/windows.md index 7ae3ade5..721757d4 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -73,8 +73,11 @@ Signing (formerly Trusted Signing), so Windows and SmartScreen show | Signer | `ci/sign-windows.sh` (jsign from the CI image, RFC 3161 timestamp from `timestamp.acs.microsoft.com`) | | Check | `windows-native.yml` requires `Get-AuthenticodeSignature` = Valid on real Windows once signing is on | -Turning it on, once Microsoft approves the identity validation (portal: -signing account > Identity validations): +Signing is on since 2026-11-03 (identity validation approved, certificate +profile `alkane-toolkit`, PublicTrust). The zip's README.txt states whether its +executable is signed. To set it up again, e.g. for a new profile, after an +identity validation is approved (portal: signing account > Identity +validations): ```sh scripts/enable-windows-signing.sh