Commit eb03b04
committed
libsql-ffi: Update vendored SQLite3MultipleCiphers to 1.9.0
This updates the vendored SQLite3 Multiple Ciphers encryption extension
from 1.8.1 to 1.9.0, the release that targets upstream SQLite 3.47.0 (the
base version we now ship). The previous 1.8.1 vendoring lagged the SQLite
base and was missing several upstream fixes, including a crash in
sqlite3mcSetCodec().
The import replaces all upstream files with their v1.9.0 contents and
re-applies libSQL's local patches via 3-way merge (base v1.8.1, ours
libSQL, theirs v1.9.0). All merges were clean (no conflicts), and
`cargo build -p libsql-ffi --features multiple-ciphers` builds.
== Preserved as-is (not upstream sqlite3mc) ==
src/sqlite3.c, src/sqlite3.h — libSQL's own SQLite amalgamation, not
sqlite3mc's vanilla copy. build.rs overwrites src/sqlite3.c with
libsql-sqlite3's amalgamation at build time regardless, so these are
left untouched.
== Re-applied libSQL patches (3-way merged onto 1.9.0) ==
CMakeLists.txt — libSQL build options (LIBSQL_ENCRYPTION,
LIBSQL_CUSTOM_PAGER_CODEC, LIBSQL_EXTRA_PRAGMAS,
LIBSQL_ENABLE_WASM_RUNTIME), AES256-only cipher selection, and the
arm/aarch64 guards around -msse4.2/-maes.
src/sqlite3mc.c — `#include "sqlite3.c"` instead of "sqlite3patched.c"
so the amalgamation pulls in libSQL's SQLite.
src/codecext.c, src/sqlite3mc_vfs.c — libSQL codec hooks
libsql_db_has_codec(), libsql_pager_codec_impl() (replacing
sqlite3mcPagerHasCodec()/sqlite3mcPagerCodec()), and the cached
hasCodec update in the rekey success path.
src/cipher_config.c — libsql_extra_pragma().
src/cipher_wxaes256.c — libsql_generate_aes256_key().
src/codec_algos.c — libsql_generate_initial_vector().
== Notable upstream fixes now picked up ==
src/sqlite3mc_vfs.c — sqlite3mcSetCodec() now passes the VFS located by
mcFindVfs() (pVfsMC) to mcFindDbMainFileName() instead of blindly
casting db->pVfs. When the Multiple Ciphers VFS is not the top-level
VFS (another VFS stacked on top), db->pVfs is not an sqlite3mc_vfs and
the cast made mcFindDbMainFileName() dereference a bogus ->mutex and
crash. This matches the fix already present in sqlite3mcGetCodec().
src/sqlite3mc_vfs.c — the mcRead* helpers now propagate codec errors via
sqlite3mcGetCodecLastError() instead of silently resetting rc to
SQLITE_OK after decryption.1 parent 5816145 commit eb03b04
71 files changed
Lines changed: 23578 additions & 11348 deletions
File tree
- libsql-ffi/bundled/SQLite3MultipleCiphers
- scripts
- src
- ascon
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
10 | 74 | | |
11 | 75 | | |
12 | 76 | | |
| |||
469 | 533 | | |
470 | 534 | | |
471 | 535 | | |
472 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
473 | 545 | | |
474 | 546 | | |
475 | 547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| |||
182 | 181 | | |
183 | 182 | | |
184 | 183 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | 184 | | |
192 | 185 | | |
193 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | 95 | | |
97 | 96 | | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
193 | | - | |
194 | 192 | | |
195 | 193 | | |
196 | | - | |
| 194 | + | |
197 | 195 | | |
198 | 196 | | |
199 | 197 | | |
| |||
251 | 249 | | |
252 | 250 | | |
253 | 251 | | |
254 | | - | |
| 252 | + | |
255 | 253 | | |
256 | 254 | | |
257 | 255 | | |
| |||
342 | 340 | | |
343 | 341 | | |
344 | 342 | | |
345 | | - | |
346 | 343 | | |
347 | 344 | | |
348 | | - | |
| 345 | + | |
349 | 346 | | |
350 | 347 | | |
351 | 348 | | |
| |||
453 | 450 | | |
454 | 451 | | |
455 | 452 | | |
456 | | - | |
457 | 453 | | |
458 | 454 | | |
459 | | - | |
| 455 | + | |
460 | 456 | | |
461 | 457 | | |
462 | 458 | | |
| |||
526 | 522 | | |
527 | 523 | | |
528 | 524 | | |
529 | | - | |
| 525 | + | |
530 | 526 | | |
531 | 527 | | |
532 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
0 commit comments