Prioritize user privacy and data security in your app. Discuss best practices for data handling, user consent, and security measures to protect user information.

All subtopics
Posts under Privacy & Security topic

Post

Replies

Boosts

Views

Activity

Creating new keychain for mac os app
I need to create a new keychain for my mac os app. Currently there is a function SecKeychainCreate in Appledocumentation. But this function will be deprecated in mac OS 12.0. Is there another way to create keychain using swift (without using terminal commands)? Or will mac provide new function for this in update? Anybody knows?
7
0
3.7k
Jan ’23
SecItemAdd returns errSecAuthFailed
Hello, I'm experiencing a weird issue on the iOS 15 simulator (unfortunately I don't have a device with 15 installed yet). The issue I see is that the call to SecItemAdd returns OSStatus -25293 (errSecAuthFailed). The attributes dictionary passed looks like this: var query: [String : Any] = [ kSecClass as String: kSecClassGenericPassword, kSecAttrAccount as String: key, kSecAttrService as String: service, kSecAttrAccessControl as String: getSecAccessControl(), kSecUseAuthenticationContext as String: context, kSecValueData as String: data         ] the getSecAccessControl returns a SecAccessControl created like this:         access = SecAccessControlCreateWithFlags(nil,   kSecAttrAccessibleWhenUnlockedThisDeviceOnly,   .userPresence,   &error) if I do not add the kSecAttrAccessControl item I don't see any error. The same code works as expected on the simulator with iOS 14. Looking at the documentation didn't help, anybody has hints about this? Maybe it's bug I'm not aware of? Thank you in advance
19
2
11k
Jun ’22
Swift AES CBC 256 Encryption With Static 32bit Key and 32bit IV
We have the below Implementation in Android and the same has to be integrated into Swift. Key :- "d95acd54b4a821ff32c52825q931c194" IV :- "687b9509c25a34b8ad076346s8353d67" Here Both the Key and IV are 32 bits and below is the android code. public class AESEncryption { private static final String key = "d95acd54c6a821ff32c52825b931c194"; private static final String initVector = "687b9509c25a14b8ad076346d8353d67"; static byte[] bte = hexToBytes(initVector); public static String encrypt(String strToEncrypt) { try { CommonCode.showLog("log", bte.toString()); IvParameterSpec iv = new IvParameterSpec(bte); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES"); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); CommonCode.showLog("IV after logs", iv.toString()); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv); byte[] encrypted = cipher.doFinal(strToEncrypt.getBytes()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { return Base64.getEncoder().encodeToString(encrypted).trim(); } else { return android.util.Base64.encodeToString(encrypted, android.util.Base64.DEFAULT).trim(); } } catch (Exception e) { CommonCode.showLog("Error while encrypting: ", e.toString()); } return null; } public static String decrypt(String strToDecrypt) { try { IvParameterSpec iv = new IvParameterSpec(bte); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES"); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt))); } else { return new String(cipher.doFinal(android.util.Base64.decode(strToDecrypt, android.util.Base64.DEFAULT))); } } catch (Exception e) { CommonCode.showLog("Error while decrypting: " , e.toString()); } return null; } } How can we mimic the above in Swift? Here in Android they are using static byte[] bte = hexToBytes(initVector); to convert the 32bit IV into 16 bit Bytes Array I Have Tried the same approach on Swift below are the code snippet [Contents.swift](https://developer.apple.com/forums/content/attachment/60fab4f2-1496-4003-9f37-c195de95e94a)
9
0
11k
Dec ’24
SFAuthorizationpluginview dismiss in 20 second.
I have created a custom username/password lock screen using SFAuthorizationPluginView. When lock the screen the view appears. The cursor start blinking in TextField. However, it always automatically dismiss in 20 second if ideal. I could see the Mechanism dealloc gets called and dismiss the view. Based on my investigation, I think the system kill the view in 20second, and there is no ways to increase that and keep the custom screen for more time. Any help will be appreciate.
3
0
2.0k
Sep ’23
some change on keychain in ios 15 beta
We found that the error code of the keychain was different in ios 14 and ios 15. When the bio-information registered by the user is changed, if secItemCopyMatching is called, erSecItemNotFound is received in ios 14, but erSecAuthFailed is received in ios 15. In this case, iOS 15 cannot distinguish whether authentication has failed or bio-information has changed. I want to know if this is a bug in os or if it will proceed like this in the future. If we continue to give this error code in the future, I hope there will be a guide on how to distinguish the two error codes from the developer's point of view.
3
0
672
Dec ’21
iOS 15 with FaceID authentication error when resetting FaceID
We use biometricID (faceID/touchID) authentication to access to a secret stored in keychain. We create the access control object with the biometryCurrentSet option as shown to make sure if FaceID / TouchID changes the entry should be invalidated. let secAccessControlObj = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, .biometryCurrentSet, accessControlError) Below is the set and get query, Set Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Get Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Steps: Set the value in keychain using the set query above Reset the faceID Use the get query to get the value from keychain by authenticating against TouchID/ FaceID. Result: When we try to get the value from keychain using SecItemCopyMatching(query as CFDictionary, result) we get the error code errSecAuthFailed (-25293) on iOS 15. Analysis: Prior to this (iOS 14 and below) the error code would be errSecItemNotFound which makes more sense. This is an issue for iOS 15 only as we also get errSecAuthFailed when user backgrounds the app while authenticating with FaceID/TouchID. This creates a ambiguity for us. In our testing when we backgrounded the app while authentication is in progress, we found the actual call to SecItemCopyMatching(::) was made when app's state was actually active but when the call returned the state had become background and the error code was again errSecAuthFailed This seems to be a bug with iOS 15 as it creates a ambiguity for the caller. I think the error code returned after resetting faceID should still be errSecItemNotFound in which case we can know the secret is actually lost since FaceID is reset and can treat errSecAuthFailed as error where the secret is actually not lost but just that failed temporarily. Please let us know if we need to file a bug
2
0
3.2k
Feb ’22
iOS 15 keychain data retrieve issue
After upgrading to iOS 15, when I open the app after a couple of hours, we are not able to retrieve keychain data in didFinishLaunchingWithOptions delegate method. For each new launch we are facing the same issue of of not retrieving keychain data. We need to relogin to process further in the application. But for iOS 14 and below we are not facing this issue, we are able to retrieve the keychain data in didFinishLaunchingWithOptions delegate. Is anyone facing the same issue in their application?
3
1
4.8k
Jan ’22
App Store Review Guidelines 5.1.1 (ix) - Account delete requirement for banking apps
I would like to clarify the scope of section 5.1.1 (ix) of the app privacy policy, related to account sign-in.              "If your app supports account creation, you must also offer account deletion within the app." I understand that this will take effect from January 2022 https://developer.apple.com/news/?id=mdkbobfo Is there an exception for financial apps that include account creation / registration (e.g. banking apps)? The objective of the policy change seems to be to offer users a convenient and transparent option of unregistering from a service and deleting any related data. However, deleting a login for a banking app has more implications than just de-registering from the service (e.g. what to do with account balance, regulatory requirements may apply). Therefore direct interaction between the app user and the financial institution is likely to occur irrespective of any in-app options. Would either of these options be sufficient to comply with the iOS App Privacy Policy? Option 1 - include within the app a link to, or summary of, the bank's policy on how to close an account (e.g. contact bank directly over telephone, email, or in person). Option 2 - deactivation of login access via the mobile app (vs full closure of account).  If so, does the deactivation have to be performed within the app itself or could it be performed on a similar basis to account closure? (e.g. over telephone/email).
7
1
7.8k
Jun ’22
Integrate Passkey iCloud Keychain with other smartphone-based FIDO authenticator
Hi Developers, I am wondering how is it possible for other smartphone-based FIDO authenticators to use the same iCloud Keychain storage as Passkey does so those credentials can be used on non-apple devices too, and also on the smartphone at the same time. There are some other iOS authenticators that have implemented BLE and are working on all devices including Windows, but the problem is that those apps cannot support signing in to the website on the smartphone itself (neither in apps nor inside the browser) using the previously registered credential of 'cross-platform' type.
1
0
2.0k
Dec ’21
15.2 App Privacy Report developer message
Hello I've just installed the 15.2 beta developer beta and had a look at the new App Privacy Report feature. I can see the domains being contacted by my app coming through as expected. However, there is also a message there that I don't understand: "This app hasn't been updated by the developer to show which domains were contacted by websites or other content viewed in the app." Does anyone know what this is referring to? I'd like to update the app to support this, but I don't really understand this message or what action is expected. Thanks Updated to add: I have tested visiting a website in the in-app browser and it does appear in the Privacy Report in a separate section titled "Websites Visited In App". The above message is still present, however.
2
0
1.5k
Feb ’22
Authorization Plugin finding user entered FileVault password after Restart
I'm developing an authorization plugin to provide 2 Factor Authentication (2FA) for macOS. When FileVault is enabled, macOS Recovery prompts the user for a password to unlock FileVault FDE (Full Disk Encryption) before macOS can startup. The FDE password entered during Recovery is saved somehow so that after macOS starts up it can be used to log the user in without prompting them to re-enter their password. This feature is configurable with setting 'DisableFDEAutoLogin'. We would like our authorization plugin to implement the same behavior. The first place I thought to look for the FDE password (from within our authorization mechanism) is in Context value kAuthorizationEnvironmentPassword but it's not there. Is it possible for an authorization plugin to obtain this password the same as the standard login mechanism and if so how?
2
0
1.3k
Apr ’24
icloud imap access using QRESYNC and CONDSTORE
I'm the IMAP maintainer for Mozilla Thunderbird. I've been looking into adding QRESYNC imap extension to Thunderbird which currently only supports CONDSTORE extension. The icloud server returns these in its capabilities response: CONDSTORE ENABLE QRESYNC indicating complete support for enabling CONDSTORE and QRESYNC. But when I try to enable them, I get no "ENABLED" untagged response as required by imap ENABLE rfc: Tbird sends: 33 ENABLE CONDSTORE QRESYNC UTF8=ACCEPT icloud sends: 33 OK ENABLE completed The correct imap ENABLED response is like this: Tbird sends: 33 ENABLE CONDSTORE QRESYNC UTF8=ACCEPT icloud sends: * ENABLED CONDSTORE QRESYNC icloud sends: 33 OK ENABLE completed Since icloud doesn't support the UTF8=ACCEPT imap extension, it should just be excluded from the untagged ENABLED response. Several other imap servers I've tested (Dovecot, Cyrus and Zimbra) respond correctly when Thunderbird attempts the ENABLE but icloud responds in a non-standard manner. There are other problems too with the icloud response to imap SELECT with the QRESYNC parameter in that it produces an imap FETCH response for all messages in the folder with a sequence number of minus 1 (sequence numbers are supposed to be positive, 1 to number of messages in folder, never negative). Note: This seems to require a tag. Couldn't find one relevant to my question so just picked one with "icloud" in name.
2
0
999
Dec ’21
XCode not marked as is_platform_binary
Hi, in my ES application I am trying to ignore execution events of apple processes. I think the way to do this is to check for the is_platform_binary attribute of es_message_t but i found that when executing Xcode this attribute is false, is it because I downloaded it from the app store? Also would checking for the "com.apple" prefix of the signing id be a good way to identify apple signed processes?
5
1
1.5k
Nov ’21
SMJobBless fails when called from an XPC Service.
Hey there, I'm trying to employ the same pattern as demonstrated in the EvenBetterAuthorizationSample: an unsandboxed XPC service calls SMJobBless to install a privileged helper service on behalf a sandboxed main app (which isn't allowed to call SMJobBless). It then starts an XPC connection to the Mach service hosted by the privileged service, and hands over the connection back to the main app, along with the XPC service's connection to the security server (AuthorizationRef). When I try to do call SMJobBless from my XPC service, I get these messages: info authd Process /usr/libexec/smd (PID 28881) evaluates 1 rights with flags 00000003 (engine 629): ( "com.apple.ServiceManagement.blesshelper" ) error authd Fatal: interaction not allowed (session has no ui access) (engine 629) default authd Failed to authorize right 'com.apple.ServiceManagement.blesshelper' by client '/usr/libexec/smd' [28881] for authorization created by '/MyApp.app/Contents/XPCServices/IntermediatorXPCService.xpc' [29325] (3,0) (-60007) (engine 629) error authd copy_rights: authorization failed This seems reasonable to me, because I wouldn't expect an XPC service to be capable of running graphics. However, this works just fine in the "App-Sandboxed" app in the EvenBetterAuthorizationSample project. I poked around the available open source code, and found out that this message is logged when the processes' audit session doesn't have AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS set. if (!(session_get_attributes(auth_token_get_session(engine->auth)) & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS)) { os_log_error(AUTHD_LOG, "Fatal: interaction not allowed (session has no ui access) (engine %lld)", engine->engine_index); return errAuthorizationInteractionNotAllowed; } Out of curiosity, I compared the audit sessions of my XPC service to the one in EBAS using this code: auditinfo_addr_t auditInfo; int result = getaudit_addr(&auditInfo, sizeof(auditInfo)); assert(result == 0 ); if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_INITIAL) { NSLog(@"AU_SESSION_FLAG_IS_INITIAL"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS) { NSLog(@"AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_TTY) { NSLog(@"AU_SESSION_FLAG_HAS_TTY"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_REMOTE) { NSLog(@"AU_SESSION_FLAG_IS_REMOTE"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_CONSOLE_ACCESS) { NSLog(@"AU_SESSION_FLAG_HAS_CONSOLE_ACCESS"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_AUTHENTICATED) { NSLog(@"AU_SESSION_FLAG_HAS_AUTHENTICATED"); } Sure enough, I got different results. EBAS: 2021-11-20 18:45:52.792512-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] result: 0 2021-11-20 18:45:52.792527-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS 2021-11-20 18:45:52.792539-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] AU_SESSION_FLAG_HAS_TTY 2021-11-20 18:45:52.792549-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] AU_SESSION_FLAG_HAS_CONSOLE_ACCESS (lldb) p auditInfo (auditinfo_addr_t) $0 = { ai_auid = 501 ai_mask = (am_success = 4294967295, am_failure = 4294967295) ai_termid = { at_port = 50331650 at_type = 4 at_addr = ([0] = 0, [1] = 0, [2] = 0, [3] = 0) } ai_asid = 100019 ai_flags = 8240 } My XPC service: 2021-11-20 21:33:44.355007-0500 IntermediatorXPCService[29325:698278] result: 0 (lldb) p auditInfo ▿ __C.auditinfo_addr - ai_auid: 4294967295 ▿ ai_mask: __C.au_mask - am_success: 4294967295 - am_failure: 4294967295 ▿ ai_termid: __C.au_tid_addr - at_port: 0 - at_type: 4 ▿ at_addr: (4 elements) - .0: 0 - .1: 0 - .2: 0 - .3: 0 - ai_asid: 102293 - ai_flags: 0 It looks like ai_flags is all 0. Any ideas why that might be? What is making EBAS special? And also, how can AU_SESSION_FLAG_HAS_TTY and AU_SESSION_FLAG_HAS_CONSOLE_ACCESS be false? I'm reading these logs from the console?! (Another curious observation: audit_session_flags is imported into Swift as RawRepresentable, but not as an OptionSet)
4
0
2k
Nov ’21
IDFA Enquiry
Hi, I’ve recently had questions regarding GDPR and privacy on Apple products and spoke to numerous sources regarding it, but some of my queries remain unanswered. I was then directed to this forum so I’m hoping someone on here may be able to help please! In Apple’s development program information, In article 3.3.12 it states: “You and Your Applications (and any third party with whom You have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier.” Following seeing the aforementioned article I asked if this meant that iOS apps are only allowed to associate one IDFA with one user? I.e. if an app user got a new iPhone, would this mean that the application developers would have to remove the previous IDFA, and now associate the one from the new device with the user?  Hope that makes sense and that you may be able to help.  Thanks
1
0
1.1k
Nov ’21
MailKit API Documentation
Does any have anyone have documentation on the usage related to the forMessageContext and messageContext parameters and for the methods below? This is undocumented while public making it an unusable API. func extensionViewController(messageContext: Data) -> MEExtensionViewController? func primaryActionClicked(forMessageContext context: Data) async -> MEExtensionViewController? The APIs are located here but lack any kind of proper documentation and examples https://developer.apple.com/documentation/mailkit/memessagesecurityhandler/3882908-extensionviewcontroller
0
0
981
Nov ’21
Generating key pair in System Keychain
In our macOS Application I am trying to generate a keypair in the system keychain using SecKeyCreatePair for legacy reasons, but keep receive an error -61 (Write permission error). What is the best approach to making this work or is this simply not possible (anymore)? The End User running this Application is typically an Admin and we would normally use the SFAuthorization to grab sudo for this type of issue. This is not possible using Apple Security Framework functions as far as I can see, not even the latest function SecKeyCreateRandomKey.
9
0
1.6k
Dec ’21
Creating new keychain for mac os app
I need to create a new keychain for my mac os app. Currently there is a function SecKeychainCreate in Appledocumentation. But this function will be deprecated in mac OS 12.0. Is there another way to create keychain using swift (without using terminal commands)? Or will mac provide new function for this in update? Anybody knows?
Replies
7
Boosts
0
Views
3.7k
Activity
Jan ’23
SecItemAdd returns errSecAuthFailed
Hello, I'm experiencing a weird issue on the iOS 15 simulator (unfortunately I don't have a device with 15 installed yet). The issue I see is that the call to SecItemAdd returns OSStatus -25293 (errSecAuthFailed). The attributes dictionary passed looks like this: var query: [String : Any] = [ kSecClass as String: kSecClassGenericPassword, kSecAttrAccount as String: key, kSecAttrService as String: service, kSecAttrAccessControl as String: getSecAccessControl(), kSecUseAuthenticationContext as String: context, kSecValueData as String: data         ] the getSecAccessControl returns a SecAccessControl created like this:         access = SecAccessControlCreateWithFlags(nil,   kSecAttrAccessibleWhenUnlockedThisDeviceOnly,   .userPresence,   &error) if I do not add the kSecAttrAccessControl item I don't see any error. The same code works as expected on the simulator with iOS 14. Looking at the documentation didn't help, anybody has hints about this? Maybe it's bug I'm not aware of? Thank you in advance
Replies
19
Boosts
2
Views
11k
Activity
Jun ’22
Swift AES CBC 256 Encryption With Static 32bit Key and 32bit IV
We have the below Implementation in Android and the same has to be integrated into Swift. Key :- "d95acd54b4a821ff32c52825q931c194" IV :- "687b9509c25a34b8ad076346s8353d67" Here Both the Key and IV are 32 bits and below is the android code. public class AESEncryption { private static final String key = "d95acd54c6a821ff32c52825b931c194"; private static final String initVector = "687b9509c25a14b8ad076346d8353d67"; static byte[] bte = hexToBytes(initVector); public static String encrypt(String strToEncrypt) { try { CommonCode.showLog("log", bte.toString()); IvParameterSpec iv = new IvParameterSpec(bte); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES"); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); CommonCode.showLog("IV after logs", iv.toString()); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv); byte[] encrypted = cipher.doFinal(strToEncrypt.getBytes()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { return Base64.getEncoder().encodeToString(encrypted).trim(); } else { return android.util.Base64.encodeToString(encrypted, android.util.Base64.DEFAULT).trim(); } } catch (Exception e) { CommonCode.showLog("Error while encrypting: ", e.toString()); } return null; } public static String decrypt(String strToDecrypt) { try { IvParameterSpec iv = new IvParameterSpec(bte); SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES"); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING"); cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { return new String(cipher.doFinal(Base64.getDecoder().decode(strToDecrypt))); } else { return new String(cipher.doFinal(android.util.Base64.decode(strToDecrypt, android.util.Base64.DEFAULT))); } } catch (Exception e) { CommonCode.showLog("Error while decrypting: " , e.toString()); } return null; } } How can we mimic the above in Swift? Here in Android they are using static byte[] bte = hexToBytes(initVector); to convert the 32bit IV into 16 bit Bytes Array I Have Tried the same approach on Swift below are the code snippet [Contents.swift](https://developer.apple.com/forums/content/attachment/60fab4f2-1496-4003-9f37-c195de95e94a)
Replies
9
Boosts
0
Views
11k
Activity
Dec ’24
SFAuthorizationpluginview dismiss in 20 second.
I have created a custom username/password lock screen using SFAuthorizationPluginView. When lock the screen the view appears. The cursor start blinking in TextField. However, it always automatically dismiss in 20 second if ideal. I could see the Mechanism dealloc gets called and dismiss the view. Based on my investigation, I think the system kill the view in 20second, and there is no ways to increase that and keep the custom screen for more time. Any help will be appreciate.
Replies
3
Boosts
0
Views
2.0k
Activity
Sep ’23
some change on keychain in ios 15 beta
We found that the error code of the keychain was different in ios 14 and ios 15. When the bio-information registered by the user is changed, if secItemCopyMatching is called, erSecItemNotFound is received in ios 14, but erSecAuthFailed is received in ios 15. In this case, iOS 15 cannot distinguish whether authentication has failed or bio-information has changed. I want to know if this is a bug in os or if it will proceed like this in the future. If we continue to give this error code in the future, I hope there will be a guide on how to distinguish the two error codes from the developer's point of view.
Replies
3
Boosts
0
Views
672
Activity
Dec ’21
iOS 15 with FaceID authentication error when resetting FaceID
We use biometricID (faceID/touchID) authentication to access to a secret stored in keychain. We create the access control object with the biometryCurrentSet option as shown to make sure if FaceID / TouchID changes the entry should be invalidated. let secAccessControlObj = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, .biometryCurrentSet, accessControlError) Below is the set and get query, Set Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Get Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Steps: Set the value in keychain using the set query above Reset the faceID Use the get query to get the value from keychain by authenticating against TouchID/ FaceID. Result: When we try to get the value from keychain using SecItemCopyMatching(query as CFDictionary, result) we get the error code errSecAuthFailed (-25293) on iOS 15. Analysis: Prior to this (iOS 14 and below) the error code would be errSecItemNotFound which makes more sense. This is an issue for iOS 15 only as we also get errSecAuthFailed when user backgrounds the app while authenticating with FaceID/TouchID. This creates a ambiguity for us. In our testing when we backgrounded the app while authentication is in progress, we found the actual call to SecItemCopyMatching(::) was made when app's state was actually active but when the call returned the state had become background and the error code was again errSecAuthFailed This seems to be a bug with iOS 15 as it creates a ambiguity for the caller. I think the error code returned after resetting faceID should still be errSecItemNotFound in which case we can know the secret is actually lost since FaceID is reset and can treat errSecAuthFailed as error where the secret is actually not lost but just that failed temporarily. Please let us know if we need to file a bug
Replies
2
Boosts
0
Views
3.2k
Activity
Feb ’22
iOS 15 keychain data retrieve issue
After upgrading to iOS 15, when I open the app after a couple of hours, we are not able to retrieve keychain data in didFinishLaunchingWithOptions delegate method. For each new launch we are facing the same issue of of not retrieving keychain data. We need to relogin to process further in the application. But for iOS 14 and below we are not facing this issue, we are able to retrieve the keychain data in didFinishLaunchingWithOptions delegate. Is anyone facing the same issue in their application?
Replies
3
Boosts
1
Views
4.8k
Activity
Jan ’22
Is there an Endpoint Security Event to be notified of Folder Copy?
I am currently monitoring ES_EVENT_TYPE_AUTH_CLONE events in my Endpoint Security client, but it seems to only respond to file, not folder, copies from finder. Is there any existing event to allow notification of a copy of a folder in finder? If not, are there any future plans to include such an event in the ES event list? Thank you.
Replies
2
Boosts
0
Views
1.5k
Activity
Jun ’22
App Store Review Guidelines 5.1.1 (ix) - Account delete requirement for banking apps
I would like to clarify the scope of section 5.1.1 (ix) of the app privacy policy, related to account sign-in.              "If your app supports account creation, you must also offer account deletion within the app." I understand that this will take effect from January 2022 https://developer.apple.com/news/?id=mdkbobfo Is there an exception for financial apps that include account creation / registration (e.g. banking apps)? The objective of the policy change seems to be to offer users a convenient and transparent option of unregistering from a service and deleting any related data. However, deleting a login for a banking app has more implications than just de-registering from the service (e.g. what to do with account balance, regulatory requirements may apply). Therefore direct interaction between the app user and the financial institution is likely to occur irrespective of any in-app options. Would either of these options be sufficient to comply with the iOS App Privacy Policy? Option 1 - include within the app a link to, or summary of, the bank's policy on how to close an account (e.g. contact bank directly over telephone, email, or in person). Option 2 - deactivation of login access via the mobile app (vs full closure of account).  If so, does the deactivation have to be performed within the app itself or could it be performed on a similar basis to account closure? (e.g. over telephone/email).
Replies
7
Boosts
1
Views
7.8k
Activity
Jun ’22
Integrate Passkey iCloud Keychain with other smartphone-based FIDO authenticator
Hi Developers, I am wondering how is it possible for other smartphone-based FIDO authenticators to use the same iCloud Keychain storage as Passkey does so those credentials can be used on non-apple devices too, and also on the smartphone at the same time. There are some other iOS authenticators that have implemented BLE and are working on all devices including Windows, but the problem is that those apps cannot support signing in to the website on the smartphone itself (neither in apps nor inside the browser) using the previously registered credential of 'cross-platform' type.
Replies
1
Boosts
0
Views
2.0k
Activity
Dec ’21
15.2 App Privacy Report developer message
Hello I've just installed the 15.2 beta developer beta and had a look at the new App Privacy Report feature. I can see the domains being contacted by my app coming through as expected. However, there is also a message there that I don't understand: "This app hasn't been updated by the developer to show which domains were contacted by websites or other content viewed in the app." Does anyone know what this is referring to? I'd like to update the app to support this, but I don't really understand this message or what action is expected. Thanks Updated to add: I have tested visiting a website in the in-app browser and it does appear in the Privacy Report in a separate section titled "Websites Visited In App". The above message is still present, however.
Replies
2
Boosts
0
Views
1.5k
Activity
Feb ’22
Authorization Plugin finding user entered FileVault password after Restart
I'm developing an authorization plugin to provide 2 Factor Authentication (2FA) for macOS. When FileVault is enabled, macOS Recovery prompts the user for a password to unlock FileVault FDE (Full Disk Encryption) before macOS can startup. The FDE password entered during Recovery is saved somehow so that after macOS starts up it can be used to log the user in without prompting them to re-enter their password. This feature is configurable with setting 'DisableFDEAutoLogin'. We would like our authorization plugin to implement the same behavior. The first place I thought to look for the FDE password (from within our authorization mechanism) is in Context value kAuthorizationEnvironmentPassword but it's not there. Is it possible for an authorization plugin to obtain this password the same as the standard login mechanism and if so how?
Replies
2
Boosts
0
Views
1.3k
Activity
Apr ’24
icloud imap access using QRESYNC and CONDSTORE
I'm the IMAP maintainer for Mozilla Thunderbird. I've been looking into adding QRESYNC imap extension to Thunderbird which currently only supports CONDSTORE extension. The icloud server returns these in its capabilities response: CONDSTORE ENABLE QRESYNC indicating complete support for enabling CONDSTORE and QRESYNC. But when I try to enable them, I get no "ENABLED" untagged response as required by imap ENABLE rfc: Tbird sends: 33 ENABLE CONDSTORE QRESYNC UTF8=ACCEPT icloud sends: 33 OK ENABLE completed The correct imap ENABLED response is like this: Tbird sends: 33 ENABLE CONDSTORE QRESYNC UTF8=ACCEPT icloud sends: * ENABLED CONDSTORE QRESYNC icloud sends: 33 OK ENABLE completed Since icloud doesn't support the UTF8=ACCEPT imap extension, it should just be excluded from the untagged ENABLED response. Several other imap servers I've tested (Dovecot, Cyrus and Zimbra) respond correctly when Thunderbird attempts the ENABLE but icloud responds in a non-standard manner. There are other problems too with the icloud response to imap SELECT with the QRESYNC parameter in that it produces an imap FETCH response for all messages in the folder with a sequence number of minus 1 (sequence numbers are supposed to be positive, 1 to number of messages in folder, never negative). Note: This seems to require a tag. Couldn't find one relevant to my question so just picked one with "icloud" in name.
Replies
2
Boosts
0
Views
999
Activity
Dec ’21
XCode not marked as is_platform_binary
Hi, in my ES application I am trying to ignore execution events of apple processes. I think the way to do this is to check for the is_platform_binary attribute of es_message_t but i found that when executing Xcode this attribute is false, is it because I downloaded it from the app store? Also would checking for the "com.apple" prefix of the signing id be a good way to identify apple signed processes?
Replies
5
Boosts
1
Views
1.5k
Activity
Nov ’21
SMJobBless fails when called from an XPC Service.
Hey there, I'm trying to employ the same pattern as demonstrated in the EvenBetterAuthorizationSample: an unsandboxed XPC service calls SMJobBless to install a privileged helper service on behalf a sandboxed main app (which isn't allowed to call SMJobBless). It then starts an XPC connection to the Mach service hosted by the privileged service, and hands over the connection back to the main app, along with the XPC service's connection to the security server (AuthorizationRef). When I try to do call SMJobBless from my XPC service, I get these messages: info authd Process /usr/libexec/smd (PID 28881) evaluates 1 rights with flags 00000003 (engine 629): ( "com.apple.ServiceManagement.blesshelper" ) error authd Fatal: interaction not allowed (session has no ui access) (engine 629) default authd Failed to authorize right 'com.apple.ServiceManagement.blesshelper' by client '/usr/libexec/smd' [28881] for authorization created by '/MyApp.app/Contents/XPCServices/IntermediatorXPCService.xpc' [29325] (3,0) (-60007) (engine 629) error authd copy_rights: authorization failed This seems reasonable to me, because I wouldn't expect an XPC service to be capable of running graphics. However, this works just fine in the "App-Sandboxed" app in the EvenBetterAuthorizationSample project. I poked around the available open source code, and found out that this message is logged when the processes' audit session doesn't have AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS set. if (!(session_get_attributes(auth_token_get_session(engine->auth)) & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS)) { os_log_error(AUTHD_LOG, "Fatal: interaction not allowed (session has no ui access) (engine %lld)", engine->engine_index); return errAuthorizationInteractionNotAllowed; } Out of curiosity, I compared the audit sessions of my XPC service to the one in EBAS using this code: auditinfo_addr_t auditInfo; int result = getaudit_addr(&auditInfo, sizeof(auditInfo)); assert(result == 0 ); if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_INITIAL) { NSLog(@"AU_SESSION_FLAG_IS_INITIAL"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS) { NSLog(@"AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_TTY) { NSLog(@"AU_SESSION_FLAG_HAS_TTY"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_REMOTE) { NSLog(@"AU_SESSION_FLAG_IS_REMOTE"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_CONSOLE_ACCESS) { NSLog(@"AU_SESSION_FLAG_HAS_CONSOLE_ACCESS"); } if (auditInfo.ai_flags & AU_SESSION_FLAG_HAS_AUTHENTICATED) { NSLog(@"AU_SESSION_FLAG_HAS_AUTHENTICATED"); } Sure enough, I got different results. EBAS: 2021-11-20 18:45:52.792512-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] result: 0 2021-11-20 18:45:52.792527-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] AU_SESSION_FLAG_HAS_GRAPHIC_ACCESS 2021-11-20 18:45:52.792539-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] AU_SESSION_FLAG_HAS_TTY 2021-11-20 18:45:52.792549-0500 com.example.apple-samplecode.EBAS.XPCService[25296:592874] AU_SESSION_FLAG_HAS_CONSOLE_ACCESS (lldb) p auditInfo (auditinfo_addr_t) $0 = { ai_auid = 501 ai_mask = (am_success = 4294967295, am_failure = 4294967295) ai_termid = { at_port = 50331650 at_type = 4 at_addr = ([0] = 0, [1] = 0, [2] = 0, [3] = 0) } ai_asid = 100019 ai_flags = 8240 } My XPC service: 2021-11-20 21:33:44.355007-0500 IntermediatorXPCService[29325:698278] result: 0 (lldb) p auditInfo ▿ __C.auditinfo_addr - ai_auid: 4294967295 ▿ ai_mask: __C.au_mask - am_success: 4294967295 - am_failure: 4294967295 ▿ ai_termid: __C.au_tid_addr - at_port: 0 - at_type: 4 ▿ at_addr: (4 elements) - .0: 0 - .1: 0 - .2: 0 - .3: 0 - ai_asid: 102293 - ai_flags: 0 It looks like ai_flags is all 0. Any ideas why that might be? What is making EBAS special? And also, how can AU_SESSION_FLAG_HAS_TTY and AU_SESSION_FLAG_HAS_CONSOLE_ACCESS be false? I'm reading these logs from the console?! (Another curious observation: audit_session_flags is imported into Swift as RawRepresentable, but not as an OptionSet)
Replies
4
Boosts
0
Views
2k
Activity
Nov ’21
IDFA Enquiry
Hi, I’ve recently had questions regarding GDPR and privacy on Apple products and spoke to numerous sources regarding it, but some of my queries remain unanswered. I was then directed to this forum so I’m hoping someone on here may be able to help please! In Apple’s development program information, In article 3.3.12 it states: “You and Your Applications (and any third party with whom You have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier.” Following seeing the aforementioned article I asked if this meant that iOS apps are only allowed to associate one IDFA with one user? I.e. if an app user got a new iPhone, would this mean that the application developers would have to remove the previous IDFA, and now associate the one from the new device with the user?  Hope that makes sense and that you may be able to help.  Thanks
Replies
1
Boosts
0
Views
1.1k
Activity
Nov ’21
MailKit API Documentation
Does any have anyone have documentation on the usage related to the forMessageContext and messageContext parameters and for the methods below? This is undocumented while public making it an unusable API. func extensionViewController(messageContext: Data) -> MEExtensionViewController? func primaryActionClicked(forMessageContext context: Data) async -> MEExtensionViewController? The APIs are located here but lack any kind of proper documentation and examples https://developer.apple.com/documentation/mailkit/memessagesecurityhandler/3882908-extensionviewcontroller
Replies
0
Boosts
0
Views
981
Activity
Nov ’21
Generating key pair in System Keychain
In our macOS Application I am trying to generate a keypair in the system keychain using SecKeyCreatePair for legacy reasons, but keep receive an error -61 (Write permission error). What is the best approach to making this work or is this simply not possible (anymore)? The End User running this Application is typically an Admin and we would normally use the SFAuthorization to grab sudo for this type of issue. This is not possible using Apple Security Framework functions as far as I can see, not even the latest function SecKeyCreateRandomKey.
Replies
9
Boosts
0
Views
1.6k
Activity
Dec ’21