File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ struct AppKeychain {
1616 [
1717 kSecClass: kSecClassGenericPassword,
1818 kSecAttrService: service,
19- kSecUseDataProtectionKeychain: true ,
19+ /// change to true for Data Protection keychain mode
20+ kSecUseDataProtectionKeychain: false ,
2021 ]
2122 }
2223
@@ -34,6 +35,9 @@ struct AppKeychain {
3435 throw KeychainError . unexpectedStatus ( addStatus)
3536 }
3637 } else if updateStatus != errSecSuccess {
38+ /// with kSecUseDataProtectionKeychain set to true, this will throw with error -34018, which according to
39+ /// https://github.com/apple-oss-distributions/Security/blob/09becc8fb155462f0853f99cd09c26b10a38e2f4/sec/Security/SecBasePriv.h#L113
40+ /// is the error "Internal error when a required entitlement isn't present"
3741 throw KeychainError . unexpectedStatus ( updateStatus)
3842 }
3943 }
You can’t perform that action at this time.
0 commit comments