Thank you!
The APIs listed below are utilized to identify FIDO HID devices exclusively, with their corresponding callback registration functions shown here.
// Match only FIDO HID devices
let matchingDict: [String: Any] = [
kIOHIDDeviceUsagePageKey as String: 0xF1D0
]
IOHIDManagerSetDeviceMatching(mgr, matchingDict as CFDictionary)
// Register callbacks
IOHIDManagerRegisterDeviceMatchingCallback(mgr, deviceAddedCallback, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
IOHIDManagerRegisterDeviceRemovalCallback(mgr, deviceRemovedCallback, UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()))
// Schedule with current run loop
IOHIDManagerScheduleWithRunLoop(mgr, CFRunLoopGetCurrent(), CFRunLoopMode.defaultMode.rawValue)
let result = IOHIDManagerOpen(mgr, IOOptionBits(kIOHIDOptionsTypeNone))
Randomly it crashes at runloop
Terminating Process: SecurityAgentHelper-arm64 [2303]
Application Specific Information:
abort() called
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x1883c9c34 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1883dc3a0 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x1883d2764 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1883c9fa8 mach_msg + 24
4 CoreFoundation 0x1884f6cbc __CFRunLoopServiceMachPort + 160
5 CoreFoundation 0x1884f55d8 __CFRunLoopRun + 1208
6 CoreFoundation 0x1884f4a98 CFRunLoopRunSpecific + 572
7 HIToolbox 0x193f9727c RunCurrentEventLoopInMode + 324
8 HIToolbox 0x193f9a4e8 ReceiveNextEventCommon + 676
9 HIToolbox 0x194125484 _BlockUntilNextEventMatchingListInModeWithFilter + 76
I’m able to perform FIDO authentication with the key inserted via USB randomly crashes most of the time crash log shows runloop;
however, NFC-based authentication does not work (NFC-over-HID devices (OMNIKEY):
communication with ctkpcscd failed
Could you please share any inputs