Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Cannot load generic password from iOS Keychain (errSecNotAvailable -25291)

$
0
0

I developed a react native iOS app which saves/loads data into/from keychain via https://github.com/mCodex/react-native-sensitive-info/blob/master/ios/RNSensitiveInfo/RNSensitiveInfo.m

My read/write keychain options is below, it never changes and works well since day1

const defaultOptions: RNSensitiveInfoOptions = {  touchID: true,  kSecAccessControl: 'kSecAccessControlBiometryAny',  kSecUseOperationPrompt: 'We will store data securely on your device.',  sharedPreferencesName: 'sensitive',  keychainService: 'sensitive',};

Recently one of my clients complain about the data cannot be retrieved from keychain because of errSecNotAvailable = -25291, /* No keychain is available. You may need to restart your computer. */

I thought there might be something wrong happened to keychain, so I tried set a single key/value item with the same option (so the kSecAttrService and kSecClass are same with business related items): 'foo' ->'bar'. And I can load this value out via the same option.

I did more experiences:

  1. if I read a key doesn't exist, the keychain API will return error errSecItemNotFound -25300

  2. if I read a business related key, the keychain API return error errSecNotAvailable -25291

  3. I jailbreak this iPhone and use https://github.com/ptoomey3/Keychain-Dumper to dump the items but it prompt (although the phone is unlock):

[INFO] No Generic Password Keychain items found.[HINT] You should unlock your device!
  1. I copied Keychain-2.db from device to local computer and using sqlite DB to query the generic password items, looks like they are there (but as they are encrypted, i am not sure 100%):enter image description here

I am expecting someone could suggest:

  1. why this issue could happen?
  2. is there any possibility I can restore the keychain data?

Viewing all articles
Browse latest Browse all 16750

Trending Articles