From 64f5c4e54a475f5aaa73fa1962f9b59697196433 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Wed, 17 Jul 2024 14:56:32 -0400 Subject: [PATCH] Relocates and defines extension hooks --- src/sqlcipher.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/sqlcipher.c b/src/sqlcipher.c index b7564b8b..295c0555 100644 --- a/src/sqlcipher.c +++ b/src/sqlcipher.c @@ -242,6 +242,11 @@ static int sqlcipher_get_test_fail() { } #endif +#ifdef SQLCIPHER_EXT +int sqlcipher_ext_provider_setup(sqlcipher_provider *); +void sqlcipher_ext_provider_destroy(); +#endif + static volatile unsigned int default_flags = DEFAULT_CIPHER_FLAGS; static volatile unsigned char hmac_salt_mask = HMAC_SALT_MASK; static volatile int default_kdf_iter = PBKDF2_ITER; @@ -488,6 +493,9 @@ static void sqlcipher_activate() { #elif defined (SQLCIPHER_CRYPTO_OPENSSL) extern int sqlcipher_openssl_setup(sqlcipher_provider *p); sqlcipher_openssl_setup(p); +#elif defined (SQLCIPHER_CRYPTO_OSSL3) + extern int sqlcipher_ossl3_setup(sqlcipher_provider *p); + sqlcipher_ossl3_setup(p); #else #error "NO DEFAULT SQLCIPHER CRYPTO PROVIDER DEFINED" #endif @@ -1922,10 +1930,6 @@ static int sqlcipher_set_log(const char *destination){ #endif } -#ifdef SQLCIPHER_EXT -#include "sqlcipher_ext.h" -#endif - static void sqlcipher_vdbe_return_string(Parse *pParse, const char *zLabel, const char *value, int value_type){ Vdbe *v = sqlite3GetVdbe(pParse); sqlite3VdbeSetNumCols(v, 1); @@ -1934,6 +1938,10 @@ static void sqlcipher_vdbe_return_string(Parse *pParse, const char *zLabel, cons sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); } +#ifdef SQLCIPHER_EXT +#include "sqlcipher_ext.h" +#endif + static int codec_set_btree_to_codec_pagesize(sqlite3 *db, Db *pDb, codec_ctx *ctx) { int rc; -- 2.11.4.GIT