otool will display sections, but it wonât modify the binary. strip -no_uuid strips the UUID section, and strip -c creates a stub library by stripping the code signature and all section (code) contents. But it can't strip LC_CODE_SIGNATURE sections without stripping all the code as well. There's no documented Apple tool to strip code signatures. But the codesign tool itself has an undocumented option to remove signatures:
case optRemoveSignature: signerName = NULL; operation = doSign; // well, un-sign $ codesign --remove-signature /.../TestSignature.app/Contents/MacOS/TestSignature /.../TestSignature.app/Contents/MacOS/TestSignature: unsupported type or version of signature $ codesign --remove-signature /.../TestSignature.app /.../TestSignature.app: unsupported type or version of signature $ codesign --remove-signature /.../TestSignature.app/Contents/_CodeSignature/CodeResources (Prints nothing, leaves CodeResources unchanged.) TestSignature is the OS X Objective C app template signed by "-" (local, default identity). I wonder if it only strips v1 signatures, and hasn't been updated for v2 signatures? (I'm on 10.10.5 with Xcode 7.1, perhaps other versions of codesign will work.) I've been working off this Apple code signing documentation: Mozilla has solved a related problem by adding striptease (an enhanced strip command) to their build process: striptease will strip code signatures, but it's an external tool, so that's not an ideal dependency. Tim Tim Wilson-Brown (teor) teor2345 at gmail dot com PGP 968F094B teor at blah dot im OTR CAD08081 9755866D 89E2A06F E3558B7F B5A9D14F |
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ tor-dev mailing list tor-dev@xxxxxxxxxxxxxxxxxxxx https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev