From 8560d7586310145568b4b4f1dfa71c84e3b005a8 Mon Sep 17 00:00:00 2001 From: Jan S Date: Tue, 30 Mar 2021 06:04:46 +0200 Subject: [PATCH] (fix) keychain dumper misses entries with kSecAttrSynchronizable=true (#448) * (fix) keychain dumper misses entries that were created with kSecAttrSynchronizable=true * (fix) keychain empty() method misses entries that were created with kSecAttrSynchronizable=true --- agent/src/ios/keychain.ts | 2 ++ agent/src/ios/lib/constants.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/agent/src/ios/keychain.ts b/agent/src/ios/keychain.ts index 71625eea..e672e68b 100644 --- a/agent/src/ios/keychain.ts +++ b/agent/src/ios/keychain.ts @@ -67,6 +67,7 @@ export namespace ioskeychain { searchDictionary.setObject_forKey_(kCFBooleanTrue, kSec.kSecReturnData); searchDictionary.setObject_forKey_(kCFBooleanTrue, kSec.kSecReturnRef); searchDictionary.setObject_forKey_(kSec.kSecMatchLimitAll, kSec.kSecMatchLimit); + searchDictionary.setObject_forKey_(kSec.kSecAttrSynchronizableAny, kSec.kSecAttrSynchronizable); // loop each of the keychain class types and extract data const itemClassResults: IKeychainData[][] = itemClasses.map((clazz) => { @@ -150,6 +151,7 @@ export namespace ioskeychain { // clean out the keychain export const empty = (): void => { const searchDictionary: NSMutableDictionaryType = ObjC.classes.NSMutableDictionary.alloc().init(); + searchDictionary.setObject_forKey_(kSec.kSecAttrSynchronizableAny, kSec.kSecAttrSynchronizable); itemClasses.forEach((clazz) => { // set the class-type we are querying for now & delete diff --git a/agent/src/ios/lib/constants.ts b/agent/src/ios/lib/constants.ts index 3824447f..7390a885 100644 --- a/agent/src/ios/lib/constants.ts +++ b/agent/src/ios/lib/constants.ts @@ -28,6 +28,7 @@ export enum kSec { kSecAttrAccessControl = "accc", kSecAttrGeneric = "gena", kSecAttrSynchronizable = "sync", + kSecAttrSynchronizableAny = "syna", kSecAttrModificationDate = "mdat", kSecAttrServer = "srvr", kSecAttrDescription = "desc",