From 320640d8700314c66155125e1bf2d8e9a7ef17e8 Mon Sep 17 00:00:00 2001 From: Nick Parker Date: Fri, 29 Sep 2017 11:28:05 -0500 Subject: [PATCH] Remove static modifier from codec password storage functions --- src/crypto.h | 7 +++---- src/crypto_impl.c | 12 ++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/crypto.h b/src/crypto.h index 7beee0e..5e46e67 100644 --- a/src/crypto.h +++ b/src/crypto.h @@ -252,10 +252,9 @@ const char* sqlcipher_codec_get_cipher_provider(codec_ctx *ctx); int sqlcipher_codec_ctx_migrate(codec_ctx *ctx); int sqlcipher_codec_add_random(codec_ctx *ctx, const char *data, int random_sz); int sqlcipher_cipher_profile(sqlite3 *db, const char *destination); -static void sqlcipher_profile_callback(void *file, const char *sql, sqlite3_uint64 run_time); -static int sqlcipher_codec_get_store_pass(codec_ctx *ctx); -static void sqlcipher_codec_get_pass(codec_ctx *ctx, void **zKey, int *nKey); -static void sqlcipher_codec_set_store_pass(codec_ctx *ctx, int value); +int sqlcipher_codec_get_store_pass(codec_ctx *ctx); +void sqlcipher_codec_get_pass(codec_ctx *ctx, void **zKey, int *nKey); +void sqlcipher_codec_set_store_pass(codec_ctx *ctx, int value); int sqlcipher_codec_fips_status(codec_ctx *ctx); const char* sqlcipher_codec_get_provider_version(codec_ctx *ctx); int sqlcipher_codec_hmac(const codec_ctx *ctx, const unsigned char *hmac_key, int key_sz, diff --git a/src/crypto_impl.c b/src/crypto_impl.c index faef1f3..1fd35ba 100644 --- a/src/crypto_impl.c +++ b/src/crypto_impl.c @@ -1309,6 +1309,12 @@ int sqlcipher_codec_add_random(codec_ctx *ctx, const char *zRight, int random_sz return SQLITE_ERROR; } +static void sqlcipher_profile_callback(void *file, const char *sql, sqlite3_uint64 run_time){ + FILE *f = (FILE*)file; + double elapsed = run_time/1000000.0; + if(f) fprintf(f, "Elapsed time:%.3f ms - %s\n", elapsed, sql); +} + int sqlcipher_cipher_profile(sqlite3 *db, const char *destination){ #if defined(SQLITE_OMIT_TRACE) || defined(SQLITE_OMIT_DEPRECATED) return SQLITE_ERROR; @@ -1336,12 +1342,6 @@ int sqlcipher_cipher_profile(sqlite3 *db, const char *destination){ #endif } -static void sqlcipher_profile_callback(void *file, const char *sql, sqlite3_uint64 run_time){ - FILE *f = (FILE*)file; - double elapsed = run_time/1000000.0; - if(f) fprintf(f, "Elapsed time:%.3f ms - %s\n", elapsed, sql); -} - int sqlcipher_codec_fips_status(codec_ctx *ctx) { return ctx->read_ctx->provider->fips_status(ctx->read_ctx); }