From 7531bed02224d524bf77bc9f8eb6db3426a6a051 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Sat, 19 Feb 2011 14:57:11 -0500 Subject: [PATCH] allow HMAC behavior override via DEFAULT_USE_HMAC --- src/crypto.c | 2 +- src/crypto.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crypto.c b/src/crypto.c index 416c750..e207326 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -613,7 +613,7 @@ int sqlite3CodecAttach(sqlite3* db, int nDb, const void *zKey, int nKey) { /* Use HMAC signatures by default. Note that codec_set_use_hmac will implicity call codec_set_page_size to set the default */ - if((rc = codec_set_use_hmac(db, nDb, 1)) != SQLITE_OK) return rc; + if((rc = codec_set_use_hmac(db, nDb, DEFAULT_USE_HMAC)) != SQLITE_OK) return rc; cipher_ctx_copy(ctx->write_ctx, ctx->read_ctx); diff --git a/src/crypto.h b/src/crypto.h index e5d855f..b9f7d22 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -48,6 +48,10 @@ #define PBKDF2_ITER 4000 #endif +#ifndef DEFAULT_USE_HMAC +#define DEFAULT_USE_HMAC 1 +#endif + void sqlite3pager_get_codec(Pager *pPager, void **ctx); int sqlite3pager_is_mj_pgno(Pager *pPager, Pgno pgno); sqlite3_file *sqlite3Pager_get_fd(Pager *pPager);