diff options
author | Pierre Ossman <ossman@cendio.se> | 2022-08-25 14:51:17 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2022-08-25 14:51:17 +0200 |
commit | 420ae20e847b644dc2b8275fad9c87bb6c2a0d60 (patch) | |
tree | 4760ff76a14afc72bb91480a71421b281c496cec | |
parent | 0ae1557ed9a7f8b46b6d7e2feaf2fad4cc2c3b3d (diff) | |
parent | 7b1be722afac02794708e434b8436082c9ce5a99 (diff) | |
download | tigervnc-420ae20e847b644dc2b8275fad9c87bb6c2a0d60.tar.gz tigervnc-420ae20e847b644dc2b8275fad9c87bb6c2a0d60.zip |
Merge branch 'rsaaesfix' of https://github.com/CendioOssman/tigervnc
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | common/rdr/BufferedOutStream.cxx | 14 | ||||
-rw-r--r-- | common/rdr/BufferedOutStream.h | 4 | ||||
-rw-r--r-- | common/rdr/CMakeLists.txt | 4 | ||||
-rw-r--r-- | common/rdr/FdOutStream.cxx | 2 | ||||
-rw-r--r-- | common/rdr/HexOutStream.cxx | 47 | ||||
-rw-r--r-- | common/rdr/HexOutStream.h | 13 | ||||
-rw-r--r-- | common/rdr/InStream.h | 3 | ||||
-rw-r--r-- | common/rdr/TLSOutStream.cxx | 50 | ||||
-rw-r--r-- | common/rdr/TLSOutStream.h | 14 | ||||
-rw-r--r-- | common/rdr/ZlibOutStream.cxx | 73 | ||||
-rw-r--r-- | common/rdr/ZlibOutStream.h | 13 | ||||
-rw-r--r-- | common/rfb/CMakeLists.txt | 6 | ||||
-rw-r--r-- | common/rfb/CSecurity.h | 1 | ||||
-rw-r--r-- | common/rfb/CSecurityNone.h | 1 | ||||
-rw-r--r-- | common/rfb/CSecurityPlain.h | 1 | ||||
-rw-r--r-- | common/rfb/CSecurityStack.cxx | 4 | ||||
-rw-r--r-- | common/rfb/CSecurityStack.h | 4 | ||||
-rw-r--r-- | common/rfb/CSecurityTLS.h | 2 | ||||
-rw-r--r-- | common/rfb/CSecurityVeNCrypt.cxx | 7 | ||||
-rw-r--r-- | common/rfb/CSecurityVeNCrypt.h | 1 | ||||
-rw-r--r-- | common/rfb/CSecurityVncAuth.h | 1 | ||||
-rw-r--r-- | common/rfb/SecurityClient.cxx | 6 | ||||
-rw-r--r-- | tests/perf/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/unit/CMakeLists.txt | 3 |
25 files changed, 83 insertions, 198 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d88b177f..24336402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,8 +231,6 @@ if(NOT FOUND_LIBJPEG_TURBO) message(STATUS "WARNING: You are not using libjpeg-turbo. Performance will suffer.") endif() -include_directories(${JPEG_INCLUDE_DIR}) - option(BUILD_JAVA "Build Java version of the TigerVNC Viewer" FALSE) if(BUILD_JAVA) add_subdirectory(java) @@ -273,9 +271,7 @@ option(ENABLE_GNUTLS "Enable protocol encryption and advanced authentication" ON if(ENABLE_GNUTLS) find_package(GnuTLS) if (GNUTLS_FOUND) - include_directories(${GNUTLS_INCLUDE_DIR}) add_definitions("-DHAVE_GNUTLS") - add_definitions(${GNUTLS_DEFINITIONS}) endif() endif() diff --git a/common/rdr/BufferedOutStream.cxx b/common/rdr/BufferedOutStream.cxx index c8f6ce9c..ff7b6b51 100644 --- a/common/rdr/BufferedOutStream.cxx +++ b/common/rdr/BufferedOutStream.cxx @@ -31,8 +31,8 @@ using namespace rdr; static const size_t DEFAULT_BUF_SIZE = 16384; static const size_t MAX_BUF_SIZE = 32 * 1024 * 1024; -BufferedOutStream::BufferedOutStream() - : bufSize(DEFAULT_BUF_SIZE), offset(0) +BufferedOutStream::BufferedOutStream(bool emulateCork) + : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork) { ptr = start = sentUpTo = new U8[bufSize]; end = start + bufSize; @@ -55,6 +55,10 @@ void BufferedOutStream::flush() { struct timeval now; + // Only give larger chunks if corked to minimize overhead + if (corked && emulateCork && ((ptr - sentUpTo) < 1024)) + return; + while (sentUpTo < ptr) { size_t len; @@ -101,11 +105,17 @@ bool BufferedOutStream::hasBufferedData() void BufferedOutStream::overrun(size_t needed) { + bool oldCorked; size_t totalNeeded, newSize; U8* newBuffer; // First try to get rid of the data we have + // (use corked to make things a bit more efficient since we're not + // trying to flush out everything, just make some room) + oldCorked = corked; + cork(true); flush(); + cork(oldCorked); // Make note of the total needed space totalNeeded = needed + (ptr - sentUpTo); diff --git a/common/rdr/BufferedOutStream.h b/common/rdr/BufferedOutStream.h index b01d1fee..94707118 100644 --- a/common/rdr/BufferedOutStream.h +++ b/common/rdr/BufferedOutStream.h @@ -59,11 +59,13 @@ namespace rdr { struct timeval lastSizeCheck; size_t peakUsage; + bool emulateCork; + protected: U8* sentUpTo; protected: - BufferedOutStream(); + BufferedOutStream(bool emulateCork=true); }; } diff --git a/common/rdr/CMakeLists.txt b/common/rdr/CMakeLists.txt index 46b36cd5..08c93d8b 100644 --- a/common/rdr/CMakeLists.txt +++ b/common/rdr/CMakeLists.txt @@ -1,4 +1,5 @@ -include_directories(${CMAKE_SOURCE_DIR}/common ${ZLIB_INCLUDE_DIRS}) +include_directories(${CMAKE_SOURCE_DIR}/common) +include_directories(${ZLIB_INCLUDE_DIRS}) add_library(rdr STATIC BufferedInStream.cxx @@ -19,6 +20,7 @@ add_library(rdr STATIC target_link_libraries(rdr ${ZLIB_LIBRARIES} os) if(GNUTLS_FOUND) + include_directories(${GNUTLS_INCLUDE_DIR}) target_link_libraries(rdr ${GNUTLS_LIBRARIES}) endif() if(WIN32) diff --git a/common/rdr/FdOutStream.cxx b/common/rdr/FdOutStream.cxx index ed6535a8..f89fd345 100644 --- a/common/rdr/FdOutStream.cxx +++ b/common/rdr/FdOutStream.cxx @@ -52,7 +52,7 @@ using namespace rdr; FdOutStream::FdOutStream(int fd_) - : fd(fd_) + : BufferedOutStream(false), fd(fd_) { gettimeofday(&lastWrite, NULL); } diff --git a/common/rdr/HexOutStream.cxx b/common/rdr/HexOutStream.cxx index 85aff47b..4bcd8ba4 100644 --- a/common/rdr/HexOutStream.cxx +++ b/common/rdr/HexOutStream.cxx @@ -25,21 +25,15 @@ using namespace rdr; -const int DEFAULT_BUF_LEN = 16384; - static inline size_t min(size_t a, size_t b) {return a<b ? a : b;} HexOutStream::HexOutStream(OutStream& os) - : out_stream(os), offset(0), bufSize(DEFAULT_BUF_LEN) + : out_stream(os) { - if (bufSize % 2) - bufSize--; - ptr = start = new U8[bufSize]; - end = start + bufSize; } -HexOutStream::~HexOutStream() { - delete [] start; +HexOutStream::~HexOutStream() +{ } char HexOutStream::intToHex(int i) { @@ -65,48 +59,33 @@ char* HexOutStream::binToHexStr(const char* data, size_t length) { return buffer; } - -void -HexOutStream::writeBuffer() { - U8* pos = start; - while (pos != ptr) { +bool HexOutStream::flushBuffer() +{ + while (sentUpTo != ptr) { U8* optr = out_stream.getptr(2); - size_t length = min(ptr-pos, out_stream.avail()/2); + size_t length = min(ptr-sentUpTo, out_stream.avail()/2); for (size_t i=0; i<length; i++) { - optr[i*2] = intToHex((pos[i] >> 4) & 0xf); - optr[i*2+1] = intToHex(pos[i] & 0xf); + optr[i*2] = intToHex((sentUpTo[i] >> 4) & 0xf); + optr[i*2+1] = intToHex(sentUpTo[i] & 0xf); } out_stream.setptr(length*2); - pos += length; + sentUpTo += length; } - offset += ptr - start; - ptr = start; -} -size_t HexOutStream::length() -{ - return offset + ptr - start; + return true; } void HexOutStream::flush() { - writeBuffer(); + BufferedOutStream::flush(); out_stream.flush(); } void HexOutStream::cork(bool enable) { - OutStream::cork(enable); - + BufferedOutStream::cork(enable); out_stream.cork(enable); } -void HexOutStream::overrun(size_t needed) { - if (needed > bufSize) - throw Exception("HexOutStream overrun: buffer size exceeded"); - - writeBuffer(); -} - diff --git a/common/rdr/HexOutStream.h b/common/rdr/HexOutStream.h index e591dd88..8b1ab9ec 100644 --- a/common/rdr/HexOutStream.h +++ b/common/rdr/HexOutStream.h @@ -19,32 +19,27 @@ #ifndef __RDR_HEX_OUTSTREAM_H__ #define __RDR_HEX_OUTSTREAM_H__ -#include <rdr/OutStream.h> +#include <rdr/BufferedOutStream.h> namespace rdr { - class HexOutStream : public OutStream { + class HexOutStream : public BufferedOutStream { public: HexOutStream(OutStream& os); virtual ~HexOutStream(); - void flush(); - size_t length(); + virtual void flush(); virtual void cork(bool enable); static char intToHex(int i); static char* binToHexStr(const char* data, size_t length); private: + virtual bool flushBuffer(); void writeBuffer(); - virtual void overrun(size_t needed); OutStream& out_stream; - - U8* start; - size_t offset; - size_t bufSize; }; } diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h index c02e967f..26817fb8 100644 --- a/common/rdr/InStream.h +++ b/common/rdr/InStream.h @@ -166,9 +166,6 @@ namespace rdr { // some other stream API. inline const U8* getptr(size_t length) { check(length); -#ifdef RFB_INSTREAM_CHECK - checkedBytes += length; -#endif return ptr; } inline void setptr(size_t length) { if (length > avail()) throw Exception("Input stream overflow"); diff --git a/common/rdr/TLSOutStream.cxx b/common/rdr/TLSOutStream.cxx index 63bdeef1..cdfe9b12 100644 --- a/common/rdr/TLSOutStream.cxx +++ b/common/rdr/TLSOutStream.cxx @@ -34,8 +34,6 @@ using namespace rdr; static rfb::LogWriter vlog("TLSOutStream"); -enum { DEFAULT_BUF_SIZE = 16384 }; - ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, size_t size) { @@ -64,14 +62,10 @@ ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, } TLSOutStream::TLSOutStream(OutStream* _out, gnutls_session_t _session) - : session(_session), out(_out), bufSize(DEFAULT_BUF_SIZE), offset(0), - saved_exception(NULL) + : session(_session), out(_out), saved_exception(NULL) { gnutls_transport_ptr_t recv, send; - ptr = start = new U8[bufSize]; - end = start + bufSize; - gnutls_transport_set_push_function(session, push); gnutls_transport_get_ptr2(session, &recv, &send); gnutls_transport_set_ptr2(session, recv, this); @@ -87,55 +81,29 @@ TLSOutStream::~TLSOutStream() #endif gnutls_transport_set_push_function(session, NULL); - delete [] start; delete saved_exception; } -size_t TLSOutStream::length() -{ - return offset + ptr - start; -} - void TLSOutStream::flush() { - U8* sentUpTo; - - // Only give GnuTLS larger chunks if corked to minimize overhead - if (corked && ((ptr - start) < 1024)) - return; - - sentUpTo = start; - while (sentUpTo < ptr) { - size_t n = writeTLS(sentUpTo, ptr - sentUpTo); - sentUpTo += n; - offset += n; - } - - ptr = start; + BufferedOutStream::flush(); out->flush(); } void TLSOutStream::cork(bool enable) { - OutStream::cork(enable); - + BufferedOutStream::cork(enable); out->cork(enable); } -void TLSOutStream::overrun(size_t needed) +bool TLSOutStream::flushBuffer() { - bool oldCorked; - - if (needed > bufSize) - throw Exception("TLSOutStream overrun: buffer size exceeded"); - - // A cork might prevent the flush, so disable it temporarily - oldCorked = corked; - corked = false; - - flush(); + while (sentUpTo < ptr) { + size_t n = writeTLS(sentUpTo, ptr - sentUpTo); + sentUpTo += n; + } - corked = oldCorked; + return true; } size_t TLSOutStream::writeTLS(const U8* data, size_t length) diff --git a/common/rdr/TLSOutStream.h b/common/rdr/TLSOutStream.h index 5e725bd5..276e5c78 100644 --- a/common/rdr/TLSOutStream.h +++ b/common/rdr/TLSOutStream.h @@ -22,31 +22,25 @@ #ifdef HAVE_GNUTLS #include <gnutls/gnutls.h> -#include <rdr/OutStream.h> +#include <rdr/BufferedOutStream.h> namespace rdr { - class TLSOutStream : public OutStream { + class TLSOutStream : public BufferedOutStream { public: TLSOutStream(OutStream* out, gnutls_session_t session); virtual ~TLSOutStream(); - void flush(); - size_t length(); + virtual void flush(); virtual void cork(bool enable); - protected: - virtual void overrun(size_t needed); - private: + virtual bool flushBuffer(); size_t writeTLS(const U8* data, size_t length); static ssize_t push(gnutls_transport_ptr_t str, const void* data, size_t size); gnutls_session_t session; OutStream* out; - size_t bufSize; - U8* start; - size_t offset; Exception* saved_exception; }; diff --git a/common/rdr/ZlibOutStream.cxx b/common/rdr/ZlibOutStream.cxx index 1ff234ce..63820b8e 100644 --- a/common/rdr/ZlibOutStream.cxx +++ b/common/rdr/ZlibOutStream.cxx @@ -35,11 +35,8 @@ static rfb::LogWriter vlog("ZlibOutStream"); using namespace rdr; -enum { DEFAULT_BUF_SIZE = 16384 }; - ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel) - : underlying(os), compressionLevel(compressLevel), newLevel(compressLevel), - bufSize(DEFAULT_BUF_SIZE), offset(0) + : underlying(os), compressionLevel(compressLevel), newLevel(compressLevel) { zs = new z_stream; zs->zalloc = Z_NULL; @@ -51,8 +48,6 @@ ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel) delete zs; throw Exception("ZlibOutStream: deflateInit failed"); } - ptr = start = new U8[bufSize]; - end = start + bufSize; } ZlibOutStream::~ZlibOutStream() @@ -61,7 +56,6 @@ ZlibOutStream::~ZlibOutStream() flush(); } catch (Exception&) { } - delete [] start; deflateEnd(zs); delete zs; } @@ -69,6 +63,8 @@ ZlibOutStream::~ZlibOutStream() void ZlibOutStream::setUnderlying(OutStream* os) { underlying = os; + if (underlying) + underlying->cork(corked); } void ZlibOutStream::setCompressionLevel(int level) @@ -79,68 +75,37 @@ void ZlibOutStream::setCompressionLevel(int level) newLevel = level; } -size_t ZlibOutStream::length() -{ - return offset + ptr - start; -} - void ZlibOutStream::flush() { - checkCompressionLevel(); - - zs->next_in = start; - zs->avail_in = ptr - start; - -#ifdef ZLIBOUT_DEBUG - vlog.debug("flush: avail_in %d",zs->avail_in); -#endif - - // Force out everything from the zlib encoder - deflate(corked ? Z_NO_FLUSH : Z_SYNC_FLUSH); - - if (zs->avail_in == 0) { - offset += ptr - start; - ptr = start; - } else { - // didn't consume all the data? try shifting what's left to the - // start of the buffer. - memmove(start, zs->next_in, ptr - zs->next_in); - offset += zs->next_in - start; - ptr -= zs->next_in - start; - } + BufferedOutStream::flush(); + if (underlying != NULL) + underlying->flush(); } void ZlibOutStream::cork(bool enable) { - OutStream::cork(enable); - - underlying->cork(enable); + BufferedOutStream::cork(enable); + if (underlying != NULL) + underlying->cork(enable); } -void ZlibOutStream::overrun(size_t needed) +bool ZlibOutStream::flushBuffer() { -#ifdef ZLIBOUT_DEBUG - vlog.debug("overrun"); -#endif - - if (needed > bufSize) - throw Exception("ZlibOutStream overrun: buffer size exceeded"); - checkCompressionLevel(); - while (avail() < needed) { - bool oldCorked; + zs->next_in = sentUpTo; + zs->avail_in = ptr - sentUpTo; - // use corked to make zlib a bit more efficient since we're not trying - // to end the stream here, just make some room +#ifdef ZLIBOUT_DEBUG + vlog.debug("flush: avail_in %d",zs->avail_in); +#endif - oldCorked = corked; - corked = true; + // Force out everything from the zlib encoder + deflate(corked ? Z_NO_FLUSH : Z_SYNC_FLUSH); - flush(); + sentUpTo = zs->next_in; - corked = oldCorked; - } + return true; } void ZlibOutStream::deflate(int flush) diff --git a/common/rdr/ZlibOutStream.h b/common/rdr/ZlibOutStream.h index af917d89..8061a58c 100644 --- a/common/rdr/ZlibOutStream.h +++ b/common/rdr/ZlibOutStream.h @@ -25,13 +25,13 @@ #ifndef __RDR_ZLIBOUTSTREAM_H__ #define __RDR_ZLIBOUTSTREAM_H__ -#include <rdr/OutStream.h> +#include <rdr/BufferedOutStream.h> struct z_stream_s; namespace rdr { - class ZlibOutStream : public OutStream { + class ZlibOutStream : public BufferedOutStream { public: @@ -40,23 +40,18 @@ namespace rdr { void setUnderlying(OutStream* os); void setCompressionLevel(int level=-1); - void flush(); - size_t length(); + virtual void flush(); virtual void cork(bool enable); private: - - virtual void overrun(size_t needed); + virtual bool flushBuffer(); void deflate(int flush); void checkCompressionLevel(); OutStream* underlying; int compressionLevel; int newLevel; - size_t bufSize; - size_t offset; z_stream_s* zs; - U8* start; }; } // end of namespace rdr diff --git a/common/rfb/CMakeLists.txt b/common/rfb/CMakeLists.txt index 994f1196..06966410 100644 --- a/common/rfb/CMakeLists.txt +++ b/common/rfb/CMakeLists.txt @@ -1,4 +1,6 @@ -include_directories(${CMAKE_SOURCE_DIR}/common ${JPEG_INCLUDE_DIR} ${PIXMAN_INCLUDE_DIRS} ${H264_INCLUDE_DIRS}) +include_directories(${CMAKE_SOURCE_DIR}/common) +include_directories(${JPEG_INCLUDE_DIR}) +include_directories(${PIXMAN_INCLUDE_DIRS}) add_library(rfb STATIC Blacklist.cxx @@ -75,6 +77,7 @@ if(ENABLE_H264 AND NOT H264_LIBS STREQUAL "NONE") elseif(H264_LIBS STREQUAL "WIN") target_sources(rfb PRIVATE H264WinDecoderContext.cxx) endif() + include_directories(${H264_INCLUDE_DIRS}) target_link_libraries(rfb ${H264_LIBRARIES}) target_link_directories(rfb PUBLIC ${H264_LIBRARY_DIRS}) endif() @@ -95,6 +98,7 @@ endif() if(GNUTLS_FOUND) target_sources(rfb PRIVATE CSecurityTLS.cxx SSecurityTLS.cxx) + include_directories(${GNUTLS_INCLUDE_DIR}) target_link_libraries(rfb ${GNUTLS_LIBRARIES}) endif() diff --git a/common/rfb/CSecurity.h b/common/rfb/CSecurity.h index 12d1829b..476f8770 100644 --- a/common/rfb/CSecurity.h +++ b/common/rfb/CSecurity.h @@ -48,7 +48,6 @@ namespace rfb { virtual ~CSecurity() {} virtual bool processMsg() = 0; virtual int getType() const = 0; - virtual const char* description() const = 0; virtual bool isSecure() const { return false; } /* diff --git a/common/rfb/CSecurityNone.h b/common/rfb/CSecurityNone.h index d07815f6..cb887914 100644 --- a/common/rfb/CSecurityNone.h +++ b/common/rfb/CSecurityNone.h @@ -32,7 +32,6 @@ namespace rfb { CSecurityNone(CConnection* cc) : CSecurity(cc) {} virtual bool processMsg() { return true; } virtual int getType() const {return secTypeNone;} - virtual const char* description() const {return "No Encryption";} }; } #endif diff --git a/common/rfb/CSecurityPlain.h b/common/rfb/CSecurityPlain.h index 4ea8c9d4..add7e776 100644 --- a/common/rfb/CSecurityPlain.h +++ b/common/rfb/CSecurityPlain.h @@ -29,7 +29,6 @@ namespace rfb { CSecurityPlain(CConnection* cc) : CSecurity(cc) {} virtual bool processMsg(); virtual int getType() const { return secTypePlain; } - virtual const char* description() const { return "ask for username and password"; } }; } #endif diff --git a/common/rfb/CSecurityStack.cxx b/common/rfb/CSecurityStack.cxx index 5691fd48..6b8da8dd 100644 --- a/common/rfb/CSecurityStack.cxx +++ b/common/rfb/CSecurityStack.cxx @@ -25,9 +25,9 @@ using namespace rfb; -CSecurityStack::CSecurityStack(CConnection* cc, int Type, const char* Name, +CSecurityStack::CSecurityStack(CConnection* cc, int Type, CSecurity* s0, CSecurity* s1) - : CSecurity(cc), name(Name), type(Type) + : CSecurity(cc), type(Type) { state = 0; state0 = s0; diff --git a/common/rfb/CSecurityStack.h b/common/rfb/CSecurityStack.h index 4be507ec..56ac3fea 100644 --- a/common/rfb/CSecurityStack.h +++ b/common/rfb/CSecurityStack.h @@ -27,18 +27,16 @@ namespace rfb { class CSecurityStack : public CSecurity { public: - CSecurityStack(CConnection* cc, int Type, const char *Name, + CSecurityStack(CConnection* cc, int Type, CSecurity* s0 = NULL, CSecurity* s1 = NULL); ~CSecurityStack(); virtual bool processMsg(); virtual int getType() const {return type;}; - virtual const char* description() const {return name;} virtual bool isSecure() const; protected: int state; CSecurity* state0; CSecurity* state1; - const char* name; int type; }; } diff --git a/common/rfb/CSecurityTLS.h b/common/rfb/CSecurityTLS.h index c21d9d8e..b2d68b6f 100644 --- a/common/rfb/CSecurityTLS.h +++ b/common/rfb/CSecurityTLS.h @@ -41,8 +41,6 @@ namespace rfb { virtual ~CSecurityTLS(); virtual bool processMsg(); virtual int getType() const { return anon ? secTypeTLSNone : secTypeX509None; } - virtual const char* description() const - { return anon ? "TLS Encryption without VncAuth" : "X509 Encryption without VncAuth"; } virtual bool isSecure() const { return !anon; } static StringParameter X509CA; diff --git a/common/rfb/CSecurityVeNCrypt.cxx b/common/rfb/CSecurityVeNCrypt.cxx index 6040dd34..046cd8d0 100644 --- a/common/rfb/CSecurityVeNCrypt.cxx +++ b/common/rfb/CSecurityVeNCrypt.cxx @@ -200,13 +200,6 @@ bool CSecurityVeNCrypt::processMsg() return csecurity->processMsg(); } -const char* CSecurityVeNCrypt::description() const -{ - if (csecurity) - return csecurity->description(); - return "VeNCrypt"; -} - bool CSecurityVeNCrypt::isSecure() const { if (csecurity && csecurity->isSecure()) diff --git a/common/rfb/CSecurityVeNCrypt.h b/common/rfb/CSecurityVeNCrypt.h index 1e2a7e68..d087b2a4 100644 --- a/common/rfb/CSecurityVeNCrypt.h +++ b/common/rfb/CSecurityVeNCrypt.h @@ -38,7 +38,6 @@ namespace rfb { ~CSecurityVeNCrypt(); virtual bool processMsg(); int getType() const {return chosenType;} - virtual const char* description() const; virtual bool isSecure() const; protected: diff --git a/common/rfb/CSecurityVncAuth.h b/common/rfb/CSecurityVncAuth.h index 2da98177..3f1f315b 100644 --- a/common/rfb/CSecurityVncAuth.h +++ b/common/rfb/CSecurityVncAuth.h @@ -29,7 +29,6 @@ namespace rfb { virtual ~CSecurityVncAuth() {} virtual bool processMsg(); virtual int getType() const {return secTypeVncAuth;}; - virtual const char* description() const {return "No Encryption";} }; } #endif diff --git a/common/rfb/SecurityClient.cxx b/common/rfb/SecurityClient.cxx index 4d88d678..dcd28bae 100644 --- a/common/rfb/SecurityClient.cxx +++ b/common/rfb/SecurityClient.cxx @@ -73,30 +73,24 @@ CSecurity* SecurityClient::GetCSecurity(CConnection* cc, U32 secType) #ifdef HAVE_GNUTLS case secTypeTLSNone: return new CSecurityStack(cc, secTypeTLSNone, - "TLS with no password", new CSecurityTLS(cc, true)); case secTypeTLSVnc: return new CSecurityStack(cc, secTypeTLSVnc, - "TLS with VNCAuth", new CSecurityTLS(cc, true), new CSecurityVncAuth(cc)); case secTypeTLSPlain: return new CSecurityStack(cc, secTypeTLSPlain, - "TLS with Username/Password", new CSecurityTLS(cc, true), new CSecurityPlain(cc)); case secTypeX509None: return new CSecurityStack(cc, secTypeX509None, - "X509 with no password", new CSecurityTLS(cc, false)); case secTypeX509Vnc: return new CSecurityStack(cc, secTypeX509Vnc, - "X509 with VNCAuth", new CSecurityTLS(cc, false), new CSecurityVncAuth(cc)); case secTypeX509Plain: return new CSecurityStack(cc, secTypeX509Plain, - "X509 with Username/Password", new CSecurityTLS(cc, false), new CSecurityPlain(cc)); #endif diff --git a/tests/perf/CMakeLists.txt b/tests/perf/CMakeLists.txt index 1b5e9f77..70ffe777 100644 --- a/tests/perf/CMakeLists.txt +++ b/tests/perf/CMakeLists.txt @@ -1,6 +1,5 @@ -include_directories(${GETTEXT_INCLUDE_DIR}) - include_directories(${CMAKE_SOURCE_DIR}/common) +include_directories(${GETTEXT_INCLUDE_DIR}) add_library(test_util STATIC util.cxx) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index d2c132b5..6daecba5 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories(${CMAKE_SOURCE_DIR}/common) include_directories(${CMAKE_SOURCE_DIR}/vncviewer) +include_directories(${GETTEXT_INCLUDE_DIR}) add_executable(conv conv.cxx) target_link_libraries(conv rfb) @@ -20,4 +21,4 @@ add_executable(unicode unicode.cxx) target_link_libraries(unicode rfb) add_executable(emulatemb emulatemb.cxx ../../vncviewer/EmulateMB.cxx) -target_link_libraries(emulatemb rfb ${GETTEXT_LIBRARIES})
\ No newline at end of file +target_link_libraries(emulatemb rfb ${GETTEXT_LIBRARIES}) |