diff options
author | drebs <drebs@leap.se> | 2015-04-30 11:24:21 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2015-05-20 10:16:46 -0300 |
commit | 3a3f2d8ca5b0ae2adb5007577f2d828677ff64e0 (patch) | |
tree | b038e8f2f55b85b4ceda70b46e80269d7d96b01b | |
parent | 340b0dcfbc0a819738a28f9c803fdbf848754897 (diff) |
[bug] always initialize sync db
Both deferred encryption and decryption rely on a special sync db. Previous to
this fix, the sync db was only initialized if a syncer was configured with
deferred encryption capabilities. This was a problem when the syncer was not
configured like so, but the actual sync method was initiated configured to do
deferred decryption.
This commit fixes this by always initializing the sync db, so we have the
option of doing all combinations of deferred encryption and decryption.
-rw-r--r-- | client/changes/bug_always-initialize-the-sync-db | 2 | ||||
-rw-r--r-- | client/src/leap/soledad/client/sqlcipher.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/client/changes/bug_always-initialize-the-sync-db b/client/changes/bug_always-initialize-the-sync-db new file mode 100644 index 00000000..2b12989a --- /dev/null +++ b/client/changes/bug_always-initialize-the-sync-db @@ -0,0 +1,2 @@ + o Always initialize the sync db to allow for both asynchronous encryption + and asynchronous decryption when syncing. diff --git a/client/src/leap/soledad/client/sqlcipher.py b/client/src/leap/soledad/client/sqlcipher.py index db3cb5cb..ec7946b7 100644 --- a/client/src/leap/soledad/client/sqlcipher.py +++ b/client/src/leap/soledad/client/sqlcipher.py @@ -503,8 +503,12 @@ class SQLCipherU1DBSync(SQLCipherDatabase): self._db_handle = None self._initialize_main_db() + # the sync_db is used both for deferred encryption and decryption, so + # we want to initialize it anyway to allow for all combinations of + # deferred encryption and decryption configurations. + self._initialize_sync_db(opts) + if defer_encryption: - self._initialize_sync_db(opts) # initialize syncing queue encryption pool self._sync_enc_pool = crypto.SyncEncrypterPool( |