Skip to content

Commit

Permalink
Sqlcipher: use compatibility mode instead of migration
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 91fe86328e7fcd2e03e298482ad2ffac2b48767f
  • Loading branch information
arseny30 committed Aug 14, 2020
1 parent e43f419 commit 11e09c5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tddb/td/db/SqliteDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,8 @@ Result<SqliteDb> SqliteDb::do_open_with_key(CSlice path, const DbKey &db_key, bo
auto key = db_key_to_sqlcipher_key(db_key);
TRY_STATUS(db.exec(PSLICE() << "PRAGMA key = " << key));
if (with_cipher_migrate) {
LOG(INFO) << "Start 'PRAGMA cipher_migrate' for " << path;
PerfWarningTimer timer("PRAGMA cipher_migrate", 0.5);
TRY_RESULT(code, db.get_pragma_string("cipher_migrate"));
LOG(INFO) << "Finish 'PRAGMA cipher_migrate' for " << path;
if (code != "0") {
return Status::Error(PSLICE() << "'PRAGMA cipher_migrate' failed - " << code);
}
LOG(INFO) << "Try Sqlcipher compatibility mode";
TRY_STATUS(db.exec("PRAGMA cipher_compatibility = 3"));
}
}
TRY_STATUS_PREFIX(db.check_encryption(), "Can't open database: ");
Expand Down

0 comments on commit 11e09c5

Please sign in to comment.