Hi everyone!
We use to have an intel Mac machine where we generate the Developer ID Installer & Application certs for signing and notarization process. This process works sweet.
Now, we move from an intel to a m1 Mac machine, where we want to do the same process as before. I had try two different approaches, but ending up with the same result.
- I export the cert with the private key from my intel to the m1 machine, but when I try to sign, I get: Invalid signature. (Not sure what this error means in this case as everything works on the intel machine. I am guessing the cipher for creating either the private key or the signature differs between the architecture)
- I try to generate new certs for this m1 machine, but I get the following error: You already have a current Developer ID installer certificate or a pending certificate request. I try with the same account, but also with a different account. In both cases got the same error.
I create a ticket for apple, where they said to expect a reply between one and two business days, but no luck yet.
I think my reply on your suggestion where miss under comment section.
Yeah, don’t do that )-: See Quinn’s Top Ten DevForums Tips for this and other tips.
Here is the link for libapr for arm architecture.
Thanks for that.
Just to recap, the issue is that you can replace the signature of the Intel dynamic library but not the Apple silicon one:
% codesign -s - -f libapr-1.0.intel.dylib
libapr-1.0.intel.dylib: replacing existing signature
% codesign -s - -f libapr-1.0.m1.dylib
libapr-1.0.m1.dylib: invalid or unsupported format for signature
Do you know what tools generated this library? Because its code signature seems to be very weirdly constructed. Consider this [1]:
% codesign -d -vvvv libapr-1.0.m1.dylib
libapr-1.0.m1.dylib: code object is not signed at all
% codesign -s - libapr-1.0.m1.dylib
libapr-1.0.m1.dylib: invalid or unsupported format for signature
It’s Schrödinger’s code signature, being both there and not there!
For a quick workaround, you can do this:
% codesign --remove-signature libapr-1.0.m1.dylib
% codesign -s - libapr-1.0.m1.dylib
However, my proper answer is that you need to look back through the supply chain to figure out where this library came from. Because whatever tools that generated it are doing something weird.
And if those tools are Apple tools, I’d love to hear about it.
Just before finishing this reply I thought I’d have a look inside the dynamic library to see if it offers any clues as to its provenance [1]. I tripped at the first hurdle:
% dyld_info -exports libapr-1.0.m1.dylib
dyld_info: 'libapr-1.0.m1.dylib' rebase opcodes terminated early at offset 1 of 40
Yikes! So this library has a broken code signature and a broken Mach-O structure. That’s quite bad.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] To be clear, this is the original library as I downloaded it, not the version that I re-signed earlier in this post.