Skip to content

Commit 4a81bea

Browse files
committed
Merge branch 'prerelease'
2 parents ece66fd + 1309dcf commit 4a81bea

254 files changed

Lines changed: 11866 additions & 2978 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# SQLCipher Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [4.4.0] - (May 2020 - [4.4.0 changes])
5+
- Updates baseline to upstream SQLite 3.31.0
6+
- Adjusts shell to report SQLCipher version alongside SQLite version
7+
- Fixes various build warnings under several compilers
8+
- Removes unused id and status functions from provider interface
9+
410
## [4.3.0] - (November 2019 - [4.3.0 changes])
511
- Updates baseline to upstream SQLite 3.30.1
612
- PRAGMA key now returns text result value "ok" after execution
@@ -158,7 +164,9 @@ All notable changes to this project will be documented in this file.
158164
### Security
159165
- Change KDF iteration length from 4,000 to 64,000
160166

161-
[unreleased]: https://github.com/sqlcipher/sqlcipher/compare/v4.3.0...prerelease
167+
[unreleased]: https://github.com/sqlcipher/sqlcipher/compare/v4.4.0...prerelease
168+
[4.4.0]: https://github.com/sqlcipher/sqlcipher/tree/v4.4.0
169+
[4.4.0 changes]: https://github.com/sqlcipher/sqlcipher/compare/v4.3.0...v4.4.0
162170
[4.3.0]: https://github.com/sqlcipher/sqlcipher/tree/v4.3.0
163171
[4.3.0 changes]: https://github.com/sqlcipher/sqlcipher/compare/v4.2.0...v4.3.0
164172
[4.2.0]: https://github.com/sqlcipher/sqlcipher/tree/v4.2.0

Makefile.in

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ parse.h: parse.c
10891089

10901090
parse.c: $(TOP)/src/parse.y lemon$(BEXE)
10911091
cp $(TOP)/src/parse.y .
1092-
./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
1092+
./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) -S parse.y
10931093

10941094
sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION
10951095
$(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
@@ -1214,10 +1214,10 @@ FTS5_SRC = \
12141214
$(TOP)/ext/fts5/fts5_varint.c \
12151215
$(TOP)/ext/fts5/fts5_vocab.c \
12161216

1217-
fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon
1217+
fts5parse.c: $(TOP)/ext/fts5/fts5parse.y lemon$(BEXE)
12181218
cp $(TOP)/ext/fts5/fts5parse.y .
12191219
rm -f fts5parse.h
1220-
./lemon$(BEXE) $(OPTS) fts5parse.y
1220+
./lemon$(BEXE) $(OPTS) -S fts5parse.y
12211221

12221222
fts5parse.h: fts5parse.c
12231223

@@ -1279,10 +1279,6 @@ fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuz
12791279
./fuzzcheck$(TEXE) $(FUZZDATA)
12801280
./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
12811281

1282-
fastfuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
1283-
./fuzzcheck$(TEXE) --limit-mem 100M $(FUZZDATA)
1284-
./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
1285-
12861282
valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
12871283
valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
12881284
valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
@@ -1300,7 +1296,7 @@ quicktest: ./testfixture$(TEXE)
13001296
# This is the common case. Run many tests that do not take too long,
13011297
# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
13021298
#
1303-
test: fastfuzztest sourcetest $(TESTPROGS) tcltest
1299+
test: fuzztest sourcetest $(TESTPROGS) tcltest
13041300

13051301
# Run a test using valgrind. This can take a really long time
13061302
# because valgrind is so much slower than a native machine.

Makefile.msc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ OPTIMIZATIONS = 2
248248
SESSION = 0
249249
!ENDIF
250250

251+
# Set this to non-0 to enable support for the rbu extension.
252+
#
253+
!IFNDEF RBU
254+
RBU = 0
255+
!ENDIF
256+
251257
# Set the source code file to be used by executables and libraries when
252258
# they need the amalgamation.
253259
#
@@ -364,6 +370,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
364370
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
365371
!ENDIF
366372

373+
# Should the rbu extension be enabled? If so, add compilation options
374+
# to enable it.
375+
#
376+
!IF $(RBU)!=0
377+
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
378+
!ENDIF
379+
367380
# These are the "extended" SQLite compilation options used when compiling for
368381
# the Windows 10 platform.
369382
#
@@ -1750,7 +1763,7 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
17501763
sqlite3.def: libsqlite3.lib
17511764
echo EXPORTS > sqlite3.def
17521765
dumpbin /all libsqlite3.lib \
1753-
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@]*)(?:@\d+)?$$" \1 \
1766+
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
17541767
| sort >> sqlite3.def
17551768
# <</block2>>
17561769

@@ -2149,7 +2162,7 @@ parse.h: parse.c
21492162
parse.c: $(TOP)\src\parse.y lemon.exe
21502163
del /Q parse.y parse.h parse.h.temp 2>NUL
21512164
copy $(TOP)\src\parse.y .
2152-
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
2165+
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S parse.y
21532166

