I'd like to use SQLCipher in mixed mode - with and without encryption.
And It seems there is a problem with 'ATTACH DATABASE' command. The
scenario that reproduces this issue:
1. Open new database and don't use sqlite3_key for encryption.
2. Try to attache another new database (also without encryption) - an
error occurs (cannot attach database).
It seems he problem occurs at attachFunc(...) function, near
case SQLITE_NULL:
/* No key specified. Use the key from the main database */
sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
break;
Because there is no key at the main database - NULL value also passed
into sqlite3CodecAttach. Then sqlite3CodecAttach does nothing but
returns SQLITE_ERROR. I'm not sure it's SQLite error or SQLCipher
incorrect parameter processing.
I must to say also that I build WinCE version and I use and
amalgamation SQLite 3.6.22 source - I only added '#include "crypto.c"
line in the end of sqlite3.c.
Thank you, this works great.
Stephen Lombardo wrote:
> There is a fix for this issue that I just pushed up to github.
>
> http://github.com/sjlombardo/sqlcipher
--
Best regards,
Sergey Chumakov 2:450/77[.43]