-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use managed Mach-O signer on non-Mac hosts #45019
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
1 similar comment
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
@@ -509,5 +507,62 @@ private static bool IsPE32(string path) | |||
return reader.PEHeaders.PEHeader.Magic == PEMagic.PE32; | |||
} | |||
} | |||
|
|||
// Reads the Mach-O load commands and returns true if an LC_CODE_SIGNATURE command is found, otherwise returns false | |||
static bool HasMachOSignatureLoadCommand(FileInfo file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't matter for this change, but we may want this in a shared test helper so that we can add cross-platform checks for single-file publish with signing after dotnet/runtime#110417 goes in.
/ba-g test failures are all known |
In dotnet/runtime#108992, we added a managed ad-hoc signer that's used in HostWriter.CreateAppHost. This PR enables it to be used in the sdk when publishing for osx on non-Mac hosts so that developers can distribute an ad-hoc signed binary without using a Mac. Tests on all platforms ensure that there is a load command with the LC_CODE_SIGNATURE command type in the Mach-O binary. On MacOS, codesign is used to fully validate the signature in addition.
In dotnet/runtime#108992, we added a managed ad-hoc signer that's used in HostWriter.CreateAppHost. This PR enables it to be used in the sdk when publishing for osx on non-Mac hosts so that developers can distribute an ad-hoc signed binary without using a Mac.
Tests on all platforms ensure that there is a load command with the LC_CODE_SIGNATURE command type in the Mach-O binary. On MacOS, codesign is used to fully validate the signature in addition.