21542167
$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION
21552168
$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
@@ -2309,7 +2322,7 @@ LSM1_SRC = \
23092322
fts5parse.c: $(TOP)\ext\fts5\fts5parse.y lemon.exe
23102323
copy $(TOP)\ext\fts5\fts5parse.y .
23112324
del /Q fts5parse.h 2>NUL
2312-
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) fts5parse.y
2325+
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) -S fts5parse.y
23132326

23142327
fts5parse.h: fts5parse.c
23152328

@@ -2412,9 +2425,6 @@ queryplantest: testfixture.exe shell
24122425
fuzztest: fuzzcheck.exe
24132426
.\fuzzcheck.exe $(FUZZDATA)
24142427

2415-
fastfuzztest: fuzzcheck.exe
2416-
.\fuzzcheck.exe --limit-mem 100M $(FUZZDATA)
2417-
24182428
# Minimal testing that runs in less than 3 minutes (on a fast machine)
24192429
#
24202430
quicktest: testfixture.exe sourcetest
@@ -2424,7 +2434,7 @@ quicktest: testfixture.exe sourcetest
24242434
# This is the common case. Run many tests that do not take too long,
24252435
# including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
24262436
#
2427-
test: $(TESTPROGS) sourcetest fastfuzztest
2437+
test: $(TESTPROGS) sourcetest fuzztest
24282438
@set PATH=$(LIBTCLPATH);$(PATH)
24292439
.\testfixture.exe $(TOP)\test\veryquick.test $(TESTOPTS)
24302440

README.md

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
## SQLCipher
22

3-
SQLCipher extends the [SQLite](https://www.sqlite.org) database library to add security enhancements that make it more suitable for encrypted local data storage such as on-the-fly encryption, tamper evidence, and key derivation. Based on SQLite, SQLCipher closely tracks SQLite and periodically integrates stable SQLite release features.
3+
SQLCipher extends the [SQLite](https://www.sqlite.org) database library to add security enhancements that make it more suitable for encrypted local data storage like:
4+
5+
- on-the-fly encryption
6+
- tamper detection
7+
- memory sanitization
8+
- strong key derivation
9+
10+
SQLCipher is based on SQLite and stable upstream release features are periodically integrated.
411

512
SQLCipher is maintained by Zetetic, LLC, and additional information and documentation is available on the official [SQLCipher site](https://www.zetetic.net/sqlcipher/).
613

@@ -21,33 +28,51 @@ SQLCipher is also compatible with standard SQLite databases. When a key is not p
2128

2229
## Contributions
2330

24-
The SQLCipher team welcomes contributions to the core library. All contributions including pull requests and patches should be based on the `prerelease` branch, and must be accompanied by a [contributor agreement](https://www.zetetic.net/contributions/). For large changes we strongly encourage [discussion](https://discuss.zetetic.net/c/sqlcipher) of the proposed change prior to development and submission.
31+
The SQLCipher team welcomes contributions to the core library. All contributions including pull requests and patches should be based on the `prerelease` branch, and must be accompanied by a [contributor agreement](https://www.zetetic.net/contributions/). We strongly encourage [discussion](https://discuss.zetetic.net/c/sqlcipher) of the proposed change prior to development and submission.
2532

2633
## Compiling
2734

28-
Building SQLCipher is almost the same as compiling a regular version of
29-
SQLite with two small exceptions:
35+
Building SQLCipher is similar to compiling a regular version of SQLite from source a couple small exceptions:
3036

31-
1. You *must* define `SQLITE_HAS_CODEC` and `SQLITE_TEMP_STORE=2` when building sqlcipher.
32-
2. If compiling against the default OpenSSL crypto provider, you will need to link libcrypto
37+
1. You *must* define `SQLITE_HAS_CODEC` and either `SQLITE_TEMP_STORE=2` or SQLITE_TEMP_STORE=3`
38+
2. You will need to link against a support cryptograpic provider (OpenSSL, LibTomCrypt, CommonCrypto/Security.framework, or NSS)
3339

34-
Example Static linking (replace /opt/local/lib with the path to libcrypto.a). Note in this
40+
The following examples demonstrate linking against OpenSSL, which is a readily available provider on most Unix-like systems.
41+
42+
Example 1. Static linking (replace /opt/local/lib with the path to libcrypto.a). Note in this
3543
example, `--enable-tempstore=yes` is setting `SQLITE_TEMP_STORE=2` for the build.
3644

45+
```
3746
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
3847
LDFLAGS="/opt/local/lib/libcrypto.a"
3948
$ make
49+
```
4050

41-
Example Dynamic linking
51+
Example 2. Dynamic linking
4252

53+
```
4354
$ ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \
4455
LDFLAGS="-lcrypto"
4556
$ make
57+
```
58+
59+
## Testing
60+
61+
The full SQLite test suite will not complete successfully when using SQLCipher. In some cases encryption interferes with low-level tests that require access to database file data or features which are unsupported by SQLCipher. Those tests that are intended to support encryption are intended for non-SQLCipher implementations. In addition, because SQLite tests are not always isolated, if one test fails it can trigger a domino effect with other failures in later steps.
62+
63+
As a result, the SQLCipher package includes it's own independent tests that exercise and verify the core functionality of the SQLCipher extensions. This test suite is intended to provide an abbreviated verification of SQLCipher's internal logic; it does not perform an exhaustive test of the SQLite database system as a whole or verify functionality on specific platforms. Because SQLCipher is based on stable upstream builds of SQLite, it is consider a basic assumption that the core SQLite library code is operating properly (the SQLite core is almost untouched in SQLCipher). Thus, the additional SQLCipher-specific test provide the requisite verification that the library is operating as expected with SQLCipher's security features enabled.
64+
65+
To run SQLCipher specific tests, configure as described above and run the following to execute the tests and recieve a report of the results:
66+
67+
```
68+
$ make testfixture
69+
$ ./testfixture test/sqlcipher.test
70+
```
4671

4772
## Encrypting a database
4873

4974
To specify an encryption passphrase for the database via the SQL interface you
50-
use a pragma. The passphrase you enter is passed through PBKDF2 key derivation to
75+
use a PRAGMA. The passphrase you enter is passed through PBKDF2 key derivation to
5176
obtain the encryption key for the database
5277

5378
PRAGMA key = 'passphrase';
@@ -69,7 +94,7 @@ same rules as `PRAGMA key`.
6994

7095
## Changing a database key
7196

72-
To change the encryption passphrase for an existing database you may use the rekey pragma
97+
To change the encryption passphrase for an existing database you may use the rekey PRAGMA
7398
after you've supplied the correct database password;
7499

75100
PRAGMA key = 'passphrase'; -- start with the existing database passphrase
@@ -85,6 +110,10 @@ This can be accomplished programmatically by using sqlite3_rekey;
85110

86111
## Support
87112

113+
The primary source for complete documentation (desing, API, platforms, usage) is the SQLCipher website:
114+
115+
https://www.zetetic.net/sqlcipher/documentation
116+
88117
The primary avenue for support and discussions is the SQLCipher discuss site:
89118

90119
https://discuss.zetetic.net/c/sqlcipher
@@ -100,9 +129,9 @@ posts about SQLCipher as we do not monitor them frequently.
100129
If you are using SQLCipher in your own software please let us know at
101130
102131

103-
## License
132+
## Community Edition Open Source License
104133

105-
Copyright (c) 2016, ZETETIC LLC
134+
Copyright (c) 2020, ZETETIC LLC
106135
All rights reserved.
107136

108137
Redistribution and use in source and binary forms, with or without

SQLCipher.podspec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"requires_arc": false,
1616
"source": {
1717
"git": "https://github.com/sqlcipher/sqlcipher.git",
18-
"tag": "v4.3.0"
18+
"tag": "v4.4.0"
1919
},
2020
"summary": "Full Database Encryption for SQLite.",
21-
"version": "4.3.0",
21+
"version": "4.4.0",
2222
"subspecs": [
2323
{
2424
"compiler_flags": [

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.30.1
1+
3.31.0

autoconf/Makefile.msc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ OPTIMIZATIONS = 2
210210
SESSION = 0
211211
!ENDIF
212212

213+
# Set this to non-0 to enable support for the rbu extension.
214+
#
215+
!IFNDEF RBU
216+
RBU = 0
217+
!ENDIF
218+
213219
# Set the source code file to be used by executables and libraries when
214220
# they need the amalgamation.
215221
#
@@ -282,7 +288,6 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1
282288
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1
283289
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1
284290
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1
285-
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1
286291
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1
287292
!ENDIF
288293
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1
@@ -296,6 +301,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
296301
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
297302
!ENDIF
298303

304+
# Should the rbu extension be enabled? If so, add compilation options
305+
# to enable it.
306+
#
307+
!IF $(RBU)!=0
308+
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
309+
!ENDIF
310+
299311
# These are the "extended" SQLite compilation options used when compiling for
300312
# the Windows 10 platform.
301313
#
@@ -978,7 +990,7 @@ Replace.exe:
978990
sqlite3.def: Replace.exe $(LIBOBJ)
979991
echo EXPORTS > sqlite3.def
980992
dumpbin /all $(LIBOBJ) \
981-
| .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
993+
| .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \
982994
| sort >> sqlite3.def
983995

984996
$(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H)

autoconf/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING(
161161
[--enable-rtree], [include rtree support [default=yes]])],
162162
[], [enable_rtree=yes])
163163
if test x"$enable_rtree" = "xyes"; then
164-
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE"
164+
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY"
165165
fi
166166
#-----------------------------------------------------------------------
167167

autoconf/tea/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
1919
# so you can encode the package version directly into the source files.
2020
#-----------------------------------------------------------------------
2121

22-
AC_INIT([sqlite], [3.7.4])
22+
AC_INIT([sqlite], [3.31.0])
2323

2424
#--------------------------------------------------------------------
2525
# Call TEA_INIT as the first TEA_ macro to set up initial vars.

0 commit comments

Comments
 (0)