diff --git a/src/lib/synergy/CCryptoMode.cpp b/src/lib/io/CCryptoMode.cpp similarity index 98% rename from src/lib/synergy/CCryptoMode.cpp rename to src/lib/io/CCryptoMode.cpp index dcc5b1ac..7ea74235 100644 --- a/src/lib/synergy/CCryptoMode.cpp +++ b/src/lib/io/CCryptoMode.cpp @@ -16,7 +16,7 @@ */ #include "CCryptoMode.h" -#include "XSynergy.h" +#include "XIO.h" using namespace CryptoPP; @@ -47,7 +47,7 @@ CCryptoMode::CCryptoMode(ECryptoMode mode, bool encryption) : break; default: - throw XBadCryptoMode(); + throw XIOBadCryptoMode(); } } else { @@ -72,7 +72,7 @@ CCryptoMode::CCryptoMode(ECryptoMode mode, bool encryption) : break; default: - throw XBadCryptoMode(); + throw XIOBadCryptoMode(); } } } diff --git a/src/lib/synergy/CCryptoMode.h b/src/lib/io/CCryptoMode.h similarity index 100% rename from src/lib/synergy/CCryptoMode.h rename to src/lib/io/CCryptoMode.h diff --git a/src/lib/synergy/CCryptoOptions.cpp b/src/lib/io/CCryptoOptions.cpp similarity index 96% rename from src/lib/synergy/CCryptoOptions.cpp rename to src/lib/io/CCryptoOptions.cpp index 54a02bdd..175a67d0 100644 --- a/src/lib/synergy/CCryptoOptions.cpp +++ b/src/lib/io/CCryptoOptions.cpp @@ -16,7 +16,7 @@ */ #include "CCryptoOptions.h" -#include "XSynergy.h" +#include "XIO.h" CCryptoOptions::CCryptoOptions( const CString& modeString, @@ -49,6 +49,6 @@ CCryptoOptions::parseMode(CString modeString) return kGcm; } else { - throw XBadCryptoMode(); + throw XIOBadCryptoMode(); } } diff --git a/src/lib/synergy/CCryptoOptions.h b/src/lib/io/CCryptoOptions.h similarity index 100% rename from src/lib/synergy/CCryptoOptions.h rename to src/lib/io/CCryptoOptions.h diff --git a/src/lib/synergy/CCryptoStream.cpp b/src/lib/io/CCryptoStream.cpp similarity index 100% rename from src/lib/synergy/CCryptoStream.cpp rename to src/lib/io/CCryptoStream.cpp diff --git a/src/lib/synergy/CCryptoStream.h b/src/lib/io/CCryptoStream.h similarity index 100% rename from src/lib/synergy/CCryptoStream.h rename to src/lib/io/CCryptoStream.h diff --git a/src/lib/io/CMakeLists.txt b/src/lib/io/CMakeLists.txt index dc345aa8..1215fceb 100644 --- a/src/lib/io/CMakeLists.txt +++ b/src/lib/io/CMakeLists.txt @@ -20,6 +20,10 @@ set(inc IStream.h IStreamFilterFactory.h XIO.h + CCryptoStream.h + CCryptoMode.h + ECryptoMode.h + CCryptoOptions.h ) set(src @@ -27,6 +31,9 @@ set(src CStreamFilter.cpp IStream.cpp XIO.cpp + CCryptoStream.cpp + CCryptoMode.cpp + CCryptoOptions.cpp ) if (WIN32) @@ -37,6 +44,8 @@ set(inc ../arch ../base ../common + ../.. + ../../../tools ) if (UNIX) @@ -47,3 +56,7 @@ endif() include_directories(${inc}) add_library(io STATIC ${src}) + +if (UNIX) + target_link_libraries(io cryptopp) +endif() diff --git a/src/lib/synergy/ECryptoMode.h b/src/lib/io/ECryptoMode.h similarity index 100% rename from src/lib/synergy/ECryptoMode.h rename to src/lib/io/ECryptoMode.h diff --git a/src/lib/io/XIO.cpp b/src/lib/io/XIO.cpp index 6ed9105f..219ec25a 100644 --- a/src/lib/io/XIO.cpp +++ b/src/lib/io/XIO.cpp @@ -49,3 +49,13 @@ XIOWouldBlock::getWhat() const throw() { return format("XIOWouldBlock", "stream operation would block"); } + + +// +// XBadCryptoMode +// +CString +XIOBadCryptoMode::getWhat() const throw() +{ + return "XBadCryptoMode"; +} diff --git a/src/lib/io/XIO.h b/src/lib/io/XIO.h index 4525331f..6d02e3a8 100644 --- a/src/lib/io/XIO.h +++ b/src/lib/io/XIO.h @@ -49,4 +49,10 @@ Thrown if an operation on a stream would block. */ XBASE_SUBCLASS_WHAT(XIOWouldBlock, XIO); +//! I/O bad crypto mode exception +/*! +Thrown when the user enters an invalid crypto mode. +*/ +XBASE_SUBCLASS_WHAT(XIOBadCryptoMode, XIO); + #endif diff --git a/src/lib/synergy/CMakeLists.txt b/src/lib/synergy/CMakeLists.txt index 49e31a39..b775f70a 100644 --- a/src/lib/synergy/CMakeLists.txt +++ b/src/lib/synergy/CMakeLists.txt @@ -50,10 +50,6 @@ set(inc IAppUtil.h CEventGameDevice.h CVncClient.h - CCryptoStream.h - CCryptoMode.h - ECryptoMode.h - CCryptoOptions.h ) set(src @@ -84,10 +80,7 @@ set(src CArgsBase.cpp CEventGameDevice.cpp CVncClient.cpp - CGameDevice.cpp - CCryptoStream.cpp - CCryptoMode.cpp - CCryptoOptions.cpp + CGameDevice.cpp ) if (WIN32) @@ -136,5 +129,5 @@ include_directories(${inc}) add_library(synergy STATIC ${src}) if (UNIX) - target_link_libraries(synergy arch client ipc net base platform mt server cryptopp) + target_link_libraries(synergy arch client ipc net base platform mt server) endif() diff --git a/src/lib/synergy/XSynergy.cpp b/src/lib/synergy/XSynergy.cpp index 12738614..e42cd43d 100644 --- a/src/lib/synergy/XSynergy.cpp +++ b/src/lib/synergy/XSynergy.cpp @@ -29,15 +29,6 @@ XBadClient::getWhat() const throw() return "XBadClient"; } -// -// XBadCryptoMode -// -CString -XBadCryptoMode::getWhat() const throw() -{ - return "XBadCryptoMode"; -} - // // XIncompatibleClient diff --git a/src/lib/synergy/XSynergy.h b/src/lib/synergy/XSynergy.h index 9fcf49fb..ca763475 100644 --- a/src/lib/synergy/XSynergy.h +++ b/src/lib/synergy/XSynergy.h @@ -30,12 +30,6 @@ Thrown when the client fails to follow the protocol. */ XBASE_SUBCLASS_WHAT(XBadClient, XSynergy); -//! Bad crypto mode -/*! -Thrown when the user enters an invalid crypto mode. -*/ -XBASE_SUBCLASS_WHAT(XBadCryptoMode, XSynergy); - //! Incompatible client exception /*! Thrown when a client attempting to connect has an incompatible version.