Repository navigation
Check database readability without an encryption key - #608
Merged
Merged
Conversation
Expose the existing 16-byte header comparison as hasSQLiteHeader(), so callers can request a cheap signature check without assuming the database contents are unencrypted.
Query the schema through SQLite instead of treating its header signature as proof that a database is unencrypted. This detects ciphered databases that retain a plaintext header.
Use isReadableWithoutKey() to describe what the schema query tests. Avoid implying that a failed read proves database encryption.
SRombauts
force-pushed
the
534-fix-unencrypted-detection
branch
from
October 24, 2026 10:19
5f8b84a to
f39ad2d
Compare
SRombauts
force-pushed
the
534-fix-unencrypted-detection
branch
from
October 24, 2026 10:32
f39ad2d to
1de23d8
Compare
Check SQLITE_BUSY and SQLITE_CORRUPT results explicitly and keep unsupported formats unreadable. Remove unreachable fallback code.
Record the SQLite header probe and the renamed readability API for SQLiteCpp 4.0 in the unreleased changelog.
SRombauts
force-pushed
the
534-fix-unencrypted-detection
branch
from
October 24, 2026 10:39
1de23d8 to
1ac2c94
Compare
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.
Resolves #534. Replace the misleading
isUnencrypted()API withisReadableWithoutKey(), which queries the schema read-only and reports unreadable database formats without treating I/O errors as encryption.Add
hasSQLiteHeader()for the original 16-byte signature check, and cover plaintext-header unreadable files and empty files in tests. Targeted at the SQLiteCpp 4.0 API break.