summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2018-06-29 12:30:17 +0200
committerChristian Beier <dontmind@freeshell.org>2018-06-29 12:30:17 +0200
commit85fb69515cf1739bea53ce62b832a17e08ab3647 (patch)
tree0b4bb1faf2f1ae9d0ed67d36cf119a1b50f7475e
parent161e7cab026dd89dacd85208b74834cc4c509f72 (diff)
downloadlibtdevnc-85fb69515cf1739bea53ce62b832a17e08ab3647.tar.gz
libtdevnc-85fb69515cf1739bea53ce62b832a17e08ab3647.zip
crypto: move to common
As of now, only LibVNCServer makes uses of these digest functions _and_ they depend on sys/uio.h, but in the future LibVNCClient will need those as well.
-rw-r--r--CMakeLists.txt29
-rw-r--r--common/rfbcrypto.h (renamed from libvncserver/rfbcrypto.h)0
-rw-r--r--common/rfbcrypto_gnutls.c (renamed from libvncserver/rfbcrypto_gnutls.c)0
-rw-r--r--common/rfbcrypto_included.c (renamed from libvncserver/rfbcrypto_included.c)0
-rw-r--r--common/rfbcrypto_openssl.c (renamed from libvncserver/rfbcrypto_openssl.c)0
-rw-r--r--common/rfbcrypto_polarssl.c (renamed from libvncserver/rfbcrypto_polarssl.c)0
6 files changed, 23 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b533494..26c686a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -204,25 +204,40 @@ if(SYSTEMD_FOUND)
set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} ${SYSTEMD_LIBRARIES})
endif(SYSTEMD_FOUND)
+if(LIBVNCSERVER_HAVE_SYS_UIO_H)
+ if(GNUTLS_FOUND)
+ message(STATUS "Building crypto with GnuTLS")
+ set(CRYPTO_LIBRARIES ${GNUTLS_LIBRARIES})
+ set(CRYPTO_SOURCES ${COMMON_DIR}/rfbcrypto_gnutls)
+ include_directories(${GNUTLS_INCLUDE_DIR})
+ elseif(OPENSSL_FOUND)
+ message(STATUS "Building crypto with OpenSSL")
+ set(CRYPTO_LIBRARIES ${OPENSSL_LIBRARIES})
+ set(CRYPTO_SOURCES ${COMMON_DIR}/rfbcrypto_openssl)
+ else()
+ message(STATUS "Building crypto with builtin functions")
+ set(CRYPTO_SOURCES ${COMMON_DIR}/rfbcrypto_included.c ${COMMON_DIR}/md5.c ${COMMON_DIR}/sha1.c)
+ endif()
+endif(LIBVNCSERVER_HAVE_SYS_UIO_H)
+
-if(WITH_WEBSOCKETS AND LIBVNCSERVER_HAVE_SYS_UIO_H)
+if(WITH_WEBSOCKETS)
set(LIBVNCSERVER_WITH_WEBSOCKETS 1)
if(GNUTLS_FOUND)
- set(LIBVNCSERVER_WITH_CLIENT_TLS 1)
message(STATUS "Building websockets with GnuTLS")
set(WEBSOCKET_LIBRARIES ${GNUTLS_LIBRARIES})
- set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_gnutls ${LIBVNCSERVER_DIR}/rfbcrypto_gnutls)
+ set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_gnutls)
include_directories(${GNUTLS_INCLUDE_DIR})
elseif(OPENSSL_FOUND)
message(STATUS "Building websockets with OpenSSL")
set(WEBSOCKET_LIBRARIES ${OPENSSL_LIBRARIES})
- set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_openssl ${LIBVNCSERVER_DIR}/rfbcrypto_openssl)
+ set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_openssl)
else()
message(STATUS "Building websockets without SSL")
set(WEBSOCKET_LIBRARIES)
- set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_none.c ${LIBVNCSERVER_DIR}/rfbcrypto_included.c ${COMMON_DIR}/md5.c ${COMMON_DIR}/sha1.c)
+ set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_none.c)
endif()
-endif(WITH_WEBSOCKETS AND LIBVNCSERVER_HAVE_SYS_UIO_H)
+endif(WITH_WEBSOCKETS)
if(WITH_GCRYPT AND LIBGCRYPT_LIBRARIES)
message(STATUS "Found libgcrypt: ${LIBGCRYPT_LIBRARIES}")
@@ -400,6 +415,7 @@ if(LIBVNCSERVER_WITH_WEBSOCKETS)
${LIBVNCSERVER_DIR}/websockets.c
${LIBVNCSERVER_DIR}/ws_decode.c
${COMMON_DIR}/base64.c
+ ${CRYPTO_SOURCES}
${WSSRCS}
)
endif(LIBVNCSERVER_WITH_WEBSOCKETS)
@@ -422,6 +438,7 @@ target_link_libraries(vncserver
${ZLIB_LIBRARIES}
${JPEG_LIBRARIES}
${PNG_LIBRARIES}
+ ${CRYPTO_LIBRARIES}
${WEBSOCKET_LIBRARIES}
)
diff --git a/libvncserver/rfbcrypto.h b/common/rfbcrypto.h
index fec095e..fec095e 100644
--- a/libvncserver/rfbcrypto.h
+++ b/common/rfbcrypto.h
diff --git a/libvncserver/rfbcrypto_gnutls.c b/common/rfbcrypto_gnutls.c
index 2ecb2da..2ecb2da 100644
--- a/libvncserver/rfbcrypto_gnutls.c
+++ b/common/rfbcrypto_gnutls.c
diff --git a/libvncserver/rfbcrypto_included.c b/common/rfbcrypto_included.c
index 7feff61..7feff61 100644
--- a/libvncserver/rfbcrypto_included.c
+++ b/common/rfbcrypto_included.c
diff --git a/libvncserver/rfbcrypto_openssl.c b/common/rfbcrypto_openssl.c
index 29ec5c1..29ec5c1 100644
--- a/libvncserver/rfbcrypto_openssl.c
+++ b/common/rfbcrypto_openssl.c
diff --git a/libvncserver/rfbcrypto_polarssl.c b/common/rfbcrypto_polarssl.c
index 55e3a7b..55e3a7b 100644
--- a/libvncserver/rfbcrypto_polarssl.c
+++ b/common/rfbcrypto_polarssl.c