Hi,
I have a macOS Intel machine running Ventura 13.7.4. This machine is used as a build node for Jenkins to run a test for a USB device that has an HID interface. The test runner for this is Java's junit on Azul's Zulu JDK 8 for mac. I've added the com.apple.security.device entitlement to this JDK 8 bundle and signed using a self-signed certificate. This certificate is available in the system keychain at:
keychain: "/Library/Keychains/System.keychain"
version: 256
class: 0x80001000
On my personal account on this machine, I can run the test and it calls IOHIDDevicePlugin's open function and returns success:
[junit] [debug] [hid.cpp:1457] HIDAccess::Open Success in open for cDeviceHandle: 0x6000006abb38
If I run the same test logged in as the Jenkins agent account, then open returns:
[junit] [debug] [hid.cpp:1484] Could not open HID with handle: 0x600002a5c018, error (-1ffffd3f): (iokit/common) privilege violation
I can see the certificate that signed the JDK bundle running the command:
security find-certificate -c "java-rt-usb" -a -m
The results are the same for both accounts. Is my setup expected to work? I.e. create a self-signed cert in one account with admin privileges, put the cert in the system keychain, sign an app bundle with a new usb entitlement using this cert, and then run that app in another account on the same machine. If it's expected to work, are there any more troubleshooting tools I can use?
ioreg shows the same output for these devices under test in both accounts:
$ ioreg -p IOUSB -w0
+-o CMSIS-DAP@14620000 <class AppleUSBDevice, id 0x1000026ae, registered, matched, active, busy 0 (1 ms), retain 17>
+-o CMSIS-DAP@14630000 <class AppleUSBDevice, id 0x1000026d6, registered, matched, active, busy 0 (1 ms), retain 17>
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles