project-imas / encrypted-core-data

v2.0 - iOS Core Data encrypted SQLite store using SQLCipher
Other
785 stars 236 forks source link

Application crash when creating a options Dictionary used by addPersistentStoreWithType method #298

Open aliakhtar49 opened 6 years ago

aliakhtar49 commented 6 years ago

When using a addPersistentStoreWithType method , we can pass options dictionary for basic configuration . Creation of Dictionary method are as follows

- (NSDictionary*)getEncryptedStoreOptionsWithPassword:(NSString*)password andDatabaseStore:(NSURL*)storeUrl { return @{ EncryptedStorePassphraseKey: password, EncryptedStoreDatabaseLocation: storeUrl, NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES }; }

When creating a persistentStoreCoordinator , calling code look like this

NSString *currentPassword = [[VJAesCryptoWrapper getInstance] getCurrentPassword]; NSDictionary *options = [self getEncryptedStoreOptionsWithPassword:currentPassword andDatabaseStore:newStoreURL];

I am saving password in keychain using KeychainItemWrapper and my code crashing exactly on getEncryptedStoreOptionsWithPassword:currentPassword method ,App is live and I am not able to reproduce the crash , but on crashlytics it is showing so many crash

crashlytics crash logs image

Can someone help or point out something , Is this a problem with encrypted core data or have some issue in keychain .

aliakhtar49 commented 6 years ago

@DanielBroad do you have any idea , could you help Detailed question link https://stackoverflow.com/questions/50377324/application-is-crashing-when-creating-a-options-dictionary-used-by-addpersistent