Skip to content

Preserve file extensions so msix can be signed, and fail when signing does not happen - #21

Closed
JoshuaPeddle wants to merge 1 commit into
mainfrom
fix/15101-msix-codesigning
Closed

JoshuaPeddle wants to merge 1 commit into
mainfrom
fix/15101-msix-codesigning

Conversation

@JoshuaPeddle

Copy link
Copy Markdown
Contributor

Description

Uploads were stored under a generated id with no extension. signtool selects the handler for container formats such as msix by file name, so it refused the package and exited non-zero for the whole batch, which left the msi and exe unsigned too. Two further defects hid that: a batch level signing error was written under the batch id but polled for under the per-file id, so every poll saw 425 until the client's 1200 second timeout, and the client then reported no failures and exited 0, so the pipeline published unsigned installers to Box. The client now sends the original extension on upload and poll, the service keeps it on the working file, batch errors are surfaced to pollers, and an expired batch timeout is reported as a failure.

Motivation and Context

https://github.com/TownSuite/TownSuite.IssueTracker/issues/15101

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • All new and existing tests passed.

… does not happen

TownSuite/TownSuite.IssueTracker#15101

Uploads were stored under a generated id with no extension, so signtool did not recognize an msix and failed the whole batch, leaving the msi and exe unsigned as well. The failure was then invisible: batch errors were written under the batch id but polled for under the file id, and the client treated its own timeout as success, so builds published unsigned installers.

- Client sends the original extension as X-FileExtension on upload and poll, and the service keeps it on the working file so signtool recognizes msix and appx. An absent header keeps the previous behaviour.
- Validate that extension against a short alphanumeric pattern before it reaches a signtool command line.
- GET /sign/batch checks the batch level error file as well as the per-file one, so a batch failure returns 500 instead of 425 until the client gives up.
- DownloadSignedFiles reports files still outstanding when the batch timeout expires, so a timeout exits non-zero.
- Add coverage, including an end to end msix sign through the batch endpoint using real makeappx and signtool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant