I am trying to code-sign a desktop application binary for OSX Sierra with bought COMODO certificate. I have a code-signing verification error
CSSMERR_TP_NOT_TRUSTED at the end of the command run.This happens when I try to use codesign utility directly on final bundle (I am giving the same certificate ID as the XCode does):
+ security unlock-keychain -p "$PASSWORD" /Users/user/Library/Keychains/login.keychain
+ export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
+ CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
+ /usr/bin/codesign --force --sign 118E862D88E30998B6C4BACB8ABCB1FBDEADBEEF --deep --timestamp=none '<build-path>/app_name'
+ /usr/bin/codesign --verify '<build-path>/app_name' -dv Executable=<build-path>/app_name/Contents/MacOS/app_name
Identifier=$(PRODUCT_BUNDLE_IDENTIFIER)
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20100 size=19725 flags=0x0(none) hashes=611+3 location=embedded
Signature size=2359
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources version=2 rules=13 files=2
Internal requirements count=1 size=104
+ /usr/bin/codesign --verify '<build-path>/app_name' <build-path>/app_name: CSSMERR_TP_NOT_TRUSTED In architecture: x86_64
+ spctl -a -v <build-path>/app_name <build-path>/app_name/: CSSMERR_TP_NOT_TRUSTEDBinary compiled and signed by XCode is accepted though by gatekeeper (I generate XCode project with CMake and then modify project properties to sign the binary - this however is not making a full bundle for me and more importantly it is not CLI-only solution). I have used the same
codesign command (copied from XCode's log) for signing.I have already:
- removed and imported the certificate,
- allowed it to be used on all applications,
- checked are the permissions system default,
- checked for doubled certificates in the system.
I use qmake (Qt5.8) to create makefiles. My bundle contents (after
make, before macdeploy):./Contents ./Contents/_CodeSignature ./Contents/_CodeSignature/CodeResources ./Contents/Info.plist ./Contents/MacOS ./Contents/MacOS/app_name ./Contents/PkgInfo ./Contents/Resources ./Contents/Resources/CS_icon.icns ./Contents/Resources/empty.lprojWhat should I do to make correct signed binary under OSX Sierra?
Edit:
Maybe it has something to do with this:
`Info.plist=not bound`? How can I bound this file? It is already in bundle's directory. While inspecting XCode's signed binary it's `info` file is 'bounded'.