build: decouple GnuTLS|OpenSSL detection from WebSockets support

pull/3/head
Christian Beier 6 years ago
parent 3c05dd565e
commit e775aec64e
No known key found for this signature in database
GPG Key ID: 421BB3B45C6067F8

@ -224,20 +224,6 @@ endif(LIBVNCSERVER_HAVE_SYS_UIO_H)
if(WITH_WEBSOCKETS AND LIBVNCSERVER_HAVE_CRYPTO) if(WITH_WEBSOCKETS AND LIBVNCSERVER_HAVE_CRYPTO)
set(LIBVNCSERVER_WITH_WEBSOCKETS 1) set(LIBVNCSERVER_WITH_WEBSOCKETS 1)
if(GNUTLS_FOUND)
message(STATUS "Building websockets with GnuTLS")
set(WEBSOCKET_LIBRARIES ${GNUTLS_LIBRARIES})
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)
else()
message(STATUS "Building websockets without SSL")
set(WEBSOCKET_LIBRARIES)
set(WSSRCS ${LIBVNCSERVER_DIR}/rfbssl_none.c)
endif()
endif(WITH_WEBSOCKETS AND LIBVNCSERVER_HAVE_CRYPTO) endif(WITH_WEBSOCKETS AND LIBVNCSERVER_HAVE_CRYPTO)
if(WITH_GCRYPT AND LIBGCRYPT_LIBRARIES) if(WITH_GCRYPT AND LIBGCRYPT_LIBRARIES)
@ -351,17 +337,30 @@ if(GNUTLS_FOUND)
${LIBVNCCLIENT_SOURCES} ${LIBVNCCLIENT_SOURCES}
${LIBVNCCLIENT_DIR}/tls_gnutls.c ${LIBVNCCLIENT_DIR}/tls_gnutls.c
) )
set(LIBVNCSERVER_SOURCES
${LIBVNCSERVER_SOURCES}
${LIBVNCSERVER_DIR}/rfbssl_gnutls.c
)
include_directories(${GNUTLS_INCLUDE_DIR})
elseif(OPENSSL_FOUND) elseif(OPENSSL_FOUND)
set(LIBVNCCLIENT_SOURCES set(LIBVNCCLIENT_SOURCES
${LIBVNCCLIENT_SOURCES} ${LIBVNCCLIENT_SOURCES}
${LIBVNCCLIENT_DIR}/tls_openssl.c ${LIBVNCCLIENT_DIR}/tls_openssl.c
) )
set(LIBVNCSERVER_SOURCES
${LIBVNCSERVER_SOURCES}
${LIBVNCSERVER_DIR}/rfbssl_openssl.c
)
include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENSSL_INCLUDE_DIR})
else() else()
set(LIBVNCCLIENT_SOURCES set(LIBVNCCLIENT_SOURCES
${LIBVNCCLIENT_SOURCES} ${LIBVNCCLIENT_SOURCES}
${LIBVNCCLIENT_DIR}/tls_none.c ${LIBVNCCLIENT_DIR}/tls_none.c
) )
set(LIBVNCSERVER_SOURCES
${LIBVNCSERVER_SOURCES}
${LIBVNCSERVER_DIR}/rfbssl_none.c
)
endif() endif()
if(LIBVNCSERVER_HAVE_SASL) if(LIBVNCSERVER_HAVE_SASL)
@ -417,7 +416,6 @@ if(LIBVNCSERVER_WITH_WEBSOCKETS)
${LIBVNCSERVER_DIR}/ws_decode.c ${LIBVNCSERVER_DIR}/ws_decode.c
${COMMON_DIR}/base64.c ${COMMON_DIR}/base64.c
${CRYPTO_SOURCES} ${CRYPTO_SOURCES}
${WSSRCS}
) )
endif(LIBVNCSERVER_WITH_WEBSOCKETS) endif(LIBVNCSERVER_WITH_WEBSOCKETS)
@ -440,7 +438,8 @@ target_link_libraries(vncserver
${JPEG_LIBRARIES} ${JPEG_LIBRARIES}
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${CRYPTO_LIBRARIES} ${CRYPTO_LIBRARIES}
${WEBSOCKET_LIBRARIES} ${GNUTLS_LIBRARIES}
${OPENSSL_LIBRARIES}
) )
SET_TARGET_PROPERTIES(vncclient vncserver SET_TARGET_PROPERTIES(vncclient vncserver

@ -378,10 +378,8 @@ typedef struct _rfbScreenInfo
rfbDisplayFinishedHookPtr displayFinishedHook; rfbDisplayFinishedHookPtr displayFinishedHook;
/** xvpHook is called to handle an xvp client message */ /** xvpHook is called to handle an xvp client message */
rfbXvpHookPtr xvpHook; rfbXvpHookPtr xvpHook;
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
char *sslkeyfile; char *sslkeyfile;
char *sslcertfile; char *sslcertfile;
#endif
int ipv6port; /**< The port to listen on when using IPv6. */ int ipv6port; /**< The port to listen on when using IPv6. */
char* listen6Interface; char* listen6Interface;
/* We have an additional IPv6 listen socket since there are systems that /* We have an additional IPv6 listen socket since there are systems that
@ -690,12 +688,9 @@ typedef struct _rfbClientRec {
int turboQualityLevel; /* 1-100 scale */ int turboQualityLevel; /* 1-100 scale */
#endif #endif
#endif #endif
#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
rfbSslCtx *sslctx; rfbSslCtx *sslctx;
wsCtx *wsctx; wsCtx *wsctx;
char *wspath; /* Requests path component */ char *wspath; /* Requests path component */
#endif
} rfbClientRec, *rfbClientPtr; } rfbClientRec, *rfbClientPtr;
/** /**

Loading…
Cancel
Save