fix(sqlite): isolate bundled SQLite from host libraries - #531
Draft
VanshKhanna wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Host applications that link another SQLite implementation can resolve WalletKit's native
sqlite3_*calls to that library. With Apple's system SQLite selected, the cipher check added in 0.22.0 returns no row and storage initialization fails withsqlite error 101: query returned no rows.Compile the checksum-pinned sqlite3mc amalgamation with its SQLite C API given internal linkage, expose only 21 WalletKit-prefixed wrappers to Rust, and retain the existing cipher, key encoding, and database format. A missing cipher now reports an actionable backend-isolation error. Add native link-order regression checks to macOS CI and a frozen encrypted fixture generated with the original library.
Before/after evidence:
v0.22.0(c6f8c06) and this fix. The control checkout adds only the probe/example registration; production code is unchanged.WalletKit SQLite link regression: sqlite error 101: query returned no rows.Additional local validation:
cargo test -p walletkit-sqlite -p walletkit-db --locked: 22 tests passed, including the frozen pre-fix encrypted database, envelope bytes, and content IDs.cargo clippy -p walletkit-sqlite -p walletkit-db --all-targets --locked -- -D warnings, Rust formatting, and ShellCheck passed.cargo build -p walletkit-sqlite --target aarch64-apple-ios --target aarch64-apple-ios-sim --lockedpassed.sqlite3_*symbols.Validation limit: this proves the reproduced library-resolution failure is fixed. It does not yet confirm the cause in the reporting application's final binary. Before release, verify authenticator/storage initialization and credential access in that app on fresh and existing encrypted stores. Full device runtime, Android integration, and the affected app's linking configuration have not been validated locally.