Skip to content

Commit

Permalink
fix: db encryption improvements (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pallab Maiti authored Aug 31, 2023
1 parent abb2ee3 commit 82504dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Classes/RSDBPersistentManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ - (void)createDB:(RSDBEncryption * __nullable)dbEncryption {
int code = [self openEncryptedDB:dbEncryption.key];
if (code == SQLITE_NOTADB) {
// when key is wrong
// delete encrypted database; then open unencrypted database
// delete encrypted database; then open new encrypted database
// all previous events will be deleted
[RSLogger logError:@"RSDBPersistentManager: createDB: Wrong key is provided. Deleting encrypted DB and creating a new unencrypted DB"];
[self closeDB];
[RSUtils removeFile:ENCRYPTED_DB_NAME];
[self openUnencryptedDB];
[self openEncryptedDB:dbEncryption.key];
}
} else {
if (dbEncryption == nil || dbEncryption.key == nil) {
Expand Down

0 comments on commit 82504dd

Please sign in to comment.