3 Replies
      Latest reply on Jun 12, 2019 7:25 PM by dylanbc
      rkandathi Level 1 Level 1 (0 points)

        Our app has an encryption key that is saved in the keychain, which goes missing after the device is upgraded to iOS 11 resulting in user login issues.

         

        Some of the attributes that are used while writing to the keychain are as follows:

         

        NSMutableDictionary * = [[NSMutableDictionary alloc] init];
            [symmetricKeyAttr setObject:(__bridge id)kSecClassKey forKey:(__bridge id)kSecClass];
            [symmetricKeyAttr setObject:self.applicationTag forKey:(__bridge id)kSecAttrApplicationTag];
            [symmetricKeyAttr setObject:[NSNumber numberWithUnsignedInt:CSSM_ALGID_AES] forKey:(__bridge id)kSecAttrKeyType];
            [symmetricKeyAttr setObject:[NSNumber numberWithUnsignedInt:(unsigned int)(kCCKeySizeAES256 << 3)] forKey:(__bridge id)kSecAttrKeySizeInBits];
            [symmetricKeyAttr setObject:[NSNumber numberWithUnsignedInt:(unsigned int)(kCCKeySizeAES256 << 3)]    forKey:(__bridge id)kSecAttrEffectiveKeySize];
            [symmetricKeyAttr setObject:(id)kCFBooleanTrue forKey:(__bridge id)kSecAttrCanEncrypt];
            [symmetricKeyAttr setObject:(id)kCFBooleanTrue forKey:(__bridge id)kSecAttrCanDecrypt];
            [symmetricKeyAttr setObject:(id)kCFBooleanFalse forKey:(__bridge id)kSecAttrCanDerive];
            [symmetricKeyAttr setObject:(id)kCFBooleanFalse forKey:(__bridge id)kSecAttrCanSign];
            [symmetricKeyAttr setObject:(id)kCFBooleanFalse forKey:(__bridge id)kSecAttrCanVerify];
            [symmetricKeyAttr setObject:(id)kCFBooleanFalse forKey:(__bridge id)kSecAttrCanWrap];
            [symmetricKeyAttr setObject:(id)kCFBooleanFalse forKey:(__bridge id)kSecAttrCanUnwrap];
          
            [symmetricKeyAttr setObject:(__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly forKey:(__bridge id)kSecAttrAccessible];
        


        These attributes haven't been changed in a few years and we never had problems during any prior upgrades. I am curious if there is something that changed in iOS 11 which effected us.

        Appreciate any help.

         

        Thanks!