Skip to content

Commit 57ea352

Browse files
committed
correct compliation under openssl 1.1.x
1 parent be947c1 commit 57ea352

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/crypto_openssl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static unsigned int openssl_external_init = 0;
4747
static unsigned int openssl_init_count = 0;
4848
static sqlite3_mutex* openssl_rand_mutex = NULL;
4949

50-
#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x20700000L
50+
#if (defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
5151
static HMAC_CTX *HMAC_CTX_new(void)
5252
{
5353
HMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
@@ -120,7 +120,7 @@ static int sqlcipher_openssl_activate(void *ctx) {
120120

121121
if(openssl_init_count == 0 && openssl_external_init == 0) {
122122
/* if the library was not externally initialized, then should be now */
123-
#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x20700000L
123+
#if (defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
124124
OpenSSL_add_all_algorithms();
125125
#endif
126126
}
@@ -157,7 +157,7 @@ static int sqlcipher_openssl_deactivate(void *ctx) {
157157
Note: this code will only be reached if OpensSSL_add_all_algorithms()
158158
is called by SQLCipher internally. This should prevent SQLCipher from
159159
"cleaning up" openssl when it was initialized externally by the program */
160-
#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x20700000L
160+
#if (defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L) || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
161161
EVP_cleanup();
162162
#endif
163163
} else {

0 commit comments

Comments
 (0)