diff --git a/src/lib/base/String.cpp b/src/lib/base/String.cpp index 32531df8..4674deff 100644 --- a/src/lib/base/String.cpp +++ b/src/lib/base/String.cpp @@ -184,7 +184,7 @@ removeFileExt(String filename) } void -toHex(CString& subject, int width, const char fill) +toHex(String& subject, int width, const char fill) { std::stringstream ss; ss << std::hex; @@ -196,13 +196,13 @@ toHex(CString& subject, int width, const char fill) } void -uppercase(CString& subject) +uppercase(String& subject) { std::transform(subject.begin(), subject.end(), subject.begin(), ::toupper); } void -removeChar(CString& subject, const char c) +removeChar(String& subject, const char c) { subject.erase(std::remove(subject.begin(), subject.end(), c), subject.end()); } diff --git a/src/lib/base/String.h b/src/lib/base/String.h index 57f3c69c..dbe5c21b 100644 --- a/src/lib/base/String.h +++ b/src/lib/base/String.h @@ -74,19 +74,19 @@ String removeFileExt(String filename); /*! Convert each character in \c subject into hexdecimal form with \c width */ -void toHex(CString& subject, int width, const char fill = '0'); +void toHex(String& subject, int width, const char fill = '0'); //! Convert to all uppercase /*! Convert each character in \c subject to uppercase */ -void uppercase(CString& subject); +void uppercase(String& subject); //! Remove all specific char in suject /*! Remove all specific \c char in \c suject */ -void removeChar(CString& subject, const char c); +void removeChar(String& subject, const char c); //! Case-insensitive comparisons diff --git a/src/lib/client/Client.cpp b/src/lib/client/Client.cpp index 43717134..329733d4 100644 --- a/src/lib/client/Client.cpp +++ b/src/lib/client/Client.cpp @@ -77,7 +77,7 @@ Client::Client( m_sendFileThread(NULL), m_writeToDropDirThread(NULL), m_socket(NULL), - m_useSecureNetwork(false) + m_useSecureNetwork(false), m_args(args) { assert(m_socketFactory != NULL); @@ -104,7 +104,7 @@ Client::Client( &Client::handleFileRecieveCompleted)); } - if (enableCrypto) { + if (m_args.m_enableCrypto) { m_useSecureNetwork = ARCH->plugin().exists(s_networkSecurity); if (m_useSecureNetwork == false) { LOG((CLOG_NOTE "crypto disabled because of ns plugin not available")); diff --git a/src/lib/net/TCPSocket.h b/src/lib/net/TCPSocket.h index 57bb0169..2e75f357 100644 --- a/src/lib/net/TCPSocket.h +++ b/src/lib/net/TCPSocket.h @@ -59,7 +59,7 @@ public: virtual void secureConnect() {} virtual void secureAccept() {} - virtual void setFingerprintFilename(CString& f) {} + virtual void setFingerprintFilename(String& f) {} protected: ArchSocket getSocket() { return m_socket; } diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index de63e333..d1af5b85 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -41,10 +41,10 @@ struct Ssl { SSL* m_ssl; }; -CSecureSocket::CSecureSocket( +SecureSocket::SecureSocket( IEventQueue* events, - CSocketMultiplexer* socketMultiplexer) : - CTCPSocket(events, socketMultiplexer), + SocketMultiplexer* socketMultiplexer) : + TCPSocket(events, socketMultiplexer), m_secureReady(false), m_certFingerprintFilename() { @@ -396,14 +396,14 @@ SecureSocket::getError() } void -CSecureSocket::disconnect() +SecureSocket::disconnect() { sendEvent(getEvents()->forISocket().disconnected()); sendEvent(getEvents()->forIStream().inputShutdown()); } bool -CSecureSocket::verifyCertFingerprint() +SecureSocket::verifyCertFingerprint() { if (m_certFingerprintFilename.empty()) { return false; @@ -420,15 +420,15 @@ CSecureSocket::verifyCertFingerprint() } // convert fingerprint into hexdecimal format - CString fingerprint(reinterpret_cast(tempFingerprint), tempFingerprintLen); + String fingerprint(reinterpret_cast(tempFingerprint), tempFingerprintLen); synergy::string::toHex(fingerprint, 2); // all uppercase synergy::string::uppercase(fingerprint); // check if this fingerprint exist - CString fileLine; - CString certificateFingerprint; + String fileLine; + String certificateFingerprint; std::ifstream file; file.open(m_certFingerprintFilename.c_str()); @@ -437,14 +437,14 @@ CSecureSocket::verifyCertFingerprint() // example of a fingerprint: // SHA1 Fingerprint=6E:41:1A:21:53:2E:A3:EF:4D:A6:F2:A6:BA:0E:27:09:8A:F3:A1:10 size_t found = fileLine.find('='); - if (found != CString::npos) { + if (found != String::npos) { certificateFingerprint = fileLine.substr(found + 1); if (!certificateFingerprint.empty()) { // remove colons synergy::string::removeChar(certificateFingerprint, ':'); - if(certificateFingerprint.compare(fingerprint) == 0) { + if (certificateFingerprint.compare(fingerprint) == 0) { file.close(); return true; } @@ -458,10 +458,10 @@ CSecureSocket::verifyCertFingerprint() } ISocketMultiplexerJob* -CSecureSocket::serviceConnect(ISocketMultiplexerJob* job, +SecureSocket::serviceConnect(ISocketMultiplexerJob* job, bool, bool write, bool error) { - CLock lock(&getMutex()); + Lock lock(&getMutex()); bool retry = true; #ifdef SYSAPI_WIN32 @@ -474,10 +474,10 @@ CSecureSocket::serviceConnect(ISocketMultiplexerJob* job, } ISocketMultiplexerJob* -CSecureSocket::serviceAccept(ISocketMultiplexerJob* job, +SecureSocket::serviceAccept(ISocketMultiplexerJob* job, bool, bool write, bool error) { - CLock lock(&getMutex()); + Lock lock(&getMutex()); bool retry = true; #ifdef SYSAPI_WIN32 diff --git a/src/lib/plugin/ns/SecureSocket.h b/src/lib/plugin/ns/SecureSocket.h index 7f3f0028..50ca17b6 100644 --- a/src/lib/plugin/ns/SecureSocket.h +++ b/src/lib/plugin/ns/SecureSocket.h @@ -43,7 +43,7 @@ public: void secureConnect(); void secureAccept(); - void setFingerprintFilename(CString& f) { m_certFingerprintFilename = f; } + void setFingerprintFilename(String& f) { m_certFingerprintFilename = f; } bool isReady() const { return m_secureReady; } bool isSecureReady(); bool isSecure() { return true; } @@ -62,7 +62,7 @@ private: void checkResult(int n, bool& fatal, bool& retry); void showError(); void throwError(const char* reason); - CString getError(); + String getError(); void disconnect(); bool verifyCertFingerprint(); @@ -77,5 +77,5 @@ private: private: Ssl* m_ssl; bool m_secureReady; - CString m_certFingerprintFilename; + String m_certFingerprintFilename; }; diff --git a/src/lib/synergy/ClientArgs.cpp b/src/lib/synergy/ClientArgs.cpp index 133d5423..fff34817 100644 --- a/src/lib/synergy/ClientArgs.cpp +++ b/src/lib/synergy/ClientArgs.cpp @@ -17,7 +17,7 @@ #include "synergy/ClientArgs.h" -CClientArgs::CClientArgs() : +ClientArgs::ClientArgs() : m_yscroll(0), m_certFingerprintFilename() { diff --git a/src/lib/synergy/ClientArgs.h b/src/lib/synergy/ClientArgs.h index 947ca619..093b0ccf 100644 --- a/src/lib/synergy/ClientArgs.h +++ b/src/lib/synergy/ClientArgs.h @@ -27,5 +27,5 @@ public: public: int m_yscroll; - CString m_certFingerprintFilename; + String m_certFingerprintFilename; };