Post

Replies

Boosts

Views

Activity

Unable to get certificates via TKTokenWatcher
Hello, We have an application which gets our HSM certificates via TKTokenWatcher, there is a snippet: let tokens = TKTokenWatcher() for token in tokens.tokenIDs { // Use our HSM certs if token.contains("SPECIFIC_IDENTIFIER") { let tokenQuery = [kSecClass as String: kSecClassIdentity, kSecAttrTokenID as String: token, kSecAttrKeyType as String: kSecAttrKeyTypeRSA, kSecReturnRef as String: true] as CFDictionary var item: CFTypeRef? let result = SecItemCopyMatching(tokenQuery as CFDictionary, &item) if result == noErr.... Normally, result is all right, but problem occurred when we added "App Groups" entitlement. This application has to share some Defaults with other app, so they need to be in the same App Group. So, when we added this App Group entitlement, result from the code snippet is -34018, which according to OSStatus means errSecMissingEntitlement. Does anybody know, which entitlement has to be added, so app can be in the App Group, and at the same time it is able to get certificates? Thank you.
0
1
516
Aug ’24
CryptoTokenKit Network Cryptographic Tokens
Hello, It is mentioned in CryptoTokenKit documentation: You use the CryptoTokenKit framework to easily access cryptographic tokens. Tokens are physical devices built in to the system, located on attached hardware (like a smart card), or accessible through a network connection. However, it looks like there is lack of documentation with simple example, how to access network token. I have a certificates in HSM (hardware secure module), which is accessible on network, and I'd like to access certificates on HSM on my Mac. Does anybody know, where to start with implementation? Thank you.
1
0
1.1k
Jan ’23
App crashes on Big Sur but works on Monterey
Hello, I have an app, which runs fine on Monterey, but crashes on Big Sur. However, I am able to run it on Big Sur from XCode only. System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000004079c498ca0 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [3858] VM Regions Near 0x4079c498ca0: mapped file 11e4ff000-11e607000 [ 1056K] r--/rw- SM=COW Object_id=6ea347b --> MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=PRV Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x00007fff2040f4af objc_release + 31 1 com.apple.UIFoundation 0x00007fff23c1aba8 -[UINibDecoder dealloc] + 119 2 com.apple.AppKit 0x00007fff22fef7ec -[NSNib dealloc] + 28 3 libobjc.A.dylib 0x00007fff2042d20f AutoreleasePoolPage::releaseUntil(objc_object**) + 167 4 libobjc.A.dylib 0x00007fff2040fe30 objc_autoreleasePoolPop + 161 5 com.apple.CoreFoundation 0x00007fff206284b6 _CFAutoreleasePoolPop + 22 6 com.apple.Foundation 0x00007fff213ca0bb -[NSAutoreleasePool drain] + 131 7 com.apple.Foundation 0x00007fff213cb198 _NSAppleEventManagerGenericHandler + 98 8 com.apple.AE 0x00007fff264487f3 0x7fff2643c000 + 51187 9 com.apple.AE 0x00007fff26447f0e 0x7fff2643c000 + 48910 10 com.apple.AE 0x00007fff26440c23 aeProcessAppleEvent + 448 11 com.apple.HIToolbox 0x00007fff288bf8a2 AEProcessAppleEvent + 54 12 com.apple.AppKit 0x00007fff22e6e210 _DPSNextEvent + 2046 13 com.apple.AppKit 0x00007fff22e6c545 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364 14 com.apple.AppKit 0x00007fff22e5e869 -[NSApplication run] + 586 15 com.apple.AppKit 0x00007fff22e32a6c NSApplicationMain + 816 16 com.MyCompany.MyApp. 0x000000010d699799 main + 9 (AppDelegate.swift:15) 17 libdyld.dylib 0x00007fff2058af3d start + 1 There are some pictures(please open them in new tab) from Zombie instrument: Regarding Zombie, it looks like some error happens in this code in @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate, Loggable  is the method fileprivate func handleFSE(event: NSAppleEventDescriptor?, replyEvent: NSAppleEventDescriptor?) {     Defaults[.deepLinkData] = event?.paramDescriptor(forKeyword: keyDirectObject)?.stringValue     Defaults[.isFromCUSLaunch] = true     if let window = WindowControllerFrom(storyboard: .cus, withIdentifier: .cusWindow) {       logIfCan(string: "Deeplink data: \(event?.paramDescriptor(forKeyword: keyDirectObject)?.stringValue ?? .empty)")       let cusVC = CUSViewController(event?.paramDescriptor(forKeyword: keyDirectObject)?.stringValue ?? .empty)       window.contentViewController = cusVC       if let screen = NSScreen.main {         window.window?.setFrame(screen.visibleFrame, display: true, animate: true)       }       window.window?.makeKeyAndOrderFront(nil)     }   } WindowControllerFrom returns NSWindowController? and CUSViewController is a class which inherits from AbstractViewController. I would appreciate any idea what can be wrong here, and why there is no problem on Monterey (both M1 and Intel), but crashes on Big Sur?
0
0
997
May ’22