-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Can't sign lib_burst_generated.bundle
within macOS app
#95
Comments
Thank you for the bug report and going the extra mile to code up a shell script to reproduce the failures! This should hopefully be pretty easy to track down. On first glance, there are several subtle differences in the signatures. But the one that stands out as a likely cause of the problem is this:
(It also appears |
I modified the |
This is what Apple's tooling does. Before, if we had both SHA-1 and SHA-256 CDs, we only emitted the SHA-256 variant. There may still be subtle bugs here. So I'm not closing the issue (#95) just yet.
There's a fix on the |
This is what Apple's tooling does. Before, if we had both SHA-1 and SHA-256 CDs, we only emitted the SHA-256 variant. There may still be subtle bugs here. So I'm not closing the issue (#95) just yet.
Your automated reproduction case keeps delivering new bugs. I love it. I'm using a self-signed code signing certificate and noticed the derived designated requirements are different:
That Out of curiosity, were you using a self-signed certificate? Other variances:
And in
I'll try to work through all of these this week to get things working. Clearly there's a handful of small bugs here. |
No - it was an "Apple Development" certificate that I generated at https://developer.apple.com/account/resources/certificates/list. |
It shows: * Different entitlements applied to different settings scopes works * Embedded entitlements are preserved when signing bundles This test also mostly reproduces the failure in #95. I'm still not sure why validation is failing. But I'm pretty confident it isn't entitlements.
OK. A lot of the drift was due to |
After chasing down every other lead, the issue appears to have to do with something I wasn't expecting: incorrect handling of the code signature in the |
Ok, I have some progress. The original bundle / binaries you gave me have code signatures. If you strip the code signatures with I'm still trying to figure out why this is happening. IMO rcodesign's Mach-O is more pure than Apple's because we write 0s to EOF whereas Apple's can preserve the leftover signature data (if the signature is shorter than it was before). But clearly there is a bug in our code somewhere because Apple is failing to validate the file. But I still haven't found the source of why the binary when in a bundle - and only when it is in a bundle - fails validation with Apple tooling. It is very perplexing to me. |
I was grasping at straws and tested signing a single arch Mach-O binary instead of a fat/universal binary and that works. So the bug has something to do with fat/universal Mach-O files. Good times. |
I think the problem has to do with the Mach file headers / __LINKEDIT segment / segment load commands not agreeing on the total file size. I think this is confusing Apple's (and likely other) Mach-O parsers. I'll look into this more tomorrow and hopefully get a fix in. |
Thanks for the quick turnaround on this - 0.24.0 has got me past that problem. I'll open another issue for the next problem! |
I'm working on a macOS app made with Unity. When making a build Unity generates a macOS app that's been adhoc signed and I want to sign that with a Apple-issued certificate, ultimately a "Developer ID Application" distribution certificate ready for notarization, but for now I'm just using an "Apple Development" certificate.
When signing the app with rcodesign it appears to work, but running
codesign --verify --verbose=2 whatever.app
on the app shows that the signature on the fileContents/Plugins/lib_burst_generated.bundle
within the app is invalid. This file gets generated by Unity using its Burst compiler.I've attached a minimal reproduction case with a cut-down app containing only an executable,
Info.plist
andlib_burst_generated.bundle
along with a shell script that does the signing, signature diffing and verification. To make this work for you the shell script will need theIDENTITY
variable setting to an identity that has a corresponding certificate & private key in your keychain and that also needs to have been exported to a.p12
file alongside the script with the basename of the file being the identity.I'm using the official 0.23.0 release on macOS.
Here's the reproduction case:
test.tar.gz
And here's the output I get on my machine when running the script:
The text was updated successfully, but these errors were encountered: