This commit is contained in:
Stephen Lombardo 2019-10-03 15:43:04 -04:00
parent 1a7cc84fa1
commit 6936ef0d11
2 changed files with 3 additions and 1 deletions

View File

@ -165,7 +165,8 @@ sqlite3_backup *sqlite3_backup_init(
sqlite3CodecGetKey(pDestDb, sqlcipher_find_db_index(pDestDb, zDestDb), &zKey, &destNKey);
zKey = NULL;
if(srcNKey || destNKey) {
/* either both databases must be plaintext, or both must be encrypted */
if((srcNKey == 0 && destNKey > 0) || (srcNKey > 0 && destNKey == 0)) {
sqlite3ErrorWithMsg(pDestDb, SQLITE_ERROR, "backup is not supported with encrypted databases");
return NULL;
}

View File

@ -48,5 +48,6 @@ slave_test_file $testdir/sqlcipher-rekey.test
slave_test_file $testdir/sqlcipher-plaintext-header.test
slave_test_file $testdir/sqlcipher-pragmas.test
slave_test_file $testdir/sqlcipher-integrity.test
slave_test_file $testdir/sqlcipher-backup.test
finish_test