deprecate cipher_store_pass

This commit is contained in:
Stephen Lombardo 2020-10-20 09:16:51 -04:00
parent 47449e26b1
commit 1087a3fa6d
2 changed files with 14 additions and 0 deletions

View File

@ -119,7 +119,10 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
} else
if( sqlite3StrICmp(zLeft, "cipher_store_pass")==0 && zRight ) {
if(ctx) {
char *deprecation = "PRAGMA cipher_store_pass is deprecated, please remove from use";
sqlcipher_codec_set_store_pass(ctx, sqlite3GetBoolean(zRight, 1));
codec_vdbe_return_string(pParse, "cipher_store_pass", deprecation, P4_TRANSIENT);
sqlite3_log(SQLITE_WARNING, deprecation);
}
} else
if( sqlite3StrICmp(zLeft, "cipher_store_pass")==0 && !zRight ) {

View File

@ -214,6 +214,17 @@ do_test verify-cipher-store-pass-before-key-does-not-segfault {
db close
file delete -force test.db
# verify setting cipher_store_pass results in deprecation warning
do_test verify-cipher-store-pass-deprecated {
sqlite_orig db test.db
execsql {
PRAGMA key = 'test';
PRAGMA cipher_store_pass = 1;
}
} {ok {PRAGMA cipher_store_pass is deprecated, please remove from use}}
db close
file delete -force test.db
# verify the pragma cipher
# reports the default value
if_built_with_openssl verify-pragma-cipher-default {