@@ -611,6 +611,19 @@ do_test verify-errors-for-rekey-kdf-and-cipher-changes {
611611db close
612612file delete -force test.db
613613
614+
615+ setup test.db "'testkey'"
616+ do_test verify-errors-for-cipher-change {
617+ sqlite_orig db test.db
618+ execsql {
619+ PRAGMA key = 'testkey';
620+ PRAGMA cipher = 'aes-256-ecb';
621+ }
622+ } {{PRAGMA cipher is no longer supported.}}
623+ db close
624+ file delete -force test.db
625+
626+
614627# create an unencrypted database, attach a new encrypted volume
615628# copy data between, verify the encypted database is good afterwards
616629do_test unencrypted-attach {
@@ -981,7 +994,6 @@ do_test attached-database-pragmas {
981994 COMMIT;
982995 ATTACH DATABASE 'test2.db' AS db2 KEY 'testkey2';
983996 PRAGMA db2.cipher_page_size = 8192;
984- PRAGMA db2.cipher = 'aes-128-cbc';
985997 PRAGMA db2.kdf_iter = 1000;
986998 PRAGMA db2.cipher_use_hmac = OFF;
987999 CREATE TABLE db2.t1(a,b);
@@ -994,12 +1006,11 @@ do_test attached-database-pragmas {
9941006 execsql {
9951007 PRAGMA key = 'testkey2';
9961008 PRAGMA cipher_page_size = 8192;
997- PRAGMA cipher = 'aes-128-cbc';
9981009 PRAGMA kdf_iter = 1000;
9991010 PRAGMA cipher_use_hmac = OFF;
10001011 SELECT count(*) FROM t1;
10011012 }
1002- } {{PRAGMA cipher command is deprecated, please remove from usage.} 1000}
1013+ } {1000}
10031014db close
10041015file delete -force test.db
10051016file delete -force test2.db
@@ -1380,7 +1391,6 @@ do_test cipher-options-before-keys {
13801391 execsql {
13811392 PRAGMA kdf_iter = 1000;
13821393 PRAGMA cipher_page_size = 8192;
1383- PRAGMA cipher = 'aes-128-cbc';
13841394 PRAGMA cipher_use_hmac = OFF;
13851395 PRAGMA key = 'testkey';
13861396 CREATE table t1(a,b);
@@ -1903,19 +1913,6 @@ if_built_with_openssl verify-pragma-cipher-default {
19031913db close
19041914file delete -force test.db
19051915
1906- # verify the pragma cipher
1907- # reports a change in value
1908- if_built_with_openssl verify-pragma-cipher-changed {
1909- sqlite_orig db test.db
1910- execsql {
1911- PRAGMA key = 'test';
1912- PRAGMA cipher = 'AES-256-ECB';
1913- PRAGMA cipher;
1914- }
1915- } {{PRAGMA cipher command is deprecated, please remove from usage.} AES-256-ECB}
1916- db close
1917- file delete -force test.db
1918-
19191916# verify the pragma cipher_hmac_salt_mask reports default
19201917do_test verify-pragma-hmac-salt-mask-reports-default {
19211918 sqlite_orig db test.db
@@ -2022,13 +2019,23 @@ do_test 2.0-beta-to-2.0-migration {
20222019db close
20232020file delete -force test.db
20242021
2022+ if_built_with_openssl verify-default-cipher {
2023+ sqlite_orig db test.db
2024+ execsql {
2025+ PRAGMA key='test';
2026+ PRAGMA cipher;
2027+ }
2028+ } {AES-256-CBC}
2029+ db close
2030+ file delete -force test.db
2031+
20252032if_built_with_libtomcrypt verify-default-cipher {
20262033 sqlite_orig db test.db
20272034 execsql {
20282035 PRAGMA key='test';
20292036 PRAGMA cipher;
20302037 }
2031- } {rijndael }
2038+ } {aes-256-cbc }
20322039db close
20332040file delete -force test.db
20342041
@@ -2276,27 +2283,6 @@ do_test attach_database_with_non_default_page_size {
22762283db close
22772284file delete -force test.db test2.db
22782285
2279- if_built_with_openssl wont-write-database-with-invalid-cipher {
2280- sqlite_orig db test.db
2281- catchsql {
2282- PRAGMA key = 'test';
2283- PRAGMA cipher = 'foobar';
2284- CREATE TABLE t1(a,b);
2285- }
2286- } {1 {SQL logic error}}
2287- db close
2288- file delete -force test.db
2289-
2290- if_built_with_openssl wont-write-database-with-invalid-cipher-2 {
2291- sqlite_orig db test.db
2292- execsql {
2293- PRAGMA key = 'test';
2294- PRAGMA cipher = 'foobar';
2295- }
2296- } {{PRAGMA cipher command is deprecated, please remove from usage.}}
2297- db close
2298- file delete -force test.db
2299-
23002286do_test verify-cipher-export-with-trace-configured {
23012287 sqlite_orig db plain.db
23022288 execsql {
0 commit comments