-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apple-codesign: rerite bundle signing
This commit overhauls how file traversal during bundle signing works to hopefully align more closely with how Apple's tooling does it. Before, we used code in the apple-bundles crate for walking only files in a directory. And our integration with the CodeResources rules flags was not super robust because we didn't fully understand how they worked. One of the limitations of this approach is that we didn't apply rules to directories. So we relied on our bundle detection code to seal nested bundles. In the new code, we perform a full filesystem walk of the bundle directory and the CodeResources rules are canonical. Rules are applied to directories. And the nested flag is used as the canonical source for whether a path should be sealed. As part of this, we also clean up handling of the main executable. We add an exclusion rule for the main executable so it is excluded from the sealing traversal. While we're here, we also add code for detecting when a regular file is a Mach-O binary and print a warning message about it. This clearly exposes some gaps in recursive bundle signing, as evidenced by test output changing. As the `sign-bundle-multiple-macho` test changes demonstrate, this change appears to fix a bug where we were installing non main exe nested Mach-O binaries into the wrong directory. This may be enough on its own to close a few GitHub issues. But since we still fail to sign Mach-O binaries without the nested flag set, I'm going to hold off referencing issues in this commit message.
- Loading branch information
Showing
11 changed files
with
410 additions
and
433 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.