From 3981e3254f2c9b8839c0429de4e68a96fb7658c3 Mon Sep 17 00:00:00 2001 From: Jared Verdi Date: Wed, 30 Oct 2013 13:57:14 -0400 Subject: [PATCH] Set kSecAttrAccessible to default to kSecAttrAccessibleAfterFirstUnlock See: https://blog.loom.com/how-we-fixed-the-ios7-forced-logout-bug-thats-been-plaguing-so-many-apps/ And: http://software-security.sans.org/blog/2011/01/05/using-keychain-to-store-passwords-ios-iphone-ipad/ --- Lib/UICKeyChainStore.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/UICKeyChainStore.m b/Lib/UICKeyChainStore.m index b9dc6ac..40e6ca7 100644 --- a/Lib/UICKeyChainStore.m +++ b/Lib/UICKeyChainStore.m @@ -209,6 +209,7 @@ + (BOOL)setData:(NSData *)data forKey:(NSString *)key service:(NSString *)servic [attributes setObject:service forKey:(__bridge id)kSecAttrService]; [attributes setObject:key forKey:(__bridge id)kSecAttrGeneric]; [attributes setObject:key forKey:(__bridge id)kSecAttrAccount]; + [attributes setObject:(__bridge id)kSecAttrAccessibleAfterFirstUnlock forKey:(__bridge id)kSecAttrAccessible]; [attributes setObject:data forKey:(__bridge id)kSecValueData]; #if !TARGET_IPHONE_SIMULATOR && defined(__IPHONE_OS_VERSION_MIN_REQUIRED) if (accessGroup) {