"entryExists(",testDir,") should have failed");
}
}/*OPFS util sanity checks*/)
+//#if enable-see
+ .t({
+ name: 'OPFS with SEE encryption',
+ test: function(sqlite3){
+ const dbFile = 'file:///sqlite3-see.edb';
+ const dbCtor = sqlite3.oo1.OpfsDb;
+ const hexFoo = new Uint8Array([0x66,0x6f,0x6f]/*=="foo"*/);
+ let initDb = true;
+ const tryKey = function(keyKey, key, expectCount){
+ let db;
+ //console.debug('tryKey()',arguments);
+ const ctoropt = {
+ filename: dbFile,
+ flags: 'c'
+ };
+ try {
+ if (initDb) {
+ initDb = false;
+ const opt = {
+ ...ctoropt,
+ [keyKey]: key
+ };
+ opt.filename += '?delete-before-open=1';
+ db = new dbCtor(opt);
+ db.exec([
+ "drop table if exists t;",
+ "create table t(a);"
+ ]);
+ db.close();
+ // Ensure that it's actually encrypted...
+ let err;
+ try {
+ db = new dbCtor(ctoropt);
+ T.assert(db, 'db opened') /* opening is fine, but... */;
+ const rv = db.exec({
+ sql:"select count(*) from sqlite_schema",
+ returnValue: 'resultRows'
+ });
+ console.warn("(should not be reached) rv =",rv);
+ } catch (e) {
+ err = e;
+ } finally {
+ db.close()
+ }
+ T.assert(err, "Expecting an exception")
+ .assert(sqlite3.capi.SQLITE_NOTADB == err.resultCode,
+ "Expecting NOTADB");
+ }/*initDb*/
+ db = new dbCtor({
+ ...ctoropt,
+ [keyKey]: key
+ });
+ db.exec("insert into t(a) values (1),(2)");
+ T.assert(expectCount === db.selectValue('select sum(a) from t'));
+ } finally {
+ if (db) db.close();
+ }
+ };
+ tryKey('textkey', 'foo', 3);
+ T.assert( !initDb );
+ tryKey('textkey', 'foo', 6);
+ initDb = true;
+ tryKey('key', 'foo', 3);
+ T.assert( !initDb );
+ tryKey('key', hexFoo, 6);
+ initDb = true;
+ tryKey('hexkey', hexFoo, 3);
+ T.assert( !initDb );
+ tryKey('hexkey', hexFoo, 6);
+ }
+ })/*OPFS with SEE*/
+//#endif enable-see
;/* end OPFS tests */
////////////////////////////////////////////////////////////////////////
.assert(true === await u3.removeVfs())
.assert(false === await P3b.removeVfs());
}
- }/*OPFS SAH Pool sanity checks*/);
+ }/*OPFS SAH Pool sanity checks*/)
+//#if enable-see
+ .t({
+ name: 'OPFS SAHPool with SEE encryption',
+ test: async function(sqlite3){
+ const inst = sqlite3.installOpfsSAHPoolVfs,
+ catcher = (e)=>{
+ error("Cannot load SAH pool VFS.",
+ "This might not be a problem,",
+ "depending on the environment.");
+ return false;
+ };
+ const poolConfig = {
+ name: 'opfs-sahpool-see',
+ clearOnInit: true,
+ initialCapacity: 6
+ }
+ let poolUtil;
+ const P1 = await inst(poolConfig).then(u=>poolUtil = u).catch(catcher);
+ const dbFile = '/sqlite3-see.edb';
+ const dbCtor = poolUtil.OpfsSAHPoolDb;
+ const hexFoo = new Uint8Array([0x66,0x6f,0x6f]/*=="foo"*/);
+ let initDb = true;
+ const tryKey = function(keyKey, key, expectCount){
+ let db;
+ //console.debug('tryKey()',arguments);
+ const ctoropt = {
+ filename: dbFile,
+ flags: 'c'
+ };
+ try {
+ if (initDb) {
+ initDb = false;
+ poolUtil.unlink(dbFile);
+ db = new dbCtor({
+ ...ctoropt,
+ [keyKey]: key
+ });
+ db.exec([
+ "drop table if exists t;",
+ "create table t(a);"
+ ]);
+ db.close();
+ // Ensure that it's actually encrypted...
+ let err;
+ try {
+ db = new dbCtor(ctoropt);
+ T.assert(db, 'db opened') /* opening is fine, but... */;
+ const rv = db.exec({
+ sql:"select count(*) from sqlite_schema",
+ returnValue: 'resultRows'
+ });
+ console.warn("(should not be reached) rv =",rv);
+ } catch (e) {
+ err = e;
+ } finally {
+ db.close()
+ }
+ T.assert(err, "Expecting an exception")
+ .assert(sqlite3.capi.SQLITE_NOTADB == err.resultCode,
+ "Expecting NOTADB");
+ }/*initDb*/
+ db = new dbCtor({
+ ...ctoropt,
+ [keyKey]: key
+ });
+ db.exec("insert into t(a) values (1),(2)");
+ T.assert(expectCount === db.selectValue('select sum(a) from t'));
+ } finally {
+ if (db) db.close();
+ }
+ };
+ tryKey('textkey', 'foo', 3);
+ T.assert( !initDb );
+ tryKey('textkey', 'foo', 6);
+ initDb = true;
+ tryKey('key', 'foo', 3);
+ T.assert( !initDb );
+ tryKey('key', hexFoo, 6);
+ initDb = true;
+ tryKey('hexkey', hexFoo, 3);
+ T.assert( !initDb );
+ tryKey('hexkey', hexFoo, 6);
+ poolUtil.removeVfs();
+ }
+ })/*opfs-sahpool with SEE*/
+//#endif enable-see
+ ;
////////////////////////////////////////////////////////////////////////
T.g('Misc. APIs')
-C A\sbetter/cleaner\sfix\sfor\s[1c80ff88c0ce].
-D 2025-10-26T18:36:57.909
+C Merge\sthe\sOPFS/SEE\stests\sinto\strunk\s(where\sthey\sshould\shave\sbeen\scommitted).
+D 2025-10-26T21:58:41.214
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F ext/wasm/test-opfs-vfs.js 1618670e466f424aa289859fe0ec8ded223e42e9e69b5c851f809baaaca1a00c
F ext/wasm/tester1-worker.c-pp.html 883881eeac14eeeecc8ff22acf9fe0f18a97cacb48be08ebb0bae891ceded584
F ext/wasm/tester1.c-pp.html 949920126dcf477925d8d540093d9cc374d3ab4c4ddee920c1dcadcf37917306
-F ext/wasm/tester1.c-pp.js 614cac06524ec2202027c7f6cc5e94d91482b0eb6aa969f252517047596e404e
+F ext/wasm/tester1.c-pp.js 2b014884dadf28928fabcb688746ca87145673eef75e154486505a266203fc15
F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e
F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 1c80ff88c0ce3d1c168c9bda734cf52114c35efdcf46a6da78f0ed9adc794eb8
-R 04e610ca0337c73b36729e6386aee354
+P 6138043bdde09224a764b5d5f18a9e2776c761c424f41b0d69427d92d47ec41c
+Q +1eb5a7ea394aa5b7e8594d73ce31f4b9bef55f2fa977dc26810c0bfba1cc39f7
+Q +b4cffc00f3a18906867e8f070fbc49293ac5c038bad58e96ea74948591f31013
+R 9a51627186e7879bbe7ff3649302586a
U stephan
-Z ad2335c205939a51b504ef149e1fbfa8
+Z d8932b412ba0bdfe0174e42bcd1a555b
# Remove this line to create a well-formed Fossil manifest.