aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2016-11-08 10:31:20 +0100
committerAndreas Schneider <asn@cryptomilk.org>2016-11-08 10:31:20 +0100
commit2f6a8663731668649499142460f648c687c0f5d3 (patch)
tree22db0dd2f3c7c97f5977ce596c008122ec88f7aa /src
parentf8ef200e7653f1124961659733a9f5d030351d93 (diff)
downloadlibssh-2f6a8663731668649499142460f648c687c0f5d3.tar.gz
libssh-2f6a8663731668649499142460f648c687c0f5d3.tar.xz
libssh-2f6a8663731668649499142460f648c687c0f5d3.zip
cmake: Only build libcrypto and libcrypto-compat when needed
This also fixes the gcrypt build. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt6
-rw-r--r--src/libcrypto-compat.c7
2 files changed, 4 insertions, 9 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3c22dfac..e5a93538 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -125,8 +125,6 @@ set(libssh_SRCS
kex.c
known_hosts.c
legacy.c
- libcrypto.c
- libcrypto-compat.c
log.c
match.c
messages.c
@@ -167,7 +165,11 @@ else (WITH_GCRYPT)
${libssh_SRCS}
pki_crypto.c
ecdh_crypto.c
+ libcrypto.c
)
+ if(OPENSSL_VERSION VERSION_LESS "1.1.0")
+ set(libssh_SRCS ${libssh_SRCS} libcrypto-compat.c)
+ endif()
endif (WITH_GCRYPT)
if (WITH_SFTP)
diff --git a/src/libcrypto-compat.c b/src/libcrypto-compat.c
index 1f27dd5f..e0c95ff2 100644
--- a/src/libcrypto-compat.c
+++ b/src/libcrypto-compat.c
@@ -7,9 +7,6 @@
* https://www.openssl.org/source/license.html
*/
-#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-
#include <string.h>
#include <openssl/engine.h>
#include "libcrypto-compat.h"
@@ -329,7 +326,3 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx)
EVP_CIPHER_CTX_init(ctx);
OPENSSL_free(ctx);
}
-
-#else
-typedef int iso_c_forbids_an_empty_source_file;
-#endif /* OPENSSL_VERSION_NUMBER */