Details
Description
Many of my CBL database-encryption unit tests are failing with the latest stable commit of ForestDB. The cause of the failures is that opening a ForestDB database using an incorrect password does not fail, i.e. the call to fdb_open succeeds even though the password is wrong!
This bug occurs with both encrypted and unencrypted databases, when the configuration includes an encryption key. The strange thing is that a similar test — creating an encrypted database, then trying to open it without a key — still passes (i.e. the database could not be opened.)
My tests immediately abort after opening the database, so I don't know whether any of the documents in it are readable. I assume not, since the contents are encrypted.
The following is logged to stderr while opening the database:
[FDB ERR] Crash Detected: Last Block not DBHEADER c1 in a database file '/var/folders/4f/mvdftm3d5ss0ystm0m2q8q3m0000gn/T/CBL_iOS_Unit_Tests/seekrit.cblite2/db.forest.0'
|
|
[FDB ERR] Crash Detected: Last Block not DBHEADER a4 in a database file '/var/folders/4f/mvdftm3d5ss0ystm0m2q8q3m0000gn/T/CBL_iOS_Unit_Tests/seekrit.cblite2/db.forest.0'
|
|
[FDB ERR] Crash Detected: Last Block not DBHEADER 16 in a database file '/var/folders/4f/mvdftm3d5ss0ystm0m2q8q3m0000gn/T/CBL_iOS_Unit_Tests/seekrit.cblite2/db.forest.0'
|
|
[FDB ERR] Crash Detected: Last Block not DBHEADER c1 in a database file '/var/folders/4f/mvdftm3d5ss0ystm0m2q8q3m0000gn/T/CBL_iOS_Unit_Tests/seekrit.cblite2/db.forest.0'
|
|
[FDB INFO] Forestdb opened database file /var/folders/4f/mvdftm3d5ss0ystm0m2q8q3m0000gn/T/CBL_iOS_Unit_Tests/seekrit.cblite2/db.forest.0
|
Attachments
For Gerrit Dashboard: MB-19970 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
64994,2 | MB-19970 Encrypt/decrypt superblock | master | forestdb | Status: MERGED | +2 | +1 |
65027,2 | MB-19970 Encrypt/decrypt superblock | stable | forestdb | Status: MERGED | +2 | +1 |
65144,2 | MB-19970. Generate error on symbol \!, instead of silently ignoring it. | master | query | Status: MERGED | +2 | +1 |