8000 Guard OpenSSL init and cleanup routines on versions less than 1.1.0 · githubzhaoliang/sqlcipher@1c495b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1c495b9

Browse files
Guard OpenSSL init and cleanup routines on versions less than 1.1.0
1 parent df092f0 commit 1c495b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/crypto_openssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ static int sqlcipher_openssl_activate(void *ctx) {
110110

111111
if(openssl_init_count == 0 && openssl_external_init == 0) {
112112
/* if the library was not externally initialized, then should be now */
113+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
113114
OpenSSL_add_all_algorithms();
115+
#endif
114116
}
115117

116118
#ifndef SQLCIPHER_OPENSSL_NO_MUTEX_RAND
@@ -139,7 +141,9 @@ static int sqlcipher_openssl_deactivate(void *ctx) {
139141
Note: this code will only be reached if OpensSSL_add_all_algorithms()
140142
is called by SQLCipher internally. This should prevent SQLCipher from
141143
"cleaning up" openssl when it was initialized externally by the program */
144+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
142145
EVP_cleanup();
146+
#endif
143147
} else {
144148
openssl_external_init = 0;
145149
}

0 commit comments

Comments
 (0)
0