Skip to content

Commit 0d5220a

Browse files
committed
namespace changes and fixes for non-amalgamated builds
1 parent 6ea9c79 commit 0d5220a

File tree

10 files changed

+65
-67
lines changed

10 files changed

+65
-67
lines changed

src/attach.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ static void attachFunc(
201201
/* BEGIN SQLCIPHER */
202202
#ifdef SQLITE_HAS_CODEC
203203
if( rc==SQLITE_OK ){
204-
extern int sqlite3CodecAttach(sqlite3*, int, const void*, int);
205-
extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
204+
extern int sqlcipherCodecAttach(sqlite3*, int, const void*, int);
205+
extern void sqlcipherCodecGetKey(sqlite3*, int, void**, int*);
206206
int nKey;
207207
char *zKey;
208208
int t = sqlite3_value_type(argv[2]);
@@ -217,16 +217,16 @@ static void attachFunc(
217217
case SQLITE_BLOB:
218218
nKey = sqlite3_value_bytes(argv[2]);
219219
zKey = (char *)sqlite3_value_blob(argv[2]);
220-
rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
220+
rc = sqlcipherCodecAttach(db, db->nDb-1, zKey, nKey);
221221
break;
222222

223223
case SQLITE_NULL:
224224
/* No key specified. Use the key from URI filename, or if none,
225225
** use the key from the main database. */
226226
if( sqlite3CodecQueryParameters(db, zName, zPath)==0 ){
227-
sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
227+
sqlcipherCodecGetKey(db, 0, (void**)&zKey, &nKey);
228228
if( nKey || sqlite3BtreeGetRequestedReserve(db->aDb[0].pBt)>0 ){
229-
rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
229+
rc = sqlcipherCodecAttach(db, db->nDb-1, zKey, nKey);
230230
}
231231
}
232232
break;

src/backup.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ sqlite3_backup *sqlite3_backup_init(
157157
#ifdef SQLITE_HAS_CODEC
158158
{
159159
extern int sqlcipher_find_db_index(sqlite3*, const char*);
160-
extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
160+
extern void sqlcipherCodecGetKey(sqlite3*, int, void**, int*);
161161
int srcNKey, destNKey;
162162
void *zKey;
163163

164-
sqlite3CodecGetKey(pSrcDb, sqlcipher_find_db_index(pSrcDb, zSrcDb), &zKey, &srcNKey);
165-
sqlite3CodecGetKey(pDestDb, sqlcipher_find_db_index(pDestDb, zDestDb), &zKey, &destNKey);
164+
sqlcipherCodecGetKey(pSrcDb, sqlcipher_find_db_index(pSrcDb, zSrcDb), &zKey, &srcNKey);
165+
sqlcipherCodecGetKey(pDestDb, sqlcipher_find_db_index(pDestDb, zDestDb), &zKey, &destNKey);
166166
zKey = NULL;
167167

168168
/* either both databases must be plaintext, or both must be encrypted */
@@ -258,6 +258,7 @@ static int backupOnePage(
258258
const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz;
259259
/* BEGIN SQLCIPHER */
260260
#ifdef SQLITE_HAS_CODEC
261+
extern void *sqlcipherPagerGetCodec(Pager*);
261262
/* Use BtreeGetReserveNoMutex() for the source b-tree, as although it is
262263
** guaranteed that the shared-mutex is held by this thread, handle
263264
** p->pSrc may not actually be the owner. */
@@ -286,7 +287,7 @@ static int backupOnePage(
286287
/* Backup is not possible if the page size of the destination is changing
287288
** and a codec is in use.
288289
*/
289-
if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){
290+
if( nSrcPgsz!=nDestPgsz && sqlcipherPagerGetCodec(pDestPager)!=0 ){
290291
rc = SQLITE_READONLY;
291292
}
292293

src/crypto.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int codec_set_pass_key(sqlite3* db, int nDb, const void *zKey, int nKey,
7878
struct Db *pDb = &db->aDb[nDb];
7979
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "codec_set_pass_key: db=%p nDb=%d for_ctx=%d", db, nDb, for_ctx);
8080
if(pDb->pBt) {
81-
codec_ctx *ctx = (codec_ctx*) sqlite3PagerGetCodec(pDb->pBt->pBt->pPager);
81+
codec_ctx *ctx = (codec_ctx*) sqlcipherPagerGetCodec(pDb->pBt->pBt->pPager);
8282

8383
if(ctx) {
8484
return sqlcipher_codec_ctx_set_pass(ctx, zKey, nKey, for_ctx);
@@ -97,7 +97,7 @@ int sqlcipher_codec_pragma(sqlite3* db, int iDb, Parse *pParse, const char *zLef
9797
int rc;
9898

9999
if(pDb->pBt) {
100-
ctx = (codec_ctx*) sqlite3PagerGetCodec(pDb->pBt->pBt->pPager);
100+
ctx = (codec_ctx*) sqlcipherPagerGetCodec(pDb->pBt->pBt->pPager);
101101
}
102102

103103
if(sqlite3_stricmp(zLeft, "key") !=0 && sqlite3_stricmp(zLeft, "rekey") != 0) {
@@ -822,10 +822,10 @@ static void sqlite3FreeCodecArg(void *pCodecArg) {
822822
sqlcipher_deactivate(); /* cleanup related structures, OpenSSL etc, when codec is detatched */
823823
}
824824

825-
int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
825+
int sqlcipherCodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
826826
struct Db *pDb = &db->aDb[nDb];
827827

828-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: db=%p, nDb=%d", db, nDb);
828+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: db=%p, nDb=%d", db, nDb);
829829

830830
if(nKey && zKey && pDb->pBt) {
831831
int rc;
@@ -836,12 +836,12 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
836836
/* check if the sqlite3_file is open, and if not force handle to NULL */
837837
if((fd = sqlite3PagerFile(pPager))->pMethods == 0) fd = NULL;
838838

839-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: calling sqlcipher_activate()");
839+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: calling sqlcipher_activate()");
840840
sqlcipher_activate(); /* perform internal initialization for sqlcipher */
841841

842-
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlite3CodecAttach: entering database mutex %p", db->mutex);
842+
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipherCodecAttach: entering database mutex %p", db->mutex);
843843
sqlite3_mutex_enter(db->mutex);
844-
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlite3CodecAttach: entered database mutex %p", db->mutex);
844+
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipherCodecAttach: entered database mutex %p", db->mutex);
845845

846846
#ifdef SQLCIPHER_EXT
847847
if((rc = sqlite3_set_authorizer(db, sqlcipher_license_authorizer, db)) != SQLITE_OK) {
@@ -851,44 +851,44 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) {
851851
#endif
852852

853853
/* point the internal codec argument against the contet to be prepared */
854-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: calling sqlcipher_codec_ctx_init()");
854+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: calling sqlcipher_codec_ctx_init()");
855855
rc = sqlcipher_codec_ctx_init(&ctx, pDb, pDb->pBt->pBt->pPager, zKey, nKey);
856856

857857
if(rc != SQLITE_OK) {
858858
/* initialization failed, do not attach potentially corrupted context */
859-
sqlcipher_log(SQLCIPHER_LOG_ERROR, "sqlite3CodecAttach: context initialization failed forcing error state with rc=%d", rc);
859+
sqlcipher_log(SQLCIPHER_LOG_ERROR, "sqlcipherCodecAttach: context initialization failed forcing error state with rc=%d", rc);
860860
/* force an error at the pager level, such that even the upstream caller ignores the return code
861861
the pager will be in an error state and will process no further operations */
862862
sqlite3pager_error(pPager, rc);
863863
pDb->pBt->pBt->db->errCode = rc;
864-
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlite3CodecAttach: leaving database mutex %p (early return on rc=%d)", db->mutex, rc);
864+
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipherCodecAttach: leaving database mutex %p (early return on rc=%d)", db->mutex, rc);
865865
sqlite3_mutex_leave(db->mutex);
866-
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlite3CodecAttach: left database mutex %p (early return on rc=%d)", db->mutex, rc);
866+
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipherCodecAttach: left database mutex %p (early return on rc=%d)", db->mutex, rc);
867867
return rc;
868868
}
869869

870-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: calling sqlite3PagerSetCodec()");
871-
sqlite3PagerSetCodec(sqlite3BtreePager(pDb->pBt), sqlite3Codec, NULL, sqlite3FreeCodecArg, (void *) ctx);
870+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: calling sqlcipherPagerSetCodec()");
871+
sqlcipherPagerSetCodec(sqlite3BtreePager(pDb->pBt), sqlite3Codec, NULL, sqlite3FreeCodecArg, (void *) ctx);
872872

873-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: calling codec_set_btree_to_codec_pagesize()");
873+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: calling codec_set_btree_to_codec_pagesize()");
874874
codec_set_btree_to_codec_pagesize(db, pDb, ctx);
875875

876876
/* force secure delete. This has the benefit of wiping internal data when deleted
877877
and also ensures that all pages are written to disk (i.e. not skipped by
878878
sqlite3PagerDontWrite optimizations) */
879-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: calling sqlite3BtreeSecureDelete()");
879+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: calling sqlite3BtreeSecureDelete()");
880880
sqlite3BtreeSecureDelete(pDb->pBt, 1);
881881

882882
/* if fd is null, then this is an in-memory database and
883883
we dont' want to overwrite the AutoVacuum settings
884884
if not null, then set to the default */
885885
if(fd != NULL) {
886-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecAttach: calling sqlite3BtreeSetAutoVacuum()");
886+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecAttach: calling sqlite3BtreeSetAutoVacuum()");
887887
sqlite3BtreeSetAutoVacuum(pDb->pBt, SQLITE_DEFAULT_AUTOVACUUM);
888888
}
889-
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlite3CodecAttach: leaving database mutex %p", db->mutex);
889+
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipherCodecAttach: leaving database mutex %p", db->mutex);
890890
sqlite3_mutex_leave(db->mutex);
891-
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlite3CodecAttach: left database mutex %p", db->mutex);
891+
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipherCodecAttach: left database mutex %p", db->mutex);
892892
}
893893
return SQLITE_OK;
894894
}
@@ -921,7 +921,7 @@ int sqlite3_key_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
921921
/* attach key if db and pKey are not null and nKey is > 0 */
922922
if(db && pKey && nKey) {
923923
int db_index = sqlcipher_find_db_index(db, zDb);
924-
return sqlite3CodecAttach(db, db_index, pKey, nKey);
924+
return sqlcipherCodecAttach(db, db_index, pKey, nKey);
925925
}
926926
sqlcipher_log(SQLCIPHER_LOG_ERROR, "sqlite3_key_v2: no key provided");
927927
return SQLITE_ERROR;
@@ -955,7 +955,7 @@ int sqlite3_rekey_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
955955
PgHdr *page;
956956
Pager *pPager = pDb->pBt->pBt->pPager;
957957

958-
ctx = (codec_ctx*) sqlite3PagerGetCodec(pDb->pBt->pBt->pPager);
958+
ctx = (codec_ctx*) sqlcipherPagerGetCodec(pDb->pBt->pBt->pPager);
959959

960960
if(ctx == NULL) {
961961
/* there was no codec attached to this database, so this should do nothing! */
@@ -1013,11 +1013,11 @@ int sqlite3_rekey_v2(sqlite3 *db, const char *zDb, const void *pKey, int nKey) {
10131013
return SQLITE_ERROR;
10141014
}
10151015

1016-
void sqlite3CodecGetKey(sqlite3* db, int nDb, void **zKey, int *nKey) {
1016+
void sqlcipherCodecGetKey(sqlite3* db, int nDb, void **zKey, int *nKey) {
10171017
struct Db *pDb = &db->aDb[nDb];
1018-
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlite3CodecGetKey:db=%p, nDb=%d", db, nDb);
1018+
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "sqlcipherCodecGetKey:db=%p, nDb=%d", db, nDb);
10191019
if( pDb->pBt ) {
1020-
codec_ctx *ctx = (codec_ctx*) sqlite3PagerGetCodec(pDb->pBt->pBt->pPager);
1020+
codec_ctx *ctx = (codec_ctx*) sqlcipherPagerGetCodec(pDb->pBt->pBt->pPager);
10211021

10221022
if(ctx) {
10231023
/* pass back the keyspec from the codec, unless PRAGMA cipher_store_pass

src/crypto.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@
6161
#endif
6262
#endif
6363

64+
#include "sqlcipher.h"
65+
6466
/* extensions defined in pager.c */
65-
void *sqlite3PagerGetCodec(Pager*);
66-
void sqlite3PagerSetCodec(Pager*, void *(*)(void*,void*,Pgno,int), void (*)(void*,int,int), void (*)(void*), void *);
67+
void *sqlcipherPagerGetCodec(Pager*);
68+
void sqlcipherPagerSetCodec(Pager*, void *(*)(void*,void*,Pgno,int), void (*)(void*,int,int), void (*)(void*), void *);
6769
int sqlite3pager_is_mj_pgno(Pager*, Pgno);
6870
void sqlite3pager_error(Pager*, int);
6971
void sqlite3pager_reset(Pager *pPager);
@@ -227,8 +229,8 @@ typedef struct {
227229

228230
/* crypto.c functions */
229231
int sqlcipher_codec_pragma(sqlite3*, int, Parse*, const char *, const char*);
230-
int sqlite3CodecAttach(sqlite3*, int, const void *, int);
231-
void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
232+
int sqlcipherCodecAttach(sqlite3*, int, const void *, int);
233+
void sqlcipherCodecGetKey(sqlite3*, int, void**, int*);
232234
void sqlcipher_exportFunc(sqlite3_context *, int, sqlite3_value **);
233235

234236
/* crypto_impl.c functions */

src/crypto_impl.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ void sqlcipher_deactivate() {
287287
optimized out by the compiler.
288288
Note: As suggested by Joachim Schipper (joachim.schipper@fox-it.com)
289289
*/
290-
void* sqlcipher_memset(void *v, unsigned char value, u64 len) {
291-
u64 i = 0;
290+
void* sqlcipher_memset(void *v, unsigned char value, sqlite_uint64 len) {
291+
sqlite_uint64 i = 0;
292292
volatile unsigned char *a = v;
293293

294294
if (v == NULL) return v;
@@ -304,9 +304,9 @@ void* sqlcipher_memset(void *v, unsigned char value, u64 len) {
304304
/* constant time memory check tests every position of a memory segement
305305
matches a single value (i.e. the memory is all zeros)
306306
returns 0 if match, 1 of no match */
307-
int sqlcipher_ismemset(const void *v, unsigned char value, u64 len) {
307+
int sqlcipher_ismemset(const void *v, unsigned char value, sqlite_uint64 len) {
308308
const unsigned char *a = v;
309-
u64 i = 0, result = 0;
309+
sqlite_uint64 i = 0, result = 0;
310310

311311
for(i = 0; i < len; i++) {
312312
result |= a[i] ^ value;
@@ -328,7 +328,7 @@ int sqlcipher_memcmp(const void *v0, const void *v1, int len) {
328328
return (result != 0);
329329
}
330330

331-
void sqlcipher_mlock(void *ptr, u64 sz) {
331+
void sqlcipher_mlock(void *ptr, sqlite_uint64 sz) {
332332
#ifndef OMIT_MEMLOCK
333333
#if defined(__unix__) || defined(__APPLE__)
334334
int rc;
@@ -355,7 +355,7 @@ void sqlcipher_mlock(void *ptr, u64 sz) {
355355
#endif
356356
}
357357

358-
void sqlcipher_munlock(void *ptr, u64 sz) {
358+
void sqlcipher_munlock(void *ptr, sqlite_uint64 sz) {
359359
#ifndef OMIT_MEMLOCK
360360
#if defined(__unix__) || defined(__APPLE__)
361361
int rc;
@@ -390,7 +390,7 @@ void sqlcipher_munlock(void *ptr, u64 sz) {
390390
* If sz is > 0, and not compiled with OMIT_MEMLOCK, system will attempt to unlock the
391391
* memory segment so it can be paged
392392
*/
393-
void sqlcipher_free(void *ptr, u64 sz) {
393+
void sqlcipher_free(void *ptr, sqlite_uint64 sz) {
394394
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipher_free: calling sqlcipher_memset(%p,0,%llu)", ptr, sz);
395395
sqlcipher_memset(ptr, 0, sz);
396396
sqlcipher_munlock(ptr, sz);
@@ -402,7 +402,7 @@ void sqlcipher_free(void *ptr, u64 sz) {
402402
* reference counted and leak detection works. Unless compiled with OMIT_MEMLOCK
403403
* attempts to lock the memory pages so sensitive information won't be swapped
404404
*/
405-
void* sqlcipher_malloc(u64 sz) {
405+
void* sqlcipher_malloc(sqlite_uint64 sz) {
406406
void *ptr;
407407
sqlcipher_log(SQLCIPHER_LOG_TRACE, "sqlcipher_malloc: calling sqlite3Malloc(%llu)", sz);
408408
ptr = sqlite3Malloc(sz);
@@ -1538,8 +1538,8 @@ int sqlcipher_codec_ctx_migrate(codec_ctx *ctx) {
15381538
sqlcipher_log(SQLCIPHER_LOG_DEBUG, "set btree page size to %d res %d rc %d", default_page_size, nRes, rc);
15391539
if( rc!=SQLITE_OK ) goto handle_error;
15401540

1541-
sqlite3CodecGetKey(db, db->nDb - 1, (void**)&keyspec, &keyspec_sz);
1542-
sqlite3CodecAttach(db, 0, keyspec, keyspec_sz);
1541+
sqlcipherCodecGetKey(db, db->nDb - 1, (void**)&keyspec, &keyspec_sz);
1542+
sqlcipherCodecAttach(db, 0, keyspec, keyspec_sz);
15431543

15441544
srcfile = sqlite3PagerFile(pSrc->pBt->pPager);
15451545
destfile = sqlite3PagerFile(pDest->pBt->pPager);

src/pager.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7162,7 +7162,7 @@ const char *sqlite3PagerJournalname(Pager *pPager){
71627162
/*
71637163
** Set or retrieve the codec for this pager
71647164
*/
7165-
void sqlite3PagerSetCodec(
7165+
void sqlcipherPagerSetCodec(
71667166
Pager *pPager,
71677167
void *(*xCodec)(void*,void*,Pgno,int),
71687168
void (*xCodecSizeChng)(void*,int,int),
@@ -7181,7 +7181,7 @@ void sqlite3PagerSetCodec(
71817181
setGetterMethod(pPager);
71827182
pagerReportSize(pPager);
71837183
}
7184-
void *sqlite3PagerGetCodec(Pager *pPager){
7184+
void *sqlcipherPagerGetCodec(Pager *pPager){
71857185
return pPager->pCodec;
71867186
}
71877187

@@ -7192,18 +7192,11 @@ void *sqlite3PagerGetCodec(Pager *pPager){
71927192
** This function returns a pointer to a buffer containing the encrypted
71937193
** page content. If a malloc fails, this function may return NULL.
71947194
*/
7195-
void *sqlite3PagerCodec(PgHdr *pPg){
7195+
void *sqlcipherPagerCodec(PgHdr *pPg){
71967196
void *aData = 0;
71977197
CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData);
71987198
return aData;
71997199
}
7200-
7201-
/*
7202-
** Return the current pager state
7203-
*/
7204-
int sqlite3PagerState(Pager *pPager){
7205-
return pPager->eState;
7206-
}
72077200
#endif /* SQLITE_HAS_CODEC */
72087201
/* END SQLCIPHER */
72097202

src/pager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void sqlite3PagerRekey(DbPage*, Pgno, u16);
231231

232232
/* BEGIN SQLCIPHER */
233233
#if defined(SQLITE_HAS_CODEC) && !defined(SQLITE_OMIT_WAL)
234-
void *sqlite3PagerCodec(DbPage *);
234+
void *sqlcipherPagerCodec(DbPage *);
235235
#endif
236236
/* END SQLCIPHER */
237237

src/sqlcipher.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#ifndef SQLCIPHER_H
3636
#define SQLCIPHER_H
3737

38+
#include "sqlite3.h"
39+
3840
#define SQLCIPHER_HMAC_SHA1 0
3941
#define SQLCIPHER_HMAC_SHA1_LABEL "HMAC_SHA1"
4042
#define SQLCIPHER_HMAC_SHA256 1
@@ -72,13 +74,13 @@ typedef struct {
7274
} sqlcipher_provider;
7375

7476
/* utility functions */
75-
void* sqlcipher_malloc(u64);
76-
void sqlcipher_mlock(void *, u64);
77-
void sqlcipher_munlock(void *, u64);
78-
void* sqlcipher_memset(void *, unsigned char, u64);
79-
int sqlcipher_ismemset(const void *, unsigned char, u64);
77+
void* sqlcipher_malloc(sqlite_uint64);
78+
void sqlcipher_mlock(void *, sqlite_uint64);
79+
void sqlcipher_munlock(void *, sqlite_uint64);
80+
void* sqlcipher_memset(void *, unsigned char, sqlite_uint64);
81+
int sqlcipher_ismemset(const void *, unsigned char, sqlite_uint64);
8082
int sqlcipher_memcmp(const void *, const void *, int);
81-
void sqlcipher_free(void *, u64);
83+
void sqlcipher_free(void *, sqlite_uint64);
8284
char* sqlcipher_version();
8385

8486
/* provider interfaces */

src/vacuum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,10 @@ SQLITE_NOINLINE int sqlite3RunVacuum(
239239
/* BEGIN SQLCIPHER */
240240
#ifdef SQLITE_HAS_CODEC
241241
if( db->nextPagesize ){
242-
extern void sqlite3CodecGetKey(sqlite3*, int, void**, int*);
242+
extern void sqlcipherCodecGetKey(sqlite3*, int, void**, int*);
243243
int nKey;
244244
char *zKey;
245-
sqlite3CodecGetKey(db, iDb, (void**)&zKey, &nKey);
245+
sqlcipherCodecGetKey(db, iDb, (void**)&zKey, &nKey);
246246
if( nKey ) db->nextPagesize = 0;
247247
}
248248
#endif

0 commit comments

Comments
 (0)