From a4552152af73569d57590a4a3f583727b706584c Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Mon, 10 Nov 2014 22:52:33 +0100 Subject: [PATCH] cipher: Fix opening SQLCipher DBs using page size 1024 No idea how this fixes that inconsistency bug described here but it does: https://discuss.zetetic.net/t/sqlcipher-support-being-added-to-db-browser-for-sqlite/243/6 --- src/sqlitedb.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp index 9f2649f2..68f7ff9c 100644 --- a/src/sqlitedb.cpp +++ b/src/sqlitedb.cpp @@ -78,6 +78,8 @@ bool DBBrowserDB::open(const QString& db) CipherDialog cipher(0, false); if(cipher.exec()) { + sqlite3_key(_db, cipher.password().toUtf8(), cipher.password().toUtf8().length()); + sqlite3_exec(_db, QString("PRAGMA cipher_page_size = 4096;").toUtf8(), NULL, NULL, NULL); sqlite3_key(_db, cipher.password().toUtf8(), cipher.password().toUtf8().length()); sqlite3_exec(_db, QString("PRAGMA cipher_page_size = %1;").arg(cipher.pageSize()).toUtf8(), NULL, NULL, NULL); isEncrypted = true;