I'm trying to help out one of our vendors by building a skeleton PCI dext which they can flesh out.
However, I can't seem to get the signing right.
I can't sign it at all using no team or my personal team. "Signing for <app> requires a development team", and "Personal development teams ... do not support the System Extension capability".
I can't sign the driver because "DriverKit Team Provisioning Profile: <driver bundle id> doesn't match the entitlements file's value for the com.apple.developer.driverkit.transport.pci entitlement.
I think this problem occurs because our company has already been assigned a transport.pci
entitlement, but for our own PCI vendor ID. But I want to build and test software that works with our vendor's PCI device.
I tried generating a profile for the driver manually, it contained only our own company's PCI driver match:
IOPCIPrimaryMatch = "0x0000MMMM&0x0000FFFF";
where MMMM is our own PCI vendor ID.
Is there a better way to inspect the profile Xcode is using than the postage-stamped sized info popup which truncates the information? I would download the generated profile but it doesn't appear on the profile, but Xcode is accessing it from somewhere.
When I look at the available capabilities I can add to an app identifier on the Developer portal, I see com.apple.developer.driverkit.transport.usb, which is "development only". There's no "development only" capability for PCI. Does this mean it isn't possible to develop even a proof-of-concept PCI driver without being first granted the DriverKit PCI (Primary Match) entitlement?
When adding capabilities to a driver, the list of available capabilities shown in Xcode has one "DriverKit PCI (Primary Match) entry", but if I double click it, two such entries appear in the Signing and Capabilities tab for my driver target. On the Developer portal, when I look at my driver's Identifier, there are two Capabilities labelled DriverKit PCI (Primary Match). Why?
When I look at the available capabilities I can add to an app identifier on the Developer portal, I see com.apple.developer.driverkit.transport.usb, which is "development only". There's no "development only" capability for PCI.
Yes, and please file a bug about this and post the bug number back here. I don't know WHY there isn't a development only entitlement (I wasn't involved with DriverKit at the time), but it's a decision I'd like to revisit.
And yes...
Does this mean it isn't possible to develop even a proof-of-concept PCI driver without being first granted the DriverKit PCI (Primary Match) entitlement?
...that's exactly what it means. You could do this by disabling SIP (and possibly AMFI), but you can't use the more "elegant" flow the development entitlements allow.
In addition:
When adding capabilities to a driver, the list of available capabilities shown in Xcode has one "DriverKit PCI (Primary Match) entry", but if I double-click it, two such entries appear in the Signing and Capabilities tab for my driver target. On the Developer portal, when I look at my driver's Identifier, there are two Capabilities labelled DriverKit PCI (Primary Match). Why?
Because, unfortunately, DriverKit has always been the most complex codesign configuration on our platform, and Xcode 15 and 16 entirely support it properly. The issue in Xcode 16 (it was worse in Xcode 15) is that it doesn't understand that the same entitlement key can be granted twice. If you look VERY closely at the data you're shown, you can see that the two entries are actually:
(note the extra " " in the names):
DriverKit PCI (PrimaryMatch) -> 0x00001CFA&0x0000FFFF
DriverKit PCI(PrimaryMatch) -> 0x0000bdbd&0x0000FFFF
The problem here is that Xcode's automatic signing will ALWAYS pick one of those, never the other. To use the other one, you have to switch to manual code signing as described here.
Is there a better way to inspect the profile Xcode is using than the postage-stamped-sized info popup which truncates the information?
Sure. To start with, you can (currently) find the files themselves in:
~/Library/Developer/Xcode/UserData/Provisioning Profiles
One recommendation I'd have here is to not treat the contents of that folder as "precious" or special. What automatic code signing actually does is generate provisioning profiles "on demand", so if you delete an automatic profile... Xcode will just generate it again at the next build. Manually generating profiles is more cumbersome, but the solution there is to preserve them as a separate resource, probably as part of your project data, NOT to just "lose" them in the folder here. If they get deleted from Xcode's store, then you can just copy them back in from your own store (or using Xcode, which can manually download profiles as well).
The advantage of this approach is that when profiles "pile up" over time (which they tend to do), you can just delete* all of them then let Xcode regenerate the ones you're actually trying to investigate.
*Moving them somewhere else works too, but could indicate a fear of commitment.
In terms of looking at their contents, TN3125: Inside Code Signing: Provisioning Profiles has the details of how to see exactly what's there.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware