I think you need to add double quotes around the entire requirement’s string (e.g. right before the ‘=' and right after the last
‘)’ )
> On May 10, 2018, at 7:45 PM, B.J. Buchalter <b...@mhlabs.com> wrote:
>
>
>> Here's what xcodebuild does:
>>
>> /usr/bin/codesign --force --sign
>> 84208E9C30B70E303186BAF330554E82E1891492 --requirements =designated\
>> =>\ anchor\ apple\ generic\ \ and\ identifier\ \"$self.identifier\"\
>> and\ ((cert\ leaf[field.1.2.840.113635.100.6.1.9]\ exists)\ or\ (\
>> certificate\ 1[field.1.2.840.113635.100.6.2.6]\ exists\ and\
>> certificate\ leaf[field.1.2.840.113635.100.6.1.13]\ exists\ \ and\
>> certificate\ leaf[subject.OU]\ =\ \"444JK52Q93\"\ )) --timestamp=none
>> /Users/build/BuildBox/FL2000/trunk/IOProxyVideoFamily/Release/IOProxyFramebuffer.kext
>>
>> I attempted to copy the above command line then paste it into the
>> Terminal but so many parentheses lead the command to fail:
>>
>> Command-C
>> Command-V
>> -bash: syntax error near unexpected token `('
>>
>> Perhaps all I need is to add some quotes or backslashes to codesign's
>> command line.
>
> I think you need to add double quotes around the entire requirement’s string (e.g. right before the ‘=' and right after the last
> ‘)’ )
or use control-Command-V to escape the paste in terminal friendly manner.
There's no need to specify the designated requirement. The default DR generated by codesign will be fine.
$ codesign -f -s "Developer ID Application:" mykext.kext
should be all you need.
—gc
Hi Garth,
Thanks! That’s good to know; it is hard to determine what is required and many of us default to copying what Xcode does, just to be safe…
BR,
B.J. Buchalter
Metric Halo
http://www.mhlabs.com
Is this true for all versions of OS/codesign that can actually generate a valid kext signature (e.g. v2 resource envelope)? You know, in case certain unnamed developers out there might be running their build servers on older versions of OS X (gasp!)… :)
Thanks,
Jim
It should work everywhere.
The two things that make signing more complicated is if there's no valid bundle ID or bundles with nested code. Kexts rarely have those issues.
Note that Xcode will do this signing for you if you turn off Automatic Signing and select your Developer ID Application identity under Signing (Release).
For development builds we recommend not signing them but instead disable SIP on your test systems so the unsigned kext will load. That way, if a development build makes it into the wild somehow, it won't load for most users and it won't get confused with your actual production kext.
—gc