From eccab535b59d0459d64983a00b13450cde9d3e88 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 4 Jan 2016 17:56:13 +0100 Subject: [PATCH 01/23] GH #1050 Crypto: fix gcc -Wshadow warnings --- Crypto/src/CipherKey.cpp | 14 +++++++------- Crypto/src/CipherKeyImpl.cpp | 34 +++++++++++++++++----------------- Crypto/src/RSAKeyImpl.cpp | 12 ++++++------ 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Crypto/src/CipherKey.cpp b/Crypto/src/CipherKey.cpp index 82a099776..43af25827 100644 --- a/Crypto/src/CipherKey.cpp +++ b/Crypto/src/CipherKey.cpp @@ -21,21 +21,21 @@ namespace Poco { namespace Crypto { -CipherKey::CipherKey(const std::string& name, const std::string& passphrase, const std::string& salt, int iterationCount, - const std::string &digest): - _pImpl(new CipherKeyImpl(name, passphrase, salt, iterationCount, digest)) +CipherKey::CipherKey(const std::string& rName, const std::string& passphrase, const std::string& salt, int iterationCount, + const std::string & rDigest): + _pImpl(new CipherKeyImpl(rName, passphrase, salt, iterationCount, rDigest)) { } -CipherKey::CipherKey(const std::string& name, const ByteVec& key, const ByteVec& iv): - _pImpl(new CipherKeyImpl(name, key, iv)) +CipherKey::CipherKey(const std::string& rName, const ByteVec& key, const ByteVec& iv): + _pImpl(new CipherKeyImpl(rName, key, iv)) { } -CipherKey::CipherKey(const std::string& name): - _pImpl(new CipherKeyImpl(name)) +CipherKey::CipherKey(const std::string& rName): + _pImpl(new CipherKeyImpl(rName)) { } diff --git a/Crypto/src/CipherKeyImpl.cpp b/Crypto/src/CipherKeyImpl.cpp index 7f496aa07..cac2df8c6 100644 --- a/Crypto/src/CipherKeyImpl.cpp +++ b/Crypto/src/CipherKeyImpl.cpp @@ -27,28 +27,28 @@ namespace Poco { namespace Crypto { -CipherKeyImpl::CipherKeyImpl(const std::string& name, +CipherKeyImpl::CipherKeyImpl(const std::string& rName, const std::string& passphrase, const std::string& salt, int iterationCount, - const std::string& digest): + const std::string& rDigest): _pCipher(0), _pDigest(0), - _name(name), + _name(rName), _key(), _iv() { // dummy access to Cipherfactory so that the EVP lib is initilaized CipherFactory::defaultFactory(); - _pCipher = EVP_get_cipherbyname(name.c_str()); + _pCipher = EVP_get_cipherbyname(rName.c_str()); if (!_pCipher) - throw Poco::NotFoundException("Cipher " + name + " was not found"); + throw Poco::NotFoundException("Cipher " + rName + " was not found"); - _pDigest = EVP_get_digestbyname(digest.c_str()); + _pDigest = EVP_get_digestbyname(rDigest.c_str()); if (!_pDigest) - throw Poco::NotFoundException("Digest " + name + " was not found"); + throw Poco::NotFoundException("Digest " + rName + " was not found"); _key = ByteVec(keySize()); @@ -57,35 +57,35 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name, } -CipherKeyImpl::CipherKeyImpl(const std::string& name, +CipherKeyImpl::CipherKeyImpl(const std::string& rName, const ByteVec& key, const ByteVec& iv): _pCipher(0), - _name(name), + _name(rName), _key(key), _iv(iv) { // dummy access to Cipherfactory so that the EVP lib is initilaized CipherFactory::defaultFactory(); - _pCipher = EVP_get_cipherbyname(name.c_str()); + _pCipher = EVP_get_cipherbyname(rName.c_str()); if (!_pCipher) - throw Poco::NotFoundException("Cipher " + name + " was not found"); + throw Poco::NotFoundException("Cipher " + rName + " was not found"); } -CipherKeyImpl::CipherKeyImpl(const std::string& name): +CipherKeyImpl::CipherKeyImpl(const std::string& rName): _pCipher(0), - _name(name), + _name(rName), _key(), _iv() { // dummy access to Cipherfactory so that the EVP lib is initilaized CipherFactory::defaultFactory(); - _pCipher = EVP_get_cipherbyname(name.c_str()); + _pCipher = EVP_get_cipherbyname(rName.c_str()); if (!_pCipher) - throw Poco::NotFoundException("Cipher " + name + " was not found"); + throw Poco::NotFoundException("Cipher " + rName + " was not found"); _key = ByteVec(keySize()); _iv = ByteVec(ivSize()); generateKey(); @@ -165,7 +165,7 @@ void CipherKeyImpl::generateKey( } // Now create the key and IV, using the digest set in the constructor. - int keySize = EVP_BytesToKey( + int cipherKeySize = EVP_BytesToKey( _pCipher, _pDigest, (salt.empty() ? 0 : saltBytes), @@ -176,7 +176,7 @@ void CipherKeyImpl::generateKey( ivBytes); // Copy the buffers to our member byte vectors. - _key.assign(keyBytes, keyBytes + keySize); + _key.assign(keyBytes, keyBytes + cipherKeySize); if (ivSize() == 0) _iv.clear(); diff --git a/Crypto/src/RSAKeyImpl.cpp b/Crypto/src/RSAKeyImpl.cpp index 8333453ce..8c917497c 100644 --- a/Crypto/src/RSAKeyImpl.cpp +++ b/Crypto/src/RSAKeyImpl.cpp @@ -87,10 +87,10 @@ RSAKeyImpl::RSAKeyImpl( RSA* pubKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, 0, 0); if (!pubKey) { - int rc = BIO_reset(bio); + int ret = BIO_reset(bio); // BIO_reset() normally returns 1 for success and 0 or -1 for failure. // File BIOs are an exception, they return 0 for success and -1 for failure. - if (rc != 0) throw Poco::FileException("Failed to load public key", publicKeyFile); + if (ret != 0) throw Poco::FileException("Failed to load public key", publicKeyFile); pubKey = PEM_read_bio_RSA_PUBKEY(bio, &_pRSA, 0, 0); } BIO_free(bio); @@ -287,8 +287,8 @@ void RSAKeyImpl::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyS throw Poco::WriteFileException("Failed to write public key to stream"); } char* pData; - long size = BIO_get_mem_data(bio, &pData); - pPublicKeyStream->write(pData, static_cast(size)); + long keySize = BIO_get_mem_data(bio, &pData); + pPublicKeyStream->write(pData, static_cast(keySize)); BIO_free(bio); } @@ -309,8 +309,8 @@ void RSAKeyImpl::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyS throw Poco::FileException("Failed to write private key to stream"); } char* pData; - long size = BIO_get_mem_data(bio, &pData); - pPrivateKeyStream->write(pData, static_cast(size)); + long keySize = BIO_get_mem_data(bio, &pData); + pPrivateKeyStream->write(pData, static_cast(keySize)); BIO_free(bio); } } From bc22588895834760c750e7ec75a7ae09ecdd58ea Mon Sep 17 00:00:00 2001 From: FrancisANDRE Date: Tue, 5 Jan 2016 05:20:40 +0100 Subject: [PATCH 02/23] .bashrc exists only with bash shell while .profile exists always Signed-off-by: FrancisANDRE --- Foundation/testsuite/src/PathTest.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Foundation/testsuite/src/PathTest.cpp b/Foundation/testsuite/src/PathTest.cpp index 2e5c563c2..a601e8067 100644 --- a/Foundation/testsuite/src/PathTest.cpp +++ b/Foundation/testsuite/src/PathTest.cpp @@ -1511,15 +1511,15 @@ void PathTest::testForDirectory() void PathTest::testExpand() { #if defined(POCO_OS_FAMILY_UNIX) - std::string s = Path::expand("~/.bashrc"); - assert (s == Path::expand("$HOME/.bashrc")); - assert (s == Environment::get("HOME") + "/.bashrc" || - s == Environment::get("HOME") + "//.bashrc"); + std::string s = Path::expand("~/.profile"); + assert (s == Path::expand("$HOME/.profile")); + assert (s == Environment::get("HOME") + "/.profile" || + s == Environment::get("HOME") + "//.profile"); Path p(s); - s = Path::expand("$HOME/.bashrc"); - assert (s == Path::expand("~/.bashrc")); - s = Path::expand("${HOME}/.bashrc"); - assert (s == Path::expand("~/.bashrc")); + s = Path::expand("$HOME/.profile"); + assert (s == Path::expand("~/.profile")); + s = Path::expand("${HOME}/.profile"); + assert (s == Path::expand("~/.profile")); #elif defined(POCO_OS_FAMILY_WINDOWS) std::string s = Path::expand("%TMP%\\foo"); assert (s == Environment::get("TMP") + "\\foo"); From 0425866486a4652f999d71c359d3645f3aad4ce9 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 9 Jan 2016 02:16:55 +0300 Subject: [PATCH 03/23] Allow for process termination when polling with isRunning On *NIX, one needs to call `waitpid()` in order for process to exit the zombie state. If one uses `Process::isRunning()` to emulate non-blocking wait for child process termination, process will stay zombie and function will always return true. This commit changes `Process::isRunning()` to call `waitpid()` with `WNOHANG` instead of using `kill()` when checking for child process (i.e. the one we have ProcessHandle for), which allows for process termination. Additional trickery with mutex and event is needed to prevent exceptions when `Process::isRunning()` and/or `Process::wait()` is called concurrently on the same handle from different threads. Fixes #1097. --- Foundation/include/Poco/Process_UNIX.h | 9 +++- Foundation/src/Process_UNIX.cpp | 60 ++++++++++++++++++++---- Foundation/testsuite/src/ProcessTest.cpp | 23 +++++++++ Foundation/testsuite/src/ProcessTest.h | 1 + 4 files changed, 82 insertions(+), 11 deletions(-) diff --git a/Foundation/include/Poco/Process_UNIX.h b/Foundation/include/Poco/Process_UNIX.h index 76d17c8a7..9678abd85 100644 --- a/Foundation/include/Poco/Process_UNIX.h +++ b/Foundation/include/Poco/Process_UNIX.h @@ -21,6 +21,9 @@ #include "Poco/Foundation.h" +#include "Poco/Event.h" +#include "Poco/Mutex.h" +#include "Poco/Optional.h" #include "Poco/RefCountedObject.h" #include #include @@ -41,9 +44,13 @@ public: pid_t id() const; int wait() const; + int wait(int options) const; private: - pid_t _pid; + const pid_t _pid; + mutable FastMutex _mutex; + mutable Event _event; + mutable Optional _status; }; diff --git a/Foundation/src/Process_UNIX.cpp b/Foundation/src/Process_UNIX.cpp index 73c1dafc4..1640626ab 100644 --- a/Foundation/src/Process_UNIX.cpp +++ b/Foundation/src/Process_UNIX.cpp @@ -18,6 +18,7 @@ #include "Poco/Exception.h" #include "Poco/NumberFormatter.h" #include "Poco/Pipe.h" +#include "Poco/Thread.h" #include #include #include @@ -42,7 +43,10 @@ namespace Poco { // ProcessHandleImpl // ProcessHandleImpl::ProcessHandleImpl(pid_t pid): - _pid(pid) + _pid(pid), + _mutex(), + _event(Event::EVENT_MANUALRESET), + _status() { } @@ -60,24 +64,60 @@ pid_t ProcessHandleImpl::id() const int ProcessHandleImpl::wait() const { - int status; - int rc; - do - { - rc = waitpid(_pid, &status, 0); - } - while (rc < 0 && errno == EINTR); - if (rc != _pid) + if (wait(0) != _pid) throw SystemException("Cannot wait for process", NumberFormatter::format(_pid)); + + const int status = _status.value(); if (WIFEXITED(status)) return WEXITSTATUS(status); if (WIFSIGNALED(status)) return -WTERMSIG(status); + // This line should never be reached. return std::numeric_limits::max(); } +int ProcessHandleImpl::wait(int options) const +{ + { + FastMutex::ScopedLock lock(_mutex); + if (_status.isSpecified()) + { + return _pid; + } + } + + int status; + int rc; + do + { + rc = waitpid(_pid, &status, options); + } + while (rc < 0 && errno == EINTR); + + if (rc == _pid) + { + FastMutex::ScopedLock lock(_mutex); + _status = status; + _event.set(); + } + else if (rc < 0 && errno == ECHILD) + { + // Looks like another thread was lucky and it should update the status for us shortly + _event.wait(); + + FastMutex::ScopedLock lock(_mutex); + if (_status.isSpecified()) + { + rc = _pid; + } + } + + return rc; +} + + // // ProcessImpl // @@ -251,7 +291,7 @@ void ProcessImpl::killImpl(PIDImpl pid) bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle) { - return isRunningImpl(handle.id()); + return handle.wait(WNOHANG) == 0; } diff --git a/Foundation/testsuite/src/ProcessTest.cpp b/Foundation/testsuite/src/ProcessTest.cpp index 71d6eabb3..1226f4a66 100644 --- a/Foundation/testsuite/src/ProcessTest.cpp +++ b/Foundation/testsuite/src/ProcessTest.cpp @@ -16,6 +16,7 @@ #include "Poco/Process.h" #include "Poco/Pipe.h" #include "Poco/PipeStream.h" +#include "Poco/Thread.h" #include @@ -176,6 +177,27 @@ void ProcessTest::testIsRunning() } +void ProcessTest::testIsRunningAllowsForTermination() +{ +#if !defined(_WIN32_WCE) + std::string name("TestApp"); + std::string cmd; + +#if defined(POCO_OS_FAMILY_UNIX) + cmd = "./"; + cmd += name; +#else + cmd = name; +#endif + + std::vector args; + ProcessHandle ph = Process::launch(cmd, args, 0, 0, 0); + while (Process::isRunning(ph)) + Poco::Thread::sleep(100); +#endif // !defined(_WIN32_WCE) +} + + void ProcessTest::testSignalExitCode() { #if defined(POCO_OS_FAMILY_UNIX) @@ -213,6 +235,7 @@ CppUnit::Test* ProcessTest::suite() CppUnit_addTest(pSuite, ProcessTest, testLaunchRedirectOut); CppUnit_addTest(pSuite, ProcessTest, testLaunchEnv); CppUnit_addTest(pSuite, ProcessTest, testIsRunning); + CppUnit_addTest(pSuite, ProcessTest, testIsRunningAllowsForTermination); CppUnit_addTest(pSuite, ProcessTest, testSignalExitCode); return pSuite; diff --git a/Foundation/testsuite/src/ProcessTest.h b/Foundation/testsuite/src/ProcessTest.h index e22c2b7e6..7a0e323f1 100644 --- a/Foundation/testsuite/src/ProcessTest.h +++ b/Foundation/testsuite/src/ProcessTest.h @@ -31,6 +31,7 @@ public: void testLaunchRedirectOut(); void testLaunchEnv(); void testIsRunning(); + void testIsRunningAllowsForTermination(); void testSignalExitCode(); void setUp(); From c39c0aaf9d0d3f589131c35ef55c11f7c39d7dca Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 11 Jan 2016 09:11:46 +0100 Subject: [PATCH 04/23] GH #1050 CppUnit: fix gcc -Wshadow warnings Also in Foundation tests. --- CppUnit/include/CppUnit/CppUnitException.h | 6 +++--- CppUnit/include/CppUnit/TestCaller.h | 6 +++--- CppUnit/include/CppUnit/TestCase.h | 2 +- CppUnit/include/CppUnit/TestFailure.h | 2 +- .../samples/NotificationQueue/src/NotificationQueue.cpp | 4 ++-- Foundation/testsuite/src/ActiveDispatcherTest.cpp | 2 +- Foundation/testsuite/src/ActiveMethodTest.cpp | 2 +- Foundation/testsuite/src/ActivityTest.cpp | 2 +- Foundation/testsuite/src/AnyTest.cpp | 2 +- Foundation/testsuite/src/ArrayTest.cpp | 2 +- Foundation/testsuite/src/AutoPtrTest.cpp | 2 +- Foundation/testsuite/src/AutoReleasePoolTest.cpp | 2 +- Foundation/testsuite/src/Base32Test.cpp | 2 +- Foundation/testsuite/src/Base64Test.cpp | 2 +- Foundation/testsuite/src/BasicEventTest.cpp | 2 +- Foundation/testsuite/src/BinaryReaderWriterTest.cpp | 2 +- Foundation/testsuite/src/ByteOrderTest.cpp | 2 +- Foundation/testsuite/src/ChannelTest.cpp | 2 +- Foundation/testsuite/src/ClassLoaderTest.cpp | 2 +- Foundation/testsuite/src/ClockTest.cpp | 2 +- Foundation/testsuite/src/ConditionTest.cpp | 2 +- Foundation/testsuite/src/CoreTest.cpp | 2 +- Foundation/testsuite/src/CountingStreamTest.cpp | 2 +- Foundation/testsuite/src/DateTimeFormatterTest.cpp | 4 ++-- Foundation/testsuite/src/DateTimeParserTest.cpp | 2 +- Foundation/testsuite/src/DateTimeTest.cpp | 2 +- Foundation/testsuite/src/DigestStreamTest.cpp | 2 +- Foundation/testsuite/src/DirectoryIteratorsTest.cpp | 4 ++-- Foundation/testsuite/src/DirectoryWatcherTest.cpp | 4 ++-- Foundation/testsuite/src/DynamicFactoryTest.cpp | 2 +- Foundation/testsuite/src/ExpireCacheTest.cpp | 2 +- Foundation/testsuite/src/ExpireLRUCacheTest.cpp | 2 +- Foundation/testsuite/src/FIFOBufferStreamTest.cpp | 2 +- Foundation/testsuite/src/FIFOBufferTest.cpp | 4 ++-- Foundation/testsuite/src/FIFOEventTest.cpp | 2 +- Foundation/testsuite/src/FPETest.cpp | 2 +- Foundation/testsuite/src/FileChannelTest.cpp | 2 +- Foundation/testsuite/src/FileStreamTest.cpp | 2 +- Foundation/testsuite/src/FileTest.cpp | 2 +- Foundation/testsuite/src/FormatTest.cpp | 2 +- Foundation/testsuite/src/GlobTest.cpp | 2 +- Foundation/testsuite/src/HMACEngineTest.cpp | 2 +- Foundation/testsuite/src/HashMapTest.cpp | 2 +- Foundation/testsuite/src/HashSetTest.cpp | 2 +- Foundation/testsuite/src/HashTableTest.cpp | 2 +- Foundation/testsuite/src/HexBinaryTest.cpp | 2 +- Foundation/testsuite/src/LRUCacheTest.cpp | 2 +- Foundation/testsuite/src/LineEndingConverterTest.cpp | 2 +- Foundation/testsuite/src/LinearHashTableTest.cpp | 2 +- Foundation/testsuite/src/ListMapTest.cpp | 2 +- Foundation/testsuite/src/LocalDateTimeTest.cpp | 2 +- Foundation/testsuite/src/LogStreamTest.cpp | 2 +- Foundation/testsuite/src/LoggerTest.cpp | 2 +- Foundation/testsuite/src/LoggingFactoryTest.cpp | 2 +- Foundation/testsuite/src/LoggingRegistryTest.cpp | 2 +- Foundation/testsuite/src/MD4EngineTest.cpp | 2 +- Foundation/testsuite/src/MD5EngineTest.cpp | 2 +- Foundation/testsuite/src/ManifestTest.cpp | 2 +- Foundation/testsuite/src/MemoryPoolTest.cpp | 2 +- Foundation/testsuite/src/MemoryStreamTest.cpp | 2 +- Foundation/testsuite/src/MutexTest.cpp | 2 +- Foundation/testsuite/src/NDCTest.cpp | 2 +- Foundation/testsuite/src/NamedEventTest.cpp | 2 +- Foundation/testsuite/src/NamedMutexTest.cpp | 2 +- Foundation/testsuite/src/NamedTuplesTest.cpp | 2 +- Foundation/testsuite/src/NotificationCenterTest.cpp | 2 +- Foundation/testsuite/src/NotificationQueueTest.cpp | 2 +- Foundation/testsuite/src/NullStreamTest.cpp | 2 +- Foundation/testsuite/src/NumberFormatterTest.cpp | 2 +- Foundation/testsuite/src/NumberParserTest.cpp | 2 +- Foundation/testsuite/src/ObjectPoolTest.cpp | 2 +- Foundation/testsuite/src/PBKDF2EngineTest.cpp | 2 +- Foundation/testsuite/src/PathTest.cpp | 2 +- Foundation/testsuite/src/PatternFormatterTest.cpp | 2 +- Foundation/testsuite/src/PriorityEventTest.cpp | 2 +- Foundation/testsuite/src/PriorityNotificationQueueTest.cpp | 2 +- Foundation/testsuite/src/ProcessTest.cpp | 2 +- Foundation/testsuite/src/RWLockTest.cpp | 2 +- Foundation/testsuite/src/RandomStreamTest.cpp | 2 +- Foundation/testsuite/src/RandomTest.cpp | 2 +- Foundation/testsuite/src/RegularExpressionTest.cpp | 2 +- Foundation/testsuite/src/SHA1EngineTest.cpp | 2 +- Foundation/testsuite/src/SemaphoreTest.cpp | 2 +- Foundation/testsuite/src/SharedLibraryTest.cpp | 2 +- Foundation/testsuite/src/SharedMemoryTest.cpp | 2 +- Foundation/testsuite/src/SharedPtrTest.cpp | 4 ++-- Foundation/testsuite/src/SimpleFileChannelTest.cpp | 2 +- Foundation/testsuite/src/SimpleHashTableTest.cpp | 2 +- Foundation/testsuite/src/StopwatchTest.cpp | 2 +- Foundation/testsuite/src/StreamConverterTest.cpp | 2 +- Foundation/testsuite/src/StreamCopierTest.cpp | 2 +- Foundation/testsuite/src/StreamTokenizerTest.cpp | 2 +- Foundation/testsuite/src/StringTest.cpp | 2 +- Foundation/testsuite/src/StringTokenizerTest.cpp | 2 +- Foundation/testsuite/src/TaskManagerTest.cpp | 2 +- Foundation/testsuite/src/TaskTest.cpp | 2 +- Foundation/testsuite/src/TeeStreamTest.cpp | 2 +- Foundation/testsuite/src/TextBufferIteratorTest.cpp | 2 +- Foundation/testsuite/src/TextConverterTest.cpp | 2 +- Foundation/testsuite/src/TextEncodingTest.cpp | 2 +- Foundation/testsuite/src/TextIteratorTest.cpp | 2 +- Foundation/testsuite/src/ThreadLocalTest.cpp | 2 +- Foundation/testsuite/src/ThreadPoolTest.cpp | 2 +- Foundation/testsuite/src/ThreadTest.cpp | 2 +- Foundation/testsuite/src/TimedNotificationQueueTest.cpp | 2 +- Foundation/testsuite/src/TimerTest.cpp | 2 +- Foundation/testsuite/src/TimespanTest.cpp | 2 +- Foundation/testsuite/src/TimestampTest.cpp | 2 +- Foundation/testsuite/src/TimezoneTest.cpp | 6 +++--- Foundation/testsuite/src/TuplesTest.cpp | 2 +- Foundation/testsuite/src/TypeListTest.cpp | 2 +- Foundation/testsuite/src/URIStreamOpenerTest.cpp | 2 +- Foundation/testsuite/src/URITest.cpp | 2 +- Foundation/testsuite/src/UTF8StringTest.cpp | 2 +- Foundation/testsuite/src/UUIDGeneratorTest.cpp | 2 +- Foundation/testsuite/src/UUIDTest.cpp | 2 +- Foundation/testsuite/src/UnicodeConverterTest.cpp | 2 +- Foundation/testsuite/src/UniqueExpireCacheTest.cpp | 2 +- Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp | 2 +- Foundation/testsuite/src/VarTest.cpp | 2 +- Foundation/testsuite/src/ZLibTest.cpp | 2 +- 121 files changed, 133 insertions(+), 133 deletions(-) diff --git a/CppUnit/include/CppUnit/CppUnitException.h b/CppUnit/include/CppUnit/CppUnitException.h index 27c50a3cb..902354256 100644 --- a/CppUnit/include/CppUnit/CppUnitException.h +++ b/CppUnit/include/CppUnit/CppUnitException.h @@ -68,17 +68,17 @@ inline CppUnitException::CppUnitException(const CppUnitException& other): except } -inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName) +inline CppUnitException::CppUnitException (const std::string& message, long exceptionLineNumber, const std::string& rFileName): _message(message), _lineNumber(exceptionLineNumber), _data1lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(rFileName) { } -inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(fileName) +inline CppUnitException::CppUnitException (const std::string& message, long exceptionLineNumber, long data1lineNumber, const std::string& rFileName): _message(message), _lineNumber(exceptionLineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(CPPUNIT_UNKNOWNLINENUMBER), _fileName(rFileName) { } -inline CppUnitException::CppUnitException (const std::string& message, long lineNumber, long data1lineNumber, long data2lineNumber, const std::string& fileName): _message(message), _lineNumber(lineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(fileName) +inline CppUnitException::CppUnitException (const std::string& message, long exceptionLineNumber, long data1lineNumber, long data2lineNumber, const std::string& rFileName): _message(message), _lineNumber(exceptionLineNumber), _data1lineNumber(data1lineNumber), _data2lineNumber(data2lineNumber), _fileName(rFileName) { } diff --git a/CppUnit/include/CppUnit/TestCaller.h b/CppUnit/include/CppUnit/TestCaller.h index 1c555939d..ef2909468 100644 --- a/CppUnit/include/CppUnit/TestCaller.h +++ b/CppUnit/include/CppUnit/TestCaller.h @@ -56,10 +56,10 @@ class TestCaller: public TestCase typedef void (Fixture::*TestMethod)(); public: - TestCaller(const std::string& name, TestMethod test): - TestCase(name), + TestCaller(const std::string& rName, TestMethod test): + TestCase(rName), _test(test), - _fixture(new Fixture(name)) + _fixture(new Fixture(rName)) { } diff --git a/CppUnit/include/CppUnit/TestCase.h b/CppUnit/include/CppUnit/TestCase.h index 60b07b811..30188e9ee 100644 --- a/CppUnit/include/CppUnit/TestCase.h +++ b/CppUnit/include/CppUnit/TestCase.h @@ -173,7 +173,7 @@ protected: // Constructs a test case -inline TestCase::TestCase(const std::string& name): _name (name) +inline TestCase::TestCase(const std::string& rName): _name (rName) { } diff --git a/CppUnit/include/CppUnit/TestFailure.h b/CppUnit/include/CppUnit/TestFailure.h index c1f845d72..be54d7e4e 100644 --- a/CppUnit/include/CppUnit/TestFailure.h +++ b/CppUnit/include/CppUnit/TestFailure.h @@ -52,7 +52,7 @@ protected: // Constructs a TestFailure with the given test and exception. -inline TestFailure::TestFailure(Test* failedTest, CppUnitException* thrownException): _failedTest(failedTest), _thrownException(thrownException) +inline TestFailure::TestFailure(Test* pFailedTest, CppUnitException* pThrownException): _failedTest(pFailedTest), _thrownException(pThrownException) { } diff --git a/Foundation/samples/NotificationQueue/src/NotificationQueue.cpp b/Foundation/samples/NotificationQueue/src/NotificationQueue.cpp index d6a5af3c3..e1412ec4f 100644 --- a/Foundation/samples/NotificationQueue/src/NotificationQueue.cpp +++ b/Foundation/samples/NotificationQueue/src/NotificationQueue.cpp @@ -39,8 +39,8 @@ class WorkNotification: public Notification public: typedef AutoPtr Ptr; - WorkNotification(int data): - _data(data) + WorkNotification(int workData): + _data(workData) { } diff --git a/Foundation/testsuite/src/ActiveDispatcherTest.cpp b/Foundation/testsuite/src/ActiveDispatcherTest.cpp index d59bb6b4e..caa721d67 100644 --- a/Foundation/testsuite/src/ActiveDispatcherTest.cpp +++ b/Foundation/testsuite/src/ActiveDispatcherTest.cpp @@ -90,7 +90,7 @@ namespace } -ActiveDispatcherTest::ActiveDispatcherTest(const std::string& name): CppUnit::TestCase(name) +ActiveDispatcherTest::ActiveDispatcherTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ActiveMethodTest.cpp b/Foundation/testsuite/src/ActiveMethodTest.cpp index 5d28ee330..15eb7b380 100644 --- a/Foundation/testsuite/src/ActiveMethodTest.cpp +++ b/Foundation/testsuite/src/ActiveMethodTest.cpp @@ -92,7 +92,7 @@ namespace } -ActiveMethodTest::ActiveMethodTest(const std::string& name): CppUnit::TestCase(name) +ActiveMethodTest::ActiveMethodTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ActivityTest.cpp b/Foundation/testsuite/src/ActivityTest.cpp index 8c0bce179..cf67d14d6 100644 --- a/Foundation/testsuite/src/ActivityTest.cpp +++ b/Foundation/testsuite/src/ActivityTest.cpp @@ -60,7 +60,7 @@ namespace } -ActivityTest::ActivityTest(const std::string& name): CppUnit::TestCase(name) +ActivityTest::ActivityTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/AnyTest.cpp b/Foundation/testsuite/src/AnyTest.cpp index cd2b0da6e..87102d9a1 100644 --- a/Foundation/testsuite/src/AnyTest.cpp +++ b/Foundation/testsuite/src/AnyTest.cpp @@ -42,7 +42,7 @@ public: }; -AnyTest::AnyTest(const std::string& name): CppUnit::TestCase(name) +AnyTest::AnyTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ArrayTest.cpp b/Foundation/testsuite/src/ArrayTest.cpp index 55c492731..30e94ca49 100644 --- a/Foundation/testsuite/src/ArrayTest.cpp +++ b/Foundation/testsuite/src/ArrayTest.cpp @@ -18,7 +18,7 @@ #include #include -ArrayTest::ArrayTest(const std::string& name): CppUnit::TestCase(name) +ArrayTest::ArrayTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/AutoPtrTest.cpp b/Foundation/testsuite/src/AutoPtrTest.cpp index 31717aeab..7332ffc00 100644 --- a/Foundation/testsuite/src/AutoPtrTest.cpp +++ b/Foundation/testsuite/src/AutoPtrTest.cpp @@ -67,7 +67,7 @@ namespace } -AutoPtrTest::AutoPtrTest(const std::string& name): CppUnit::TestCase(name) +AutoPtrTest::AutoPtrTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/AutoReleasePoolTest.cpp b/Foundation/testsuite/src/AutoReleasePoolTest.cpp index 6db568d12..e3d7934bd 100644 --- a/Foundation/testsuite/src/AutoReleasePoolTest.cpp +++ b/Foundation/testsuite/src/AutoReleasePoolTest.cpp @@ -65,7 +65,7 @@ namespace } -AutoReleasePoolTest::AutoReleasePoolTest(const std::string& name): CppUnit::TestCase(name) +AutoReleasePoolTest::AutoReleasePoolTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/Base32Test.cpp b/Foundation/testsuite/src/Base32Test.cpp index 4bc1c33d4..6fca5e3d6 100644 --- a/Foundation/testsuite/src/Base32Test.cpp +++ b/Foundation/testsuite/src/Base32Test.cpp @@ -24,7 +24,7 @@ using Poco::Base32Decoder; using Poco::DataFormatException; -Base32Test::Base32Test(const std::string& name): CppUnit::TestCase(name) +Base32Test::Base32Test(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/Base64Test.cpp b/Foundation/testsuite/src/Base64Test.cpp index f5af89e09..0d91ebedb 100644 --- a/Foundation/testsuite/src/Base64Test.cpp +++ b/Foundation/testsuite/src/Base64Test.cpp @@ -24,7 +24,7 @@ using Poco::Base64Decoder; using Poco::DataFormatException; -Base64Test::Base64Test(const std::string& name): CppUnit::TestCase(name) +Base64Test::Base64Test(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/BasicEventTest.cpp b/Foundation/testsuite/src/BasicEventTest.cpp index f593c1a79..ef59f5dc1 100644 --- a/Foundation/testsuite/src/BasicEventTest.cpp +++ b/Foundation/testsuite/src/BasicEventTest.cpp @@ -27,7 +27,7 @@ using namespace Poco; #define LARGEINC 100 -BasicEventTest::BasicEventTest(const std::string& name): CppUnit::TestCase(name) +BasicEventTest::BasicEventTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/BinaryReaderWriterTest.cpp b/Foundation/testsuite/src/BinaryReaderWriterTest.cpp index b9f689908..13bfeb515 100644 --- a/Foundation/testsuite/src/BinaryReaderWriterTest.cpp +++ b/Foundation/testsuite/src/BinaryReaderWriterTest.cpp @@ -30,7 +30,7 @@ using Poco::Int64; using Poco::UInt64; -BinaryReaderWriterTest::BinaryReaderWriterTest(const std::string& name): CppUnit::TestCase(name) +BinaryReaderWriterTest::BinaryReaderWriterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ByteOrderTest.cpp b/Foundation/testsuite/src/ByteOrderTest.cpp index f34cb8616..ca789d5b1 100644 --- a/Foundation/testsuite/src/ByteOrderTest.cpp +++ b/Foundation/testsuite/src/ByteOrderTest.cpp @@ -27,7 +27,7 @@ using Poco::UInt64; #endif -ByteOrderTest::ByteOrderTest(const std::string& name): CppUnit::TestCase(name) +ByteOrderTest::ByteOrderTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ChannelTest.cpp b/Foundation/testsuite/src/ChannelTest.cpp index 270d63a05..89ec30926 100644 --- a/Foundation/testsuite/src/ChannelTest.cpp +++ b/Foundation/testsuite/src/ChannelTest.cpp @@ -47,7 +47,7 @@ public: }; -ChannelTest::ChannelTest(const std::string& name): CppUnit::TestCase(name) +ChannelTest::ChannelTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ClassLoaderTest.cpp b/Foundation/testsuite/src/ClassLoaderTest.cpp index a0e24104f..ae683fb1e 100644 --- a/Foundation/testsuite/src/ClassLoaderTest.cpp +++ b/Foundation/testsuite/src/ClassLoaderTest.cpp @@ -27,7 +27,7 @@ using Poco::NotFoundException; using Poco::InvalidAccessException; -ClassLoaderTest::ClassLoaderTest(const std::string& name): CppUnit::TestCase(name) +ClassLoaderTest::ClassLoaderTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ClockTest.cpp b/Foundation/testsuite/src/ClockTest.cpp index 6adbf72f3..98c2fc77b 100644 --- a/Foundation/testsuite/src/ClockTest.cpp +++ b/Foundation/testsuite/src/ClockTest.cpp @@ -22,7 +22,7 @@ using Poco::Clock; using Poco::Thread; -ClockTest::ClockTest(const std::string& name): CppUnit::TestCase(name) +ClockTest::ClockTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ConditionTest.cpp b/Foundation/testsuite/src/ConditionTest.cpp index 9f341a6ce..40bc3b186 100644 --- a/Foundation/testsuite/src/ConditionTest.cpp +++ b/Foundation/testsuite/src/ConditionTest.cpp @@ -92,7 +92,7 @@ namespace } -ConditionTest::ConditionTest(const std::string& name): CppUnit::TestCase(name) +ConditionTest::ConditionTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/CoreTest.cpp b/Foundation/testsuite/src/CoreTest.cpp index fe1a73dca..160f31d99 100644 --- a/Foundation/testsuite/src/CoreTest.cpp +++ b/Foundation/testsuite/src/CoreTest.cpp @@ -112,7 +112,7 @@ struct Large #define ENABLE_BUGCHECK_TEST 0 -CoreTest::CoreTest(const std::string& name): CppUnit::TestCase(name) +CoreTest::CoreTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/CountingStreamTest.cpp b/Foundation/testsuite/src/CountingStreamTest.cpp index be7ade9e3..66a8a789d 100644 --- a/Foundation/testsuite/src/CountingStreamTest.cpp +++ b/Foundation/testsuite/src/CountingStreamTest.cpp @@ -21,7 +21,7 @@ using Poco::CountingInputStream; using Poco::CountingOutputStream; -CountingStreamTest::CountingStreamTest(const std::string& name): CppUnit::TestCase(name) +CountingStreamTest::CountingStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/DateTimeFormatterTest.cpp b/Foundation/testsuite/src/DateTimeFormatterTest.cpp index f6b4b11b1..f77ec4cba 100644 --- a/Foundation/testsuite/src/DateTimeFormatterTest.cpp +++ b/Foundation/testsuite/src/DateTimeFormatterTest.cpp @@ -25,8 +25,8 @@ using Poco::DateTimeFormat; using Poco::DateTimeFormatter; -DateTimeFormatterTest::DateTimeFormatterTest(const std::string& name) - : CppUnit::TestCase(name) +DateTimeFormatterTest::DateTimeFormatterTest(const std::string& rName) + : CppUnit::TestCase(rName) { // Linker regresion SF #3288584 std::string message; diff --git a/Foundation/testsuite/src/DateTimeParserTest.cpp b/Foundation/testsuite/src/DateTimeParserTest.cpp index 57322c3e3..6a695a533 100644 --- a/Foundation/testsuite/src/DateTimeParserTest.cpp +++ b/Foundation/testsuite/src/DateTimeParserTest.cpp @@ -27,7 +27,7 @@ using Poco::Timestamp; using Poco::SyntaxException; -DateTimeParserTest::DateTimeParserTest(const std::string& name): CppUnit::TestCase(name) +DateTimeParserTest::DateTimeParserTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/DateTimeTest.cpp b/Foundation/testsuite/src/DateTimeTest.cpp index 969e7bc9b..4b416eed5 100644 --- a/Foundation/testsuite/src/DateTimeTest.cpp +++ b/Foundation/testsuite/src/DateTimeTest.cpp @@ -25,7 +25,7 @@ using Poco::Timespan; using Poco::AssertionViolationException; -DateTimeTest::DateTimeTest(const std::string& name): CppUnit::TestCase(name) +DateTimeTest::DateTimeTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/DigestStreamTest.cpp b/Foundation/testsuite/src/DigestStreamTest.cpp index ba8982987..cc7119233 100644 --- a/Foundation/testsuite/src/DigestStreamTest.cpp +++ b/Foundation/testsuite/src/DigestStreamTest.cpp @@ -25,7 +25,7 @@ using Poco::DigestEngine; using Poco::MD5Engine; -DigestStreamTest::DigestStreamTest(const std::string& name): CppUnit::TestCase(name) +DigestStreamTest::DigestStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/DirectoryIteratorsTest.cpp b/Foundation/testsuite/src/DirectoryIteratorsTest.cpp index d2d94ff79..6ba58e8c7 100644 --- a/Foundation/testsuite/src/DirectoryIteratorsTest.cpp +++ b/Foundation/testsuite/src/DirectoryIteratorsTest.cpp @@ -23,8 +23,8 @@ using namespace Poco; -DirectoryIteratorsTest::DirectoryIteratorsTest(const std::string& name): - CppUnit::TestCase(name) +DirectoryIteratorsTest::DirectoryIteratorsTest(const std::string& rName): + CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/DirectoryWatcherTest.cpp b/Foundation/testsuite/src/DirectoryWatcherTest.cpp index 24c718949..40b07898c 100644 --- a/Foundation/testsuite/src/DirectoryWatcherTest.cpp +++ b/Foundation/testsuite/src/DirectoryWatcherTest.cpp @@ -26,8 +26,8 @@ using Poco::DirectoryWatcher; -DirectoryWatcherTest::DirectoryWatcherTest(const std::string& name): - CppUnit::TestCase(name), +DirectoryWatcherTest::DirectoryWatcherTest(const std::string& rName): + CppUnit::TestCase(rName), _error(false) { } diff --git a/Foundation/testsuite/src/DynamicFactoryTest.cpp b/Foundation/testsuite/src/DynamicFactoryTest.cpp index 478aace1c..67ce5e0b2 100644 --- a/Foundation/testsuite/src/DynamicFactoryTest.cpp +++ b/Foundation/testsuite/src/DynamicFactoryTest.cpp @@ -46,7 +46,7 @@ namespace } -DynamicFactoryTest::DynamicFactoryTest(const std::string& name): CppUnit::TestCase(name) +DynamicFactoryTest::DynamicFactoryTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ExpireCacheTest.cpp b/Foundation/testsuite/src/ExpireCacheTest.cpp index 0e8cde480..1c64a7159 100644 --- a/Foundation/testsuite/src/ExpireCacheTest.cpp +++ b/Foundation/testsuite/src/ExpireCacheTest.cpp @@ -28,7 +28,7 @@ using namespace Poco; #define DURWAIT 300 -ExpireCacheTest::ExpireCacheTest(const std::string& name): CppUnit::TestCase(name) +ExpireCacheTest::ExpireCacheTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ExpireLRUCacheTest.cpp b/Foundation/testsuite/src/ExpireLRUCacheTest.cpp index 31ef4baaf..304268dd6 100644 --- a/Foundation/testsuite/src/ExpireLRUCacheTest.cpp +++ b/Foundation/testsuite/src/ExpireLRUCacheTest.cpp @@ -28,7 +28,7 @@ using namespace Poco; #define DURWAIT 300 -ExpireLRUCacheTest::ExpireLRUCacheTest(const std::string& name): CppUnit::TestCase(name) +ExpireLRUCacheTest::ExpireLRUCacheTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FIFOBufferStreamTest.cpp b/Foundation/testsuite/src/FIFOBufferStreamTest.cpp index 1a07b91b0..dc7ddcb02 100644 --- a/Foundation/testsuite/src/FIFOBufferStreamTest.cpp +++ b/Foundation/testsuite/src/FIFOBufferStreamTest.cpp @@ -23,7 +23,7 @@ using Poco::FIFOBufferStream; using Poco::delegate; -FIFOBufferStreamTest::FIFOBufferStreamTest(const std::string& name): CppUnit::TestCase(name) +FIFOBufferStreamTest::FIFOBufferStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FIFOBufferTest.cpp b/Foundation/testsuite/src/FIFOBufferTest.cpp index a3819d6ef..a7f039ef2 100644 --- a/Foundation/testsuite/src/FIFOBufferTest.cpp +++ b/Foundation/testsuite/src/FIFOBufferTest.cpp @@ -31,8 +31,8 @@ using Poco::delegate; using std::memcpy; -FIFOBufferTest::FIFOBufferTest(const std::string& name): - CppUnit::TestCase(name), +FIFOBufferTest::FIFOBufferTest(const std::string& rName): + CppUnit::TestCase(rName), _notToReadable(0), _notToWritable(0), _readableToNot(0), diff --git a/Foundation/testsuite/src/FIFOEventTest.cpp b/Foundation/testsuite/src/FIFOEventTest.cpp index fdc4ac0e7..1309ead8b 100644 --- a/Foundation/testsuite/src/FIFOEventTest.cpp +++ b/Foundation/testsuite/src/FIFOEventTest.cpp @@ -26,7 +26,7 @@ using namespace Poco; #define LARGEINC 100 -FIFOEventTest::FIFOEventTest(const std::string& name): CppUnit::TestCase(name) +FIFOEventTest::FIFOEventTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FPETest.cpp b/Foundation/testsuite/src/FPETest.cpp index 5f4fba2b8..ef39c4eb7 100644 --- a/Foundation/testsuite/src/FPETest.cpp +++ b/Foundation/testsuite/src/FPETest.cpp @@ -19,7 +19,7 @@ using Poco::FPE; -FPETest::FPETest(const std::string& name): CppUnit::TestCase(name) +FPETest::FPETest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FileChannelTest.cpp b/Foundation/testsuite/src/FileChannelTest.cpp index bb0c86643..77a65fa2a 100644 --- a/Foundation/testsuite/src/FileChannelTest.cpp +++ b/Foundation/testsuite/src/FileChannelTest.cpp @@ -48,7 +48,7 @@ using Poco::DirectoryIterator; using Poco::InvalidArgumentException; -FileChannelTest::FileChannelTest(const std::string& name): CppUnit::TestCase(name) +FileChannelTest::FileChannelTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FileStreamTest.cpp b/Foundation/testsuite/src/FileStreamTest.cpp index 27ad70b58..7ef5eaeb9 100644 --- a/Foundation/testsuite/src/FileStreamTest.cpp +++ b/Foundation/testsuite/src/FileStreamTest.cpp @@ -19,7 +19,7 @@ #include "Poco/Exception.h" -FileStreamTest::FileStreamTest(const std::string& name): CppUnit::TestCase(name) +FileStreamTest::FileStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FileTest.cpp b/Foundation/testsuite/src/FileTest.cpp index 9b2117a11..fc0810e41 100644 --- a/Foundation/testsuite/src/FileTest.cpp +++ b/Foundation/testsuite/src/FileTest.cpp @@ -30,7 +30,7 @@ using Poco::Timestamp; using Poco::Thread; -FileTest::FileTest(const std::string& name): CppUnit::TestCase(name) +FileTest::FileTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/FormatTest.cpp b/Foundation/testsuite/src/FormatTest.cpp index 1ace4f9b5..a2620999b 100644 --- a/Foundation/testsuite/src/FormatTest.cpp +++ b/Foundation/testsuite/src/FormatTest.cpp @@ -24,7 +24,7 @@ using Poco::Int64; using Poco::UInt64; -FormatTest::FormatTest(const std::string& name): CppUnit::TestCase(name) +FormatTest::FormatTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/GlobTest.cpp b/Foundation/testsuite/src/GlobTest.cpp index 25c887ec6..fdf65cf76 100644 --- a/Foundation/testsuite/src/GlobTest.cpp +++ b/Foundation/testsuite/src/GlobTest.cpp @@ -24,7 +24,7 @@ using Poco::File; using Poco::Path; -GlobTest::GlobTest(const std::string& name): CppUnit::TestCase(name) +GlobTest::GlobTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/HMACEngineTest.cpp b/Foundation/testsuite/src/HMACEngineTest.cpp index 2b21e1e6d..9690d987d 100644 --- a/Foundation/testsuite/src/HMACEngineTest.cpp +++ b/Foundation/testsuite/src/HMACEngineTest.cpp @@ -22,7 +22,7 @@ using Poco::MD5Engine; using Poco::DigestEngine; -HMACEngineTest::HMACEngineTest(const std::string& name): CppUnit::TestCase(name) +HMACEngineTest::HMACEngineTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/HashMapTest.cpp b/Foundation/testsuite/src/HashMapTest.cpp index 5f14ad4ea..3f5f0b851 100644 --- a/Foundation/testsuite/src/HashMapTest.cpp +++ b/Foundation/testsuite/src/HashMapTest.cpp @@ -21,7 +21,7 @@ using Poco::HashMap; -HashMapTest::HashMapTest(const std::string& name): CppUnit::TestCase(name) +HashMapTest::HashMapTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/HashSetTest.cpp b/Foundation/testsuite/src/HashSetTest.cpp index 288ee57c7..e1cf840c4 100644 --- a/Foundation/testsuite/src/HashSetTest.cpp +++ b/Foundation/testsuite/src/HashSetTest.cpp @@ -21,7 +21,7 @@ using Poco::Hash; using Poco::HashSet; -HashSetTest::HashSetTest(const std::string& name): CppUnit::TestCase(name) +HashSetTest::HashSetTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/HashTableTest.cpp b/Foundation/testsuite/src/HashTableTest.cpp index da305b991..e7e797f34 100644 --- a/Foundation/testsuite/src/HashTableTest.cpp +++ b/Foundation/testsuite/src/HashTableTest.cpp @@ -20,7 +20,7 @@ using namespace Poco; -HashTableTest::HashTableTest(const std::string& name): CppUnit::TestCase(name) +HashTableTest::HashTableTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/HexBinaryTest.cpp b/Foundation/testsuite/src/HexBinaryTest.cpp index fe3796dd6..29d72ff68 100644 --- a/Foundation/testsuite/src/HexBinaryTest.cpp +++ b/Foundation/testsuite/src/HexBinaryTest.cpp @@ -24,7 +24,7 @@ using Poco::HexBinaryDecoder; using Poco::DataFormatException; -HexBinaryTest::HexBinaryTest(const std::string& name): CppUnit::TestCase(name) +HexBinaryTest::HexBinaryTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LRUCacheTest.cpp b/Foundation/testsuite/src/LRUCacheTest.cpp index 24a64eb94..da0cc598a 100644 --- a/Foundation/testsuite/src/LRUCacheTest.cpp +++ b/Foundation/testsuite/src/LRUCacheTest.cpp @@ -22,7 +22,7 @@ using namespace Poco; -LRUCacheTest::LRUCacheTest(const std::string& name): CppUnit::TestCase(name) +LRUCacheTest::LRUCacheTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LineEndingConverterTest.cpp b/Foundation/testsuite/src/LineEndingConverterTest.cpp index 70d85ba45..ca2412e09 100644 --- a/Foundation/testsuite/src/LineEndingConverterTest.cpp +++ b/Foundation/testsuite/src/LineEndingConverterTest.cpp @@ -24,7 +24,7 @@ using Poco::OutputLineEndingConverter; using Poco::StreamCopier; -LineEndingConverterTest::LineEndingConverterTest(const std::string& name): CppUnit::TestCase(name) +LineEndingConverterTest::LineEndingConverterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LinearHashTableTest.cpp b/Foundation/testsuite/src/LinearHashTableTest.cpp index 6c7607845..6bbc230f2 100644 --- a/Foundation/testsuite/src/LinearHashTableTest.cpp +++ b/Foundation/testsuite/src/LinearHashTableTest.cpp @@ -28,7 +28,7 @@ using Poco::Stopwatch; using Poco::NumberFormatter; -LinearHashTableTest::LinearHashTableTest(const std::string& name): CppUnit::TestCase(name) +LinearHashTableTest::LinearHashTableTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ListMapTest.cpp b/Foundation/testsuite/src/ListMapTest.cpp index e3b1ae0c1..f0a249f75 100644 --- a/Foundation/testsuite/src/ListMapTest.cpp +++ b/Foundation/testsuite/src/ListMapTest.cpp @@ -21,7 +21,7 @@ using Poco::ListMap; -ListMapTest::ListMapTest(const std::string& name): CppUnit::TestCase(name) +ListMapTest::ListMapTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LocalDateTimeTest.cpp b/Foundation/testsuite/src/LocalDateTimeTest.cpp index f3381419e..72dcdfcd2 100644 --- a/Foundation/testsuite/src/LocalDateTimeTest.cpp +++ b/Foundation/testsuite/src/LocalDateTimeTest.cpp @@ -36,7 +36,7 @@ using std::strftime; #endif -LocalDateTimeTest::LocalDateTimeTest(const std::string& name): CppUnit::TestCase(name) +LocalDateTimeTest::LocalDateTimeTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LogStreamTest.cpp b/Foundation/testsuite/src/LogStreamTest.cpp index 3e8b6d1e3..a6b90cd1b 100644 --- a/Foundation/testsuite/src/LogStreamTest.cpp +++ b/Foundation/testsuite/src/LogStreamTest.cpp @@ -26,7 +26,7 @@ using Poco::Message; using Poco::AutoPtr; -LogStreamTest::LogStreamTest(const std::string& name): CppUnit::TestCase(name) +LogStreamTest::LogStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LoggerTest.cpp b/Foundation/testsuite/src/LoggerTest.cpp index 896d439e9..7f4f42e82 100644 --- a/Foundation/testsuite/src/LoggerTest.cpp +++ b/Foundation/testsuite/src/LoggerTest.cpp @@ -24,7 +24,7 @@ using Poco::Message; using Poco::AutoPtr; -LoggerTest::LoggerTest(const std::string& name): CppUnit::TestCase(name) +LoggerTest::LoggerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LoggingFactoryTest.cpp b/Foundation/testsuite/src/LoggingFactoryTest.cpp index 4ad770796..955a05e9d 100644 --- a/Foundation/testsuite/src/LoggingFactoryTest.cpp +++ b/Foundation/testsuite/src/LoggingFactoryTest.cpp @@ -61,7 +61,7 @@ namespace } -LoggingFactoryTest::LoggingFactoryTest(const std::string& name): CppUnit::TestCase(name) +LoggingFactoryTest::LoggingFactoryTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/LoggingRegistryTest.cpp b/Foundation/testsuite/src/LoggingRegistryTest.cpp index 8ed076521..d78144d0c 100644 --- a/Foundation/testsuite/src/LoggingRegistryTest.cpp +++ b/Foundation/testsuite/src/LoggingRegistryTest.cpp @@ -27,7 +27,7 @@ using Poco::PatternFormatter; using Poco::AutoPtr; -LoggingRegistryTest::LoggingRegistryTest(const std::string& name): CppUnit::TestCase(name) +LoggingRegistryTest::LoggingRegistryTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/MD4EngineTest.cpp b/Foundation/testsuite/src/MD4EngineTest.cpp index c31a90096..cd7cdb7a8 100644 --- a/Foundation/testsuite/src/MD4EngineTest.cpp +++ b/Foundation/testsuite/src/MD4EngineTest.cpp @@ -20,7 +20,7 @@ using Poco::MD4Engine; using Poco::DigestEngine; -MD4EngineTest::MD4EngineTest(const std::string& name): CppUnit::TestCase(name) +MD4EngineTest::MD4EngineTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/MD5EngineTest.cpp b/Foundation/testsuite/src/MD5EngineTest.cpp index b4c4fa24b..fea34b017 100644 --- a/Foundation/testsuite/src/MD5EngineTest.cpp +++ b/Foundation/testsuite/src/MD5EngineTest.cpp @@ -20,7 +20,7 @@ using Poco::MD5Engine; using Poco::DigestEngine; -MD5EngineTest::MD5EngineTest(const std::string& name): CppUnit::TestCase(name) +MD5EngineTest::MD5EngineTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ManifestTest.cpp b/Foundation/testsuite/src/ManifestTest.cpp index 2a78b4f69..6fd666539 100644 --- a/Foundation/testsuite/src/ManifestTest.cpp +++ b/Foundation/testsuite/src/ManifestTest.cpp @@ -32,7 +32,7 @@ class MfTestObject: public MfTestBase }; -ManifestTest::ManifestTest(const std::string& name): CppUnit::TestCase(name) +ManifestTest::ManifestTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/MemoryPoolTest.cpp b/Foundation/testsuite/src/MemoryPoolTest.cpp index dd482d822..12d448415 100644 --- a/Foundation/testsuite/src/MemoryPoolTest.cpp +++ b/Foundation/testsuite/src/MemoryPoolTest.cpp @@ -20,7 +20,7 @@ using Poco::MemoryPool; -MemoryPoolTest::MemoryPoolTest(const std::string& name): CppUnit::TestCase(name) +MemoryPoolTest::MemoryPoolTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/MemoryStreamTest.cpp b/Foundation/testsuite/src/MemoryStreamTest.cpp index 86ea9557a..b823133e5 100644 --- a/Foundation/testsuite/src/MemoryStreamTest.cpp +++ b/Foundation/testsuite/src/MemoryStreamTest.cpp @@ -22,7 +22,7 @@ using Poco::MemoryInputStream; using Poco::MemoryOutputStream; -MemoryStreamTest::MemoryStreamTest(const std::string& name): CppUnit::TestCase(name) +MemoryStreamTest::MemoryStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/MutexTest.cpp b/Foundation/testsuite/src/MutexTest.cpp index 9b3f70f24..ab591ece7 100644 --- a/Foundation/testsuite/src/MutexTest.cpp +++ b/Foundation/testsuite/src/MutexTest.cpp @@ -62,7 +62,7 @@ namespace } -MutexTest::MutexTest(const std::string& name): CppUnit::TestCase(name) +MutexTest::MutexTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NDCTest.cpp b/Foundation/testsuite/src/NDCTest.cpp index 9ae2a35dd..55820f245 100644 --- a/Foundation/testsuite/src/NDCTest.cpp +++ b/Foundation/testsuite/src/NDCTest.cpp @@ -20,7 +20,7 @@ using Poco::NDC; -NDCTest::NDCTest(const std::string& name): CppUnit::TestCase(name) +NDCTest::NDCTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NamedEventTest.cpp b/Foundation/testsuite/src/NamedEventTest.cpp index 4f22197c8..87ef29221 100644 --- a/Foundation/testsuite/src/NamedEventTest.cpp +++ b/Foundation/testsuite/src/NamedEventTest.cpp @@ -51,7 +51,7 @@ namespace } -NamedEventTest::NamedEventTest(const std::string& name): CppUnit::TestCase(name) +NamedEventTest::NamedEventTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NamedMutexTest.cpp b/Foundation/testsuite/src/NamedMutexTest.cpp index 3d3b3047f..5cb813b18 100644 --- a/Foundation/testsuite/src/NamedMutexTest.cpp +++ b/Foundation/testsuite/src/NamedMutexTest.cpp @@ -77,7 +77,7 @@ namespace } -NamedMutexTest::NamedMutexTest(const std::string& name): CppUnit::TestCase(name) +NamedMutexTest::NamedMutexTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NamedTuplesTest.cpp b/Foundation/testsuite/src/NamedTuplesTest.cpp index 3442e52b5..e35f1b497 100644 --- a/Foundation/testsuite/src/NamedTuplesTest.cpp +++ b/Foundation/testsuite/src/NamedTuplesTest.cpp @@ -34,7 +34,7 @@ using Poco::NotFoundException; using Poco::InvalidArgumentException; -NamedTuplesTest::NamedTuplesTest(const std::string& name): CppUnit::TestCase(name) +NamedTuplesTest::NamedTuplesTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NotificationCenterTest.cpp b/Foundation/testsuite/src/NotificationCenterTest.cpp index fa5b98c71..ff74da85b 100644 --- a/Foundation/testsuite/src/NotificationCenterTest.cpp +++ b/Foundation/testsuite/src/NotificationCenterTest.cpp @@ -31,7 +31,7 @@ class TestNotification: public Notification }; -NotificationCenterTest::NotificationCenterTest(const std::string& name): CppUnit::TestCase(name) +NotificationCenterTest::NotificationCenterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NotificationQueueTest.cpp b/Foundation/testsuite/src/NotificationQueueTest.cpp index 559869b34..3096603d4 100644 --- a/Foundation/testsuite/src/NotificationQueueTest.cpp +++ b/Foundation/testsuite/src/NotificationQueueTest.cpp @@ -49,7 +49,7 @@ namespace } -NotificationQueueTest::NotificationQueueTest(const std::string& name): CppUnit::TestCase(name) +NotificationQueueTest::NotificationQueueTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NullStreamTest.cpp b/Foundation/testsuite/src/NullStreamTest.cpp index 27ceffb1e..150a761b7 100644 --- a/Foundation/testsuite/src/NullStreamTest.cpp +++ b/Foundation/testsuite/src/NullStreamTest.cpp @@ -20,7 +20,7 @@ using Poco::NullInputStream; using Poco::NullOutputStream; -NullStreamTest::NullStreamTest(const std::string& name): CppUnit::TestCase(name) +NullStreamTest::NullStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NumberFormatterTest.cpp b/Foundation/testsuite/src/NumberFormatterTest.cpp index e6935a711..1a68ec672 100644 --- a/Foundation/testsuite/src/NumberFormatterTest.cpp +++ b/Foundation/testsuite/src/NumberFormatterTest.cpp @@ -21,7 +21,7 @@ using Poco::Int64; using Poco::UInt64; -NumberFormatterTest::NumberFormatterTest(const std::string& name): CppUnit::TestCase(name) +NumberFormatterTest::NumberFormatterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/NumberParserTest.cpp b/Foundation/testsuite/src/NumberParserTest.cpp index cb656494b..3146e7126 100644 --- a/Foundation/testsuite/src/NumberParserTest.cpp +++ b/Foundation/testsuite/src/NumberParserTest.cpp @@ -42,7 +42,7 @@ using Poco::decimalSeparator; using Poco::thousandSeparator; -NumberParserTest::NumberParserTest(const std::string& name): CppUnit::TestCase(name) +NumberParserTest::NumberParserTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ObjectPoolTest.cpp b/Foundation/testsuite/src/ObjectPoolTest.cpp index 1f631f5fd..e6e582504 100644 --- a/Foundation/testsuite/src/ObjectPoolTest.cpp +++ b/Foundation/testsuite/src/ObjectPoolTest.cpp @@ -20,7 +20,7 @@ using Poco::ObjectPool; -ObjectPoolTest::ObjectPoolTest(const std::string& name): CppUnit::TestCase(name) +ObjectPoolTest::ObjectPoolTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/PBKDF2EngineTest.cpp b/Foundation/testsuite/src/PBKDF2EngineTest.cpp index 5a3ed21e1..a492b1bff 100644 --- a/Foundation/testsuite/src/PBKDF2EngineTest.cpp +++ b/Foundation/testsuite/src/PBKDF2EngineTest.cpp @@ -24,7 +24,7 @@ using Poco::SHA1Engine; using Poco::DigestEngine; -PBKDF2EngineTest::PBKDF2EngineTest(const std::string& name): CppUnit::TestCase(name) +PBKDF2EngineTest::PBKDF2EngineTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/PathTest.cpp b/Foundation/testsuite/src/PathTest.cpp index a601e8067..7d6e8ca90 100644 --- a/Foundation/testsuite/src/PathTest.cpp +++ b/Foundation/testsuite/src/PathTest.cpp @@ -34,7 +34,7 @@ using Poco::PathSyntaxException; using Poco::Environment; -PathTest::PathTest(const std::string& name): CppUnit::TestCase(name) +PathTest::PathTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/PatternFormatterTest.cpp b/Foundation/testsuite/src/PatternFormatterTest.cpp index 77987996f..f7dc5ca3a 100644 --- a/Foundation/testsuite/src/PatternFormatterTest.cpp +++ b/Foundation/testsuite/src/PatternFormatterTest.cpp @@ -23,7 +23,7 @@ using Poco::Message; using Poco::DateTime; -PatternFormatterTest::PatternFormatterTest(const std::string& name): CppUnit::TestCase(name) +PatternFormatterTest::PatternFormatterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/PriorityEventTest.cpp b/Foundation/testsuite/src/PriorityEventTest.cpp index 749314792..68c03a761 100644 --- a/Foundation/testsuite/src/PriorityEventTest.cpp +++ b/Foundation/testsuite/src/PriorityEventTest.cpp @@ -26,7 +26,7 @@ using namespace Poco; #define LARGEINC 100 -PriorityEventTest::PriorityEventTest(const std::string& name): CppUnit::TestCase(name) +PriorityEventTest::PriorityEventTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp b/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp index 8240a2a84..00df20461 100644 --- a/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp +++ b/Foundation/testsuite/src/PriorityNotificationQueueTest.cpp @@ -49,7 +49,7 @@ namespace } -PriorityNotificationQueueTest::PriorityNotificationQueueTest(const std::string& name): CppUnit::TestCase(name) +PriorityNotificationQueueTest::PriorityNotificationQueueTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ProcessTest.cpp b/Foundation/testsuite/src/ProcessTest.cpp index 71d6eabb3..5b7c59cc6 100644 --- a/Foundation/testsuite/src/ProcessTest.cpp +++ b/Foundation/testsuite/src/ProcessTest.cpp @@ -26,7 +26,7 @@ using Poco::PipeInputStream; using Poco::PipeOutputStream; -ProcessTest::ProcessTest(const std::string& name): CppUnit::TestCase(name) +ProcessTest::ProcessTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/RWLockTest.cpp b/Foundation/testsuite/src/RWLockTest.cpp index e8b6a30f1..b3486ef1a 100644 --- a/Foundation/testsuite/src/RWLockTest.cpp +++ b/Foundation/testsuite/src/RWLockTest.cpp @@ -121,7 +121,7 @@ private: }; -RWLockTest::RWLockTest(const std::string& name): CppUnit::TestCase(name) +RWLockTest::RWLockTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/RandomStreamTest.cpp b/Foundation/testsuite/src/RandomStreamTest.cpp index 2d641062f..e0fa559e0 100644 --- a/Foundation/testsuite/src/RandomStreamTest.cpp +++ b/Foundation/testsuite/src/RandomStreamTest.cpp @@ -21,7 +21,7 @@ using Poco::RandomInputStream; -RandomStreamTest::RandomStreamTest(const std::string& name): CppUnit::TestCase(name) +RandomStreamTest::RandomStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/RandomTest.cpp b/Foundation/testsuite/src/RandomTest.cpp index c5ed53590..1797a0f98 100644 --- a/Foundation/testsuite/src/RandomTest.cpp +++ b/Foundation/testsuite/src/RandomTest.cpp @@ -21,7 +21,7 @@ using Poco::UInt32; -RandomTest::RandomTest(const std::string& name): CppUnit::TestCase(name) +RandomTest::RandomTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/RegularExpressionTest.cpp b/Foundation/testsuite/src/RegularExpressionTest.cpp index cd6c1fb13..fd8aa8d2a 100644 --- a/Foundation/testsuite/src/RegularExpressionTest.cpp +++ b/Foundation/testsuite/src/RegularExpressionTest.cpp @@ -21,7 +21,7 @@ using Poco::RegularExpression; using Poco::RegularExpressionException; -RegularExpressionTest::RegularExpressionTest(const std::string& name): CppUnit::TestCase(name) +RegularExpressionTest::RegularExpressionTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SHA1EngineTest.cpp b/Foundation/testsuite/src/SHA1EngineTest.cpp index a0e95f3c2..99f47403f 100644 --- a/Foundation/testsuite/src/SHA1EngineTest.cpp +++ b/Foundation/testsuite/src/SHA1EngineTest.cpp @@ -20,7 +20,7 @@ using Poco::SHA1Engine; using Poco::DigestEngine; -SHA1EngineTest::SHA1EngineTest(const std::string& name): CppUnit::TestCase(name) +SHA1EngineTest::SHA1EngineTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SemaphoreTest.cpp b/Foundation/testsuite/src/SemaphoreTest.cpp index 515f6db10..f65607927 100644 --- a/Foundation/testsuite/src/SemaphoreTest.cpp +++ b/Foundation/testsuite/src/SemaphoreTest.cpp @@ -69,7 +69,7 @@ private: }; -SemaphoreTest::SemaphoreTest(const std::string& name): CppUnit::TestCase(name) +SemaphoreTest::SemaphoreTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SharedLibraryTest.cpp b/Foundation/testsuite/src/SharedLibraryTest.cpp index d53c1ea09..fc0b7908b 100644 --- a/Foundation/testsuite/src/SharedLibraryTest.cpp +++ b/Foundation/testsuite/src/SharedLibraryTest.cpp @@ -26,7 +26,7 @@ using Poco::LibraryAlreadyLoadedException; typedef int (*GimmeFiveFunc)(); -SharedLibraryTest::SharedLibraryTest(const std::string& name): CppUnit::TestCase(name) +SharedLibraryTest::SharedLibraryTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SharedMemoryTest.cpp b/Foundation/testsuite/src/SharedMemoryTest.cpp index 001e4dee3..0cdf925ef 100644 --- a/Foundation/testsuite/src/SharedMemoryTest.cpp +++ b/Foundation/testsuite/src/SharedMemoryTest.cpp @@ -25,7 +25,7 @@ using Poco::SharedMemory; -SharedMemoryTest::SharedMemoryTest(const std::string& name): CppUnit::TestCase(name) +SharedMemoryTest::SharedMemoryTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SharedPtrTest.cpp b/Foundation/testsuite/src/SharedPtrTest.cpp index 8dce9b1f4..06ce7eb9a 100644 --- a/Foundation/testsuite/src/SharedPtrTest.cpp +++ b/Foundation/testsuite/src/SharedPtrTest.cpp @@ -26,7 +26,7 @@ namespace class TestObject { public: - TestObject(const std::string& data): _data(data) + TestObject(const std::string& rData): _data(rData) { ++_count; } @@ -71,7 +71,7 @@ namespace } -SharedPtrTest::SharedPtrTest(const std::string& name): CppUnit::TestCase(name) +SharedPtrTest::SharedPtrTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SimpleFileChannelTest.cpp b/Foundation/testsuite/src/SimpleFileChannelTest.cpp index aa320bedb..331d73210 100644 --- a/Foundation/testsuite/src/SimpleFileChannelTest.cpp +++ b/Foundation/testsuite/src/SimpleFileChannelTest.cpp @@ -33,7 +33,7 @@ using Poco::DateTimeFormatter; using Poco::AutoPtr; -SimpleFileChannelTest::SimpleFileChannelTest(const std::string& name): CppUnit::TestCase(name) +SimpleFileChannelTest::SimpleFileChannelTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/SimpleHashTableTest.cpp b/Foundation/testsuite/src/SimpleHashTableTest.cpp index 3ee4081eb..491dc4a91 100644 --- a/Foundation/testsuite/src/SimpleHashTableTest.cpp +++ b/Foundation/testsuite/src/SimpleHashTableTest.cpp @@ -20,7 +20,7 @@ using namespace Poco; -SimpleHashTableTest::SimpleHashTableTest(const std::string& name): CppUnit::TestCase(name) +SimpleHashTableTest::SimpleHashTableTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/StopwatchTest.cpp b/Foundation/testsuite/src/StopwatchTest.cpp index 87c8633f0..0f410e547 100644 --- a/Foundation/testsuite/src/StopwatchTest.cpp +++ b/Foundation/testsuite/src/StopwatchTest.cpp @@ -23,7 +23,7 @@ using Poco::Timestamp; using Poco::Thread; -StopwatchTest::StopwatchTest(const std::string& name): CppUnit::TestCase(name) +StopwatchTest::StopwatchTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/StreamConverterTest.cpp b/Foundation/testsuite/src/StreamConverterTest.cpp index 3d3e6368d..707eef5d4 100644 --- a/Foundation/testsuite/src/StreamConverterTest.cpp +++ b/Foundation/testsuite/src/StreamConverterTest.cpp @@ -29,7 +29,7 @@ using Poco::ASCIIEncoding; using Poco::StreamCopier; -StreamConverterTest::StreamConverterTest(const std::string& name): CppUnit::TestCase(name) +StreamConverterTest::StreamConverterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/StreamCopierTest.cpp b/Foundation/testsuite/src/StreamCopierTest.cpp index 2daa50e9b..00bd46f66 100644 --- a/Foundation/testsuite/src/StreamCopierTest.cpp +++ b/Foundation/testsuite/src/StreamCopierTest.cpp @@ -20,7 +20,7 @@ using Poco::StreamCopier; -StreamCopierTest::StreamCopierTest(const std::string& name): CppUnit::TestCase(name) +StreamCopierTest::StreamCopierTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/StreamTokenizerTest.cpp b/Foundation/testsuite/src/StreamTokenizerTest.cpp index 5bd090e7e..4890ab8fc 100644 --- a/Foundation/testsuite/src/StreamTokenizerTest.cpp +++ b/Foundation/testsuite/src/StreamTokenizerTest.cpp @@ -105,7 +105,7 @@ public: }; -StreamTokenizerTest::StreamTokenizerTest(const std::string& name): CppUnit::TestCase(name) +StreamTokenizerTest::StreamTokenizerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/StringTest.cpp b/Foundation/testsuite/src/StringTest.cpp index d3519cf94..07cf4a6c6 100644 --- a/Foundation/testsuite/src/StringTest.cpp +++ b/Foundation/testsuite/src/StringTest.cpp @@ -64,7 +64,7 @@ using Poco::Stopwatch; using Poco::RangeException; -StringTest::StringTest(const std::string& name): CppUnit::TestCase(name) +StringTest::StringTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/StringTokenizerTest.cpp b/Foundation/testsuite/src/StringTokenizerTest.cpp index a2e4f6127..52c2a4d53 100644 --- a/Foundation/testsuite/src/StringTokenizerTest.cpp +++ b/Foundation/testsuite/src/StringTokenizerTest.cpp @@ -22,7 +22,7 @@ using Poco::RangeException; using Poco::NotFoundException; -StringTokenizerTest::StringTokenizerTest(const std::string& name): CppUnit::TestCase(name) +StringTokenizerTest::StringTokenizerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TaskManagerTest.cpp b/Foundation/testsuite/src/TaskManagerTest.cpp index 85d5ea11b..34d424577 100644 --- a/Foundation/testsuite/src/TaskManagerTest.cpp +++ b/Foundation/testsuite/src/TaskManagerTest.cpp @@ -234,7 +234,7 @@ namespace } -TaskManagerTest::TaskManagerTest(const std::string& name): CppUnit::TestCase(name) +TaskManagerTest::TaskManagerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TaskTest.cpp b/Foundation/testsuite/src/TaskTest.cpp index c8ef856a5..c6c44afa4 100644 --- a/Foundation/testsuite/src/TaskTest.cpp +++ b/Foundation/testsuite/src/TaskTest.cpp @@ -58,7 +58,7 @@ namespace } -TaskTest::TaskTest(const std::string& name): CppUnit::TestCase(name) +TaskTest::TaskTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TeeStreamTest.cpp b/Foundation/testsuite/src/TeeStreamTest.cpp index d0d64e50f..8e6fa8047 100644 --- a/Foundation/testsuite/src/TeeStreamTest.cpp +++ b/Foundation/testsuite/src/TeeStreamTest.cpp @@ -21,7 +21,7 @@ using Poco::TeeInputStream; using Poco::TeeOutputStream; -TeeStreamTest::TeeStreamTest(const std::string& name): CppUnit::TestCase(name) +TeeStreamTest::TeeStreamTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TextBufferIteratorTest.cpp b/Foundation/testsuite/src/TextBufferIteratorTest.cpp index 85854607c..3fe5d511a 100644 --- a/Foundation/testsuite/src/TextBufferIteratorTest.cpp +++ b/Foundation/testsuite/src/TextBufferIteratorTest.cpp @@ -25,7 +25,7 @@ using Poco::UTF8Encoding; using Poco::UTF16Encoding; -TextBufferIteratorTest::TextBufferIteratorTest(const std::string& name): CppUnit::TestCase(name) +TextBufferIteratorTest::TextBufferIteratorTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TextConverterTest.cpp b/Foundation/testsuite/src/TextConverterTest.cpp index afe304bc3..b19115473 100644 --- a/Foundation/testsuite/src/TextConverterTest.cpp +++ b/Foundation/testsuite/src/TextConverterTest.cpp @@ -27,7 +27,7 @@ using namespace Poco; -TextConverterTest::TextConverterTest(const std::string& name): CppUnit::TestCase(name) +TextConverterTest::TextConverterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TextEncodingTest.cpp b/Foundation/testsuite/src/TextEncodingTest.cpp index f9b0460ba..aa372bfac 100644 --- a/Foundation/testsuite/src/TextEncodingTest.cpp +++ b/Foundation/testsuite/src/TextEncodingTest.cpp @@ -26,7 +26,7 @@ using namespace Poco; -TextEncodingTest::TextEncodingTest(const std::string& name): CppUnit::TestCase(name) +TextEncodingTest::TextEncodingTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TextIteratorTest.cpp b/Foundation/testsuite/src/TextIteratorTest.cpp index 42dc17e60..d522bd3ba 100644 --- a/Foundation/testsuite/src/TextIteratorTest.cpp +++ b/Foundation/testsuite/src/TextIteratorTest.cpp @@ -25,7 +25,7 @@ using Poco::UTF8Encoding; using Poco::UTF16Encoding; -TextIteratorTest::TextIteratorTest(const std::string& name): CppUnit::TestCase(name) +TextIteratorTest::TextIteratorTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ThreadLocalTest.cpp b/Foundation/testsuite/src/ThreadLocalTest.cpp index 61fc60351..de7f8bd4c 100644 --- a/Foundation/testsuite/src/ThreadLocalTest.cpp +++ b/Foundation/testsuite/src/ThreadLocalTest.cpp @@ -60,7 +60,7 @@ struct TLTestStruct ThreadLocal TLTestRunnable::_count; -ThreadLocalTest::ThreadLocalTest(const std::string& name): CppUnit::TestCase(name) +ThreadLocalTest::ThreadLocalTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ThreadPoolTest.cpp b/Foundation/testsuite/src/ThreadPoolTest.cpp index 3ec9cd262..a6db36a33 100644 --- a/Foundation/testsuite/src/ThreadPoolTest.cpp +++ b/Foundation/testsuite/src/ThreadPoolTest.cpp @@ -25,7 +25,7 @@ using Poco::RunnableAdapter; using Poco::Thread; -ThreadPoolTest::ThreadPoolTest(const std::string& name): CppUnit::TestCase(name), _event(Event::EVENT_MANUALRESET) +ThreadPoolTest::ThreadPoolTest(const std::string& rName): CppUnit::TestCase(rName), _event(Event::EVENT_MANUALRESET) { } diff --git a/Foundation/testsuite/src/ThreadTest.cpp b/Foundation/testsuite/src/ThreadTest.cpp index 3306169f1..b07cd333c 100644 --- a/Foundation/testsuite/src/ThreadTest.cpp +++ b/Foundation/testsuite/src/ThreadTest.cpp @@ -148,7 +148,7 @@ private: }; -ThreadTest::ThreadTest(const std::string& name): CppUnit::TestCase(name) +ThreadTest::ThreadTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TimedNotificationQueueTest.cpp b/Foundation/testsuite/src/TimedNotificationQueueTest.cpp index e21e74401..49d37a438 100644 --- a/Foundation/testsuite/src/TimedNotificationQueueTest.cpp +++ b/Foundation/testsuite/src/TimedNotificationQueueTest.cpp @@ -45,7 +45,7 @@ namespace } -TimedNotificationQueueTest::TimedNotificationQueueTest(const std::string& name): CppUnit::TestCase(name) +TimedNotificationQueueTest::TimedNotificationQueueTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TimerTest.cpp b/Foundation/testsuite/src/TimerTest.cpp index ecdef30be..887ca9ae6 100644 --- a/Foundation/testsuite/src/TimerTest.cpp +++ b/Foundation/testsuite/src/TimerTest.cpp @@ -23,7 +23,7 @@ using Poco::Thread; using Poco::Stopwatch; -TimerTest::TimerTest(const std::string& name): CppUnit::TestCase(name) +TimerTest::TimerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TimespanTest.cpp b/Foundation/testsuite/src/TimespanTest.cpp index 15e8afc73..c05d2cdd0 100644 --- a/Foundation/testsuite/src/TimespanTest.cpp +++ b/Foundation/testsuite/src/TimespanTest.cpp @@ -19,7 +19,7 @@ using Poco::Timespan; -TimespanTest::TimespanTest(const std::string& name): CppUnit::TestCase(name) +TimespanTest::TimespanTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TimestampTest.cpp b/Foundation/testsuite/src/TimestampTest.cpp index 13679f0ff..4e43a3419 100644 --- a/Foundation/testsuite/src/TimestampTest.cpp +++ b/Foundation/testsuite/src/TimestampTest.cpp @@ -21,7 +21,7 @@ using Poco::Timestamp; using Poco::Thread; -TimestampTest::TimestampTest(const std::string& name): CppUnit::TestCase(name) +TimestampTest::TimestampTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TimezoneTest.cpp b/Foundation/testsuite/src/TimezoneTest.cpp index 53446a1eb..f19b2a4a0 100644 --- a/Foundation/testsuite/src/TimezoneTest.cpp +++ b/Foundation/testsuite/src/TimezoneTest.cpp @@ -20,7 +20,7 @@ using Poco::Timezone; -TimezoneTest::TimezoneTest(const std::string& name): CppUnit::TestCase(name) +TimezoneTest::TimezoneTest(const std::string& rName): CppUnit::TestCase(rName) { } @@ -32,10 +32,10 @@ TimezoneTest::~TimezoneTest() void TimezoneTest::testTimezone() { - std::string name = Timezone::name(); + std::string timezoneName = Timezone::name(); std::string stdName = Timezone::standardName(); std::string dstName = Timezone::dstName(); - std::cout << "Timezone Names: " << name << ", " << stdName << ", " << dstName << std::endl; + std::cout << "Timezone Names: " << timezoneName << ", " << stdName << ", " << dstName << std::endl; int utcOffset = Timezone::utcOffset(); std::cout << "UTC Offset: " << utcOffset << std::endl; int dst = Timezone::dst(); diff --git a/Foundation/testsuite/src/TuplesTest.cpp b/Foundation/testsuite/src/TuplesTest.cpp index 241f19589..703d19121 100644 --- a/Foundation/testsuite/src/TuplesTest.cpp +++ b/Foundation/testsuite/src/TuplesTest.cpp @@ -46,7 +46,7 @@ using Poco::Int32; using Poco::UInt32; -TuplesTest::TuplesTest(const std::string& name): CppUnit::TestCase(name) +TuplesTest::TuplesTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/TypeListTest.cpp b/Foundation/testsuite/src/TypeListTest.cpp index 02bcdd2b0..6c81f2103 100644 --- a/Foundation/testsuite/src/TypeListTest.cpp +++ b/Foundation/testsuite/src/TypeListTest.cpp @@ -51,7 +51,7 @@ using Poco::UInt32; using Poco::Void; -TypeListTest::TypeListTest(const std::string& name): CppUnit::TestCase(name) +TypeListTest::TypeListTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/URIStreamOpenerTest.cpp b/Foundation/testsuite/src/URIStreamOpenerTest.cpp index 80ddb7452..bfb98f98a 100644 --- a/Foundation/testsuite/src/URIStreamOpenerTest.cpp +++ b/Foundation/testsuite/src/URIStreamOpenerTest.cpp @@ -46,7 +46,7 @@ namespace } -URIStreamOpenerTest::URIStreamOpenerTest(const std::string& name): CppUnit::TestCase(name) +URIStreamOpenerTest::URIStreamOpenerTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/URITest.cpp b/Foundation/testsuite/src/URITest.cpp index e7753f7e2..47da518e7 100644 --- a/Foundation/testsuite/src/URITest.cpp +++ b/Foundation/testsuite/src/URITest.cpp @@ -21,7 +21,7 @@ using Poco::URI; using Poco::Path; -URITest::URITest(const std::string& name): CppUnit::TestCase(name) +URITest::URITest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/UTF8StringTest.cpp b/Foundation/testsuite/src/UTF8StringTest.cpp index 1f14fea93..ace9cda1a 100644 --- a/Foundation/testsuite/src/UTF8StringTest.cpp +++ b/Foundation/testsuite/src/UTF8StringTest.cpp @@ -19,7 +19,7 @@ using Poco::UTF8; -UTF8StringTest::UTF8StringTest(const std::string& name): CppUnit::TestCase(name) +UTF8StringTest::UTF8StringTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/UUIDGeneratorTest.cpp b/Foundation/testsuite/src/UUIDGeneratorTest.cpp index 8e69d3e6d..25bf41e62 100644 --- a/Foundation/testsuite/src/UUIDGeneratorTest.cpp +++ b/Foundation/testsuite/src/UUIDGeneratorTest.cpp @@ -23,7 +23,7 @@ using Poco::UUIDGenerator; using Poco::UUID; -UUIDGeneratorTest::UUIDGeneratorTest(const std::string& name): CppUnit::TestCase(name) +UUIDGeneratorTest::UUIDGeneratorTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/UUIDTest.cpp b/Foundation/testsuite/src/UUIDTest.cpp index 613fc0468..4a6b2cb44 100644 --- a/Foundation/testsuite/src/UUIDTest.cpp +++ b/Foundation/testsuite/src/UUIDTest.cpp @@ -20,7 +20,7 @@ using Poco::UUID; -UUIDTest::UUIDTest(const std::string& name): CppUnit::TestCase(name) +UUIDTest::UUIDTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/UnicodeConverterTest.cpp b/Foundation/testsuite/src/UnicodeConverterTest.cpp index 8e8cfbae0..e638513a4 100644 --- a/Foundation/testsuite/src/UnicodeConverterTest.cpp +++ b/Foundation/testsuite/src/UnicodeConverterTest.cpp @@ -27,7 +27,7 @@ using Poco::UTF32Char; using Poco::UTF32String; -UnicodeConverterTest::UnicodeConverterTest(const std::string& name): CppUnit::TestCase(name) +UnicodeConverterTest::UnicodeConverterTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/UniqueExpireCacheTest.cpp b/Foundation/testsuite/src/UniqueExpireCacheTest.cpp index 9b95f293b..ddab2cd72 100644 --- a/Foundation/testsuite/src/UniqueExpireCacheTest.cpp +++ b/Foundation/testsuite/src/UniqueExpireCacheTest.cpp @@ -47,7 +47,7 @@ typedef AccessExpirationDecorator DIntVal; #define DURWAIT 300 -UniqueExpireCacheTest::UniqueExpireCacheTest(const std::string& name): CppUnit::TestCase(name) +UniqueExpireCacheTest::UniqueExpireCacheTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp b/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp index cac8e683f..253e1ae3d 100644 --- a/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp +++ b/Foundation/testsuite/src/UniqueExpireLRUCacheTest.cpp @@ -48,7 +48,7 @@ typedef AccessExpirationDecorator DIntVal; #define DURWAIT 300 -UniqueExpireLRUCacheTest::UniqueExpireLRUCacheTest(const std::string& name): CppUnit::TestCase(name) +UniqueExpireLRUCacheTest::UniqueExpireLRUCacheTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/VarTest.cpp b/Foundation/testsuite/src/VarTest.cpp index 10d7d6271..b31c96f01 100644 --- a/Foundation/testsuite/src/VarTest.cpp +++ b/Foundation/testsuite/src/VarTest.cpp @@ -58,7 +58,7 @@ private: }; -VarTest::VarTest(const std::string& name): CppUnit::TestCase(name) +VarTest::VarTest(const std::string& rName): CppUnit::TestCase(rName) { } diff --git a/Foundation/testsuite/src/ZLibTest.cpp b/Foundation/testsuite/src/ZLibTest.cpp index c7dad81bf..fb81367ba 100644 --- a/Foundation/testsuite/src/ZLibTest.cpp +++ b/Foundation/testsuite/src/ZLibTest.cpp @@ -30,7 +30,7 @@ using Poco::DeflatingStreamBuf; using Poco::StreamCopier; -ZLibTest::ZLibTest(const std::string& name): CppUnit::TestCase(name) +ZLibTest::ZLibTest(const std::string& rName): CppUnit::TestCase(rName) { } From 2540c5340fb97146f585ca176b5c070017d716ad Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Mon, 11 Jan 2016 16:46:24 +0100 Subject: [PATCH 05/23] enable bitcode for iPhone --- build/config/iPhone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/config/iPhone b/build/config/iPhone index 84f3d1d8c..157da92b7 100644 --- a/build/config/iPhone +++ b/build/config/iPhone @@ -31,7 +31,7 @@ IPHONE_SDK_VERSION_MIN ?= $(patsubst %.sdk,%,$(patsubst $(IPHONE_SDK_ROOT_DIR)%, POCO_TARGET_OSNAME ?= $(IPHONE_SDK) POCO_TARGET_OSARCH ?= armv6 TOOL_PREFIX ?= $(shell xcode-select -print-path)/Platforms/$(IPHONE_SDK).platform/Developer/usr/bin -OSFLAGS ?= -arch $(POCO_TARGET_OSARCH) -isysroot $(IPHONE_SDK_BASE) -mthumb -miphoneos-version-min=$(IPHONE_SDK_VERSION_MIN) +OSFLAGS ?= -arch $(POCO_TARGET_OSARCH) -isysroot $(IPHONE_SDK_BASE) -mthumb -miphoneos-version-min=$(IPHONE_SDK_VERSION_MIN) -fembed-bitcode # # Tools From 1d0f1f8d6e71f46894a25eee2a5fc2ae993a560c Mon Sep 17 00:00:00 2001 From: Francis ANDRE Date: Wed, 13 Jan 2016 12:59:28 +0100 Subject: [PATCH 06/23] Make OSX tests complete on Travis --- .travis.yml | 119 ++++++++++++++++++++++++--------------- travis/Linux/excluded.sh | 2 + travis/Linux/runtests.sh | 9 +++ travis/OSX/excluded.sh | 7 +++ travis/OSX/runtests.sh | 10 ++++ travis/ignored.sh | 10 ++++ travis/runtests.sh | 17 ------ 7 files changed, 112 insertions(+), 62 deletions(-) create mode 100755 travis/Linux/excluded.sh create mode 100755 travis/Linux/runtests.sh create mode 100755 travis/OSX/excluded.sh create mode 100755 travis/OSX/runtests.sh create mode 100755 travis/ignored.sh delete mode 100755 travis/runtests.sh diff --git a/.travis.yml b/.travis.yml index 6c9edc8e7..d39eac516 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,113 +3,140 @@ language: cpp cache: - apt -branches: - except: - - /*?pp?eyor*/ - - before_install: # we need a recent version of CMake # - sudo add-apt-repository -y ppa:andykimpe/cmake3 # linux prereqisite packages - if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget --no-check-certificate https://www.cmake.org/files/v3.2/cmake-3.2.3-Linux-x86_64.tar.gz; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzf cmake-3.2.3-Linux-x86_64.tar.gz -C ..; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/../cmake-3.2.3-Linux-x86_64/bin:$PATH; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf cmake-3.2.3-Linux-x86_64.tar.gz; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then export PATH=$PWD/cmake-3.2.3-Linux-x86_64/bin:$PATH; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev libsqlite3-dev; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y unixodbc-dev libmysqlclient-dev libsqlite3-dev; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y g++-arm-linux-gnueabi g++-arm-linux-gnueabihf clang-3.5; fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y sloccount cppcheck; fi - + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq; fi + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -qq -y g++-4.8; fi services: - mongodb - redis-server - - mysql notifications: slack: rooms: - - pocoproject:4iwY1QpB8fdU2WqpcZ6PpZhz#travis - - kampbell:v4ARuptk0ETzwUsKDdV6Gspb#poco + - pocoproject:ItIUZvs8aJGyPdaKxIKMnS1t#travis env: - global: TEST_NAME="" - + global: + TEST_NAME="" + before_script: - echo ${TEST_NAME} - sqlite3 -version + - chmod 755 ./travis/Linux/runtests.sh + - chmod 755 ./travis/OSX/runtests.sh matrix: include: - env: TEST_NAME="OSX clang (make) bundled" - compiler: clang os: osx + compiler: clang script: - - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make -j2 - - cat config.* + - export CC="clang" + - export CXX="clang++" + - clang++ -x c++ /dev/null -dM -E + - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make -s -j2 - sudo make install - - ls -l /usr/local/lib/*Poco* - - find . -name "*testrunner*" - - ./travis/runtests.sh + - ./travis/OSX/runtests.sh - - env: TEST_NAME="Linux gcc (make) bundled" + - env: TEST_NAME="Linux gcc 4.6 (make) bundled" compiler: gcc script: + - export CC="gcc" + - export CXX="g++" - ./configure --everything && make -s -j2 - - sudo make install - - ./travis/runtests.sh + - ./travis/Linux/runtests.sh - - env: TEST_NAME="Linux gcc (make) unbundled" + - env: TEST_NAME="Linux gcc 4.8 (make) bundled" + compiler: gcc + script: + - export CC="gcc-4.8" + - export CXX="g++-4.8" + - ./configure --everything && make -s -j2 + - ./travis/Linux/runtests.sh + + - env: TEST_NAME="Linux gcc 4.6 (make) unbundled" + compiler: gcc + script: + - export CC="gcc" + - export CXX="g++" + - sudo apt-get install -qq -y libpcre3-dev libssl-dev libexpat1-dev + - ./configure --everything --unbundled && make -s -j2 + - ./travis/Linux/runtests.sh + + - env: TEST_NAME="Linux gcc 4.8 (make) unbundled" compiler: gcc script: - sudo apt-get install -qq -y libpcre3-dev libssl-dev libexpat1-dev + - export CC="gcc-4.8" + - export CXX="g++-4.8" - ./configure --everything --unbundled && make -s -j2 - - sudo make install - - ./travis/runtests.sh + - ./travis/Linux/runtests.sh - - env: TEST_NAME="Linux clang (make)" + - env: TEST_NAME="Linux clang 3.4 (make)" compiler: clang script: - ./configure --everything --config=Linux-clang && make -s -j2 - - sudo make install - - ./travis/runtests.sh + - ./travis/Linux/runtests.sh - - env: TEST_NAME="Linux arm-linux-gnueabi- (make)" - script: - - ./configure --omit=Data/ODBC,Data/MySQL,Crypto,NetSSL,PageCompiler && make -s -j2 CROSS_COMPILE=arm-linux-gnueabi- POCO_TARGET_OSARCH=armv7l + #FIXME the -m64 option bring by the Linux config is not supported by arm-linux-gnueabi-g++ which makes this test failing + #FIXME - env: TEST_NAME="arm-linux-gnueabi- (make)" + #FIXME script: + #FIXME - ./configure --omit=Data/ODBC,Data/MySQL,Crypto,NetSSL,PageCompiler && make -s -j2 CROSS_COMPILE=arm-linux-gnueabi- POCO_TARGET_OSARCH=armv7l - - env: TEST_NAME="Linux gcc (CMake)" + - env: TEST_NAME="Linux gcc 4.6 (CMake)" compiler: gcc script: - # disable tests, gcc-4.6 gets an internal compiler error - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=OFF .. && make -j2 && cd .. + - export CC="gcc" + - export CXX="g++" + - source ./travis/ignored.sh + - export POCO_BASE=`pwd` + - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd .. - - env: TEST_NAME="gcc-4.8 (CMake)" + - env: TEST_NAME="Linux gcc 4.8 (CMake)" compiler: gcc script: - - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo apt-get update -qq - - sudo apt-get install -qq -y g++-4.8 - export CC="gcc-4.8" - export CXX="g++-4.8" - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -j2 && cd .. + - source ./travis/ignored.sh + - export POCO_BASE=`pwd` + - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd .. - - env: TEST_NAME="Linux clang (CMake)" + - env: TEST_NAME="clang 3.4 (CMake)" compiler: clang script: - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -j2 && cd .. + - source ./travis/ignored.sh + - export POCO_BASE=`pwd` + - mkdir cmake-build && cd cmake-build && cmake -DENABLE_TESTS=ON .. && make -s -j2 && ctest -VV -E Data && cd .. - env: TEST_NAME="Linux arm-linux-gnueabi-g++ (CMake)" script: - export CC="arm-linux-gnueabi-gcc" - export CXX="arm-linux-gnueabi-g++" - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=OFF .. && make -j2 && cd .. + - source ./travis/ignored.sh + - export POCO_BASE=`pwd` + - mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. + - make -s -j2 && cd .. - env: TEST_NAME="Linux arm-linux-gnueabihf-g++ (CMake)" script: - export CC="arm-linux-gnueabihf-gcc" - export CXX="arm-linux-gnueabihf-g++" - - mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=OFF .. && make -j2 && cd .. + - source ./travis/ignored.sh + - export POCO_BASE=`pwd` + - mkdir cmake-build && cd cmake-build && cmake -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_TESTS=ON .. + - make -s -j2 && cd .. # TODO osx build # TODO run test suite @@ -123,9 +150,11 @@ matrix: # QA jobs for code analytics and metrics # build documentation and release - - env: TEST_NAME="documentation & release" + - env: TEST_NAME="Linux documentation & release" compiler: gcc script: + - export CC="gcc" + - export CXX="g++" - . env.sh && mkdoc all && mkrel all # static code analysis with cppcheck (we can add --enable=all later) diff --git a/travis/Linux/excluded.sh b/travis/Linux/excluded.sh new file mode 100755 index 000000000..4f04e8c2d --- /dev/null +++ b/travis/Linux/excluded.sh @@ -0,0 +1,2 @@ +export EXCLUDE_TESTS="Data/MySQL Data/ODBC PDF" + diff --git a/travis/Linux/runtests.sh b/travis/Linux/runtests.sh new file mode 100755 index 000000000..666932a7d --- /dev/null +++ b/travis/Linux/runtests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# set -ev +set -v +export POCO_BASE=`pwd` +export PATH=$PATH:. +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. +source ./travis/ignored.sh +source ./travis/Linux/excluded.sh +build/script/runtests.sh diff --git a/travis/OSX/excluded.sh b/travis/OSX/excluded.sh new file mode 100755 index 000000000..889bddcd3 --- /dev/null +++ b/travis/OSX/excluded.sh @@ -0,0 +1,7 @@ +# +# MongoDB & Redis does not work on Travis OSX +# should be restored later on when the OSX environment would have +# been fixed by Travis +# +export EXCLUDE_TESTS="Data/MySQL Data/ODBC MongoDB Redis PDF" + diff --git a/travis/OSX/runtests.sh b/travis/OSX/runtests.sh new file mode 100755 index 000000000..3445e88fa --- /dev/null +++ b/travis/OSX/runtests.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# set -ev +set -v +export POCO_BASE=`pwd` +export PATH=$PATH:. +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. +source ./travis/ignored.sh +source ./travis/OSX/excluded.sh +build/script/runtests.sh + diff --git a/travis/ignored.sh b/travis/ignored.sh new file mode 100755 index 000000000..1332ee380 --- /dev/null +++ b/travis/ignored.sh @@ -0,0 +1,10 @@ +export CPPUNIT_IGNORE="\ + N7CppUnit10TestCallerI8PathTestEE.testExpand \ + N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4 \ + N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4 \ + N7CppUnit10TestCallerI14ICMPClientTestEE.testPing \ + N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy \ + N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy \ + N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast \ + N7CppUnit10TestCallerI13NTPClientTestEE.testTimeSync" + diff --git a/travis/runtests.sh b/travis/runtests.sh deleted file mode 100755 index 05b69b0bc..000000000 --- a/travis/runtests.sh +++ /dev/null @@ -1,17 +0,0 @@ -trap -p -set -ev -export POCO_BASE=`pwd` -export CPPUNIT_IGNORE="\ - N7CppUnit10TestCallerI8PathTestEE.testExpand, \ - N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4, \ - N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4, \ - N7CppUnit10TestCallerI14ICMPClientTestEE.testPing, \ - N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy, \ - N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy, \ - N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast, \ - N7CppUnit10TestCallerI13NTPClientTestEE.testTimeSync" - -export EXCLUDE_TESTS="Data/MySQL Data/ODBC PDF" -export PATH=$PATH:. -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. -build/script/runtests.sh From 0ad44d68de200841bfe575965244ae970c85a735 Mon Sep 17 00:00:00 2001 From: FrancisANDRE Date: Wed, 13 Jan 2016 14:05:08 +0100 Subject: [PATCH 07/23] Signed-off-by: FrancisANDRE --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6d3f769d8..515378df7 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ poco: libexecs $(if $(TESTS),tests) $(if $(SAMPLES),samples) all: libexecs tests samples INSTALLDIR = $(DESTDIR)$(POCO_PREFIX) -COMPONENTS = Foundation XML JSON Util Net Crypto NetSSL_OpenSSL Data Data/SQLite Data/ODBC Data/MySQL MongoDB Redis Zip PageCompiler PageCompiler/File2Page CppParser PDF +COMPONENTS = CppUnit Foundation XML JSON Util Net Crypto NetSSL_OpenSSL Data Data/SQLite Data/ODBC Data/MySQL MongoDB Redis Zip PageCompiler PageCompiler/File2Page CppParser PDF cppunit: $(MAKE) -C $(POCO_BASE)/CppUnit @@ -91,11 +91,13 @@ install: libexecs fi ; \ done ifeq ($(OSNAME), Cygwin) - find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "cygPoco*" -type f -exec cp -f {} $(INSTALLDIR)/bin \; - find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "cygPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/bin \; + find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "cygPoco*" -type f -exec cp -f {} $(INSTALLDIR)/bin \; + find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "cygPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/bin \; endif - find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "libPoco*" -type f -exec cp -f {} $(INSTALLDIR)/lib \; - find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "libPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/lib \; + find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "libCppUnit*" -type f -exec cp -f {} $(INSTALLDIR)/lib \; + find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "libCppUnit*" -type l -exec cp -Rf {} $(INSTALLDIR)/lib \; + find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "libPoco*" -type f -exec cp -f {} $(INSTALLDIR)/lib \; + find $(POCO_BUILD)/lib/$(OSNAME)/$(OSARCH) -name "libPoco*" -type l -exec cp -Rf {} $(INSTALLDIR)/lib \; libexecs = Foundation-libexec XML-libexec JSON-libexec Util-libexec Net-libexec Crypto-libexec NetSSL_OpenSSL-libexec Data-libexec Data/SQLite-libexec Data/ODBC-libexec Data/MySQL-libexec MongoDB-libexec Redis-libexec Zip-libexec PageCompiler-libexec PageCompiler/File2Page-libexec CppParser-libexec PDF-libexec tests = Foundation-tests XML-tests JSON-tests Util-tests Net-tests Crypto-tests NetSSL_OpenSSL-tests Data-tests Data/SQLite-tests Data/ODBC-tests Data/MySQL-tests MongoDB-tests Redis-tests Zip-tests CppParser-tests PDF-tests From 3983cd2f110583a6f521e80dff69f92da703d72a Mon Sep 17 00:00:00 2001 From: FrancisANDRE Date: Wed, 13 Jan 2016 14:12:13 +0100 Subject: [PATCH 08/23] Separate tests to ignore by ',' Signed-off-by: FrancisANDRE --- travis/ignored.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) mode change 100755 => 100644 travis/ignored.sh diff --git a/travis/ignored.sh b/travis/ignored.sh old mode 100755 new mode 100644 index 1332ee380..57aa2c2a4 --- a/travis/ignored.sh +++ b/travis/ignored.sh @@ -1,10 +1,10 @@ export CPPUNIT_IGNORE="\ - N7CppUnit10TestCallerI8PathTestEE.testExpand \ - N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4 \ - N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4 \ - N7CppUnit10TestCallerI14ICMPClientTestEE.testPing \ - N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy \ - N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy \ - N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast \ + N7CppUnit10TestCallerI8PathTestEE.testExpand, \ + N7CppUnit10TestCallerI13RawSocketTestEE.testEchoIPv4, \ + N7CppUnit10TestCallerI13RawSocketTestEE.testSendToReceiveFromIPv4, \ + N7CppUnit10TestCallerI14ICMPClientTestEE.testPing, \ + N7CppUnit10TestCallerI22HTTPSClientSessionTestEE.testProxy, \ + N7CppUnit10TestCallerI22HTTPSStreamFactoryTestEE.testProxy, \ + N7CppUnit10TestCallerI19MulticastSocketTestEE.testMulticast, \ N7CppUnit10TestCallerI13NTPClientTestEE.testTimeSync" From 0b5c50941c20df16ecf764ffead6af70a026a3ec Mon Sep 17 00:00:00 2001 From: Aleksandar Fabijanic Date: Thu, 14 Jan 2016 08:23:56 -0600 Subject: [PATCH 09/23] Wrong error code if Sec-WebSocket-Accept header field missed or value wrong #1120 --- Net/src/WebSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Net/src/WebSocket.cpp b/Net/src/WebSocket.cpp index 98812bb2e..485236f32 100644 --- a/Net/src/WebSocket.cpp +++ b/Net/src/WebSocket.cpp @@ -211,7 +211,7 @@ WebSocketImpl* WebSocket::completeHandshake(HTTPClientSession& cs, HTTPResponse& throw WebSocketException("No Upgrade: websocket header in handshake response", WS_ERR_NO_HANDSHAKE); std::string accept = response.get("Sec-WebSocket-Accept", ""); if (accept != computeAccept(key)) - throw WebSocketException("Invalid or missing Sec-WebSocket-Accept header in handshake response", WS_ERR_NO_HANDSHAKE); + throw WebSocketException("Invalid or missing Sec-WebSocket-Accept header in handshake response", WS_ERR_HANDSHAKE_ACCEPT); return new WebSocketImpl(static_cast(cs.detachSocket().impl()), true); } From 9e010930cfcc6d05f9dc4c1ed45d3ada87f411d6 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sat, 16 Jan 2016 10:00:36 +0100 Subject: [PATCH 10/23] Add mime RFC2047 decoder to MessageHeader Add RFC2047 word decode to MessageHeader class --- Net/src/MessageHeader.cpp | 129 +++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/Net/src/MessageHeader.cpp b/Net/src/MessageHeader.cpp index 2a41d8e94..c3ad4877a 100644 --- a/Net/src/MessageHeader.cpp +++ b/Net/src/MessageHeader.cpp @@ -18,7 +18,12 @@ #include "Poco/Net/NetException.h" #include "Poco/String.h" #include "Poco/Ascii.h" +#include "Poco/TextConverter.h" +#include "Poco/StringTokenizer.h" +#include "Poco/Base64Decoder.h" +#include "Poco/UTF8Encoding.h" +#include namespace Poco { namespace Net { @@ -98,7 +103,7 @@ void MessageHeader::read(std::istream& istr) throw MessageException("Folded field value too long/no CRLF found"); } Poco::trimRightInPlace(value); - add(name, value); + add(name, decodeWord(value)); ++fields; } istr.putback(ch); @@ -253,5 +258,127 @@ void MessageHeader::quote(const std::string& value, std::string& result, bool al if (mustQuote) result += '"'; } +void MessageHeader::decodeRFC2047(const std::string& ins, std::string& outs, const std::string& charset_to) { + std::string tempout; + StringTokenizer tokens(ins, "?"); + + + std::string charset = toUpper(tokens[0]); + std::string encoding = toUpper(tokens[1]); + std::string text = tokens[2]; + + std::istringstream istr(text); + + if (encoding == "B") { + // Base64 encoding. + Base64Decoder decoder(istr); + for (char c; decoder.get(c); tempout += c) {} + } + else if (encoding == "Q") { + // Quoted encoding. + for (char c; istr.get(c);) { + if (c == '_') { + //RFC 2047 _ is a space. + tempout += " "; + continue; + } + + // FIXME: check that we have enought chars- + if (c == '=') { + // The next two chars are hex representation of the complete byte. + std::string hex; + for (int i = 0; i < 2; i++) { + istr.get(c); + hex += c; + } + hex = toUpper(hex); + tempout += (char)(int)strtol(hex.c_str(), 0, 16); + continue; + } + tempout += c; + } + } + else { + // Wrong encoding + outs = ins; + return; + } + + // convert to the right charset. + if (charset != charset_to) { + try { + TextEncoding& enc = TextEncoding::byName(charset); + TextEncoding& dec = TextEncoding::byName(charset_to); + TextConverter converter(enc, dec); + converter.convert(tempout, outs); + } + catch (...) { + // FIXME: Unsuported encoding... + outs = tempout; + } + } + else { + // Not conversion necesary. + outs = tempout; + } +} + + +std::string MessageHeader::decodeWord(const std::string& text, const std::string& charset) +{ + std::string outs, tmp = text; + do { + std::string tmp2; + // find the begining of the next rfc2047 chunk + auto pos = tmp.find("=?"); + if (pos == std::string::npos) { + // No more found, return + outs += tmp; + break; + } + + // check if there are standar text before the rfc2047 chunk, and if so, copy it. + if (pos > 0) { + outs += tmp.substr(0, pos - 1); + } + + // remove text already copied. + tmp = tmp.substr(pos + 2); + + // find the first separator + auto pos1 = tmp.find("?"); + if (pos1 == std::string::npos) { + // not found. + outs += tmp; + break; + } + + // find the second separator + auto pos2 = tmp.find("?", pos1 + 1); + if (pos2 == std::string::npos) { + // not found + outs += tmp; + break; + } + + // find the end of the actual rfc2047 chunk + auto pos3 = tmp.find("?=", pos2 + 1); + if (pos3 == std::string::npos) { + // not found. + outs += tmp; + break; + + } + // At this place, there are a valid rfc2047 chunk, so decode and copy the result. + decodeRFC2047(tmp.substr(0, pos3), tmp2, charset); + outs += tmp2; + + // Jump at the rest of the string and repeat the whole process. + tmp = tmp.substr(pos3 + 2); + } while (true); + + return outs; +} + } } // namespace Poco::Net From 37d5cf9d4660719b2e25bc6f304bc9a2e1b4fb19 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sat, 16 Jan 2016 10:04:41 +0100 Subject: [PATCH 11/23] Update MessageHeader.h --- Net/include/Poco/Net/MessageHeader.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Net/include/Poco/Net/MessageHeader.h b/Net/include/Poco/Net/MessageHeader.h index 964d0216d..3c402f19f 100644 --- a/Net/include/Poco/Net/MessageHeader.h +++ b/Net/include/Poco/Net/MessageHeader.h @@ -147,6 +147,11 @@ public: /// appended to result, enclosed in double-quotes. /// Otherwise, the value is appended to result as-is. + static void decodeRFC2047(const std::string& ins, std::string& outs, const std::string& charset = "UTF-8"); + static std::string decodeWord(const std::string& text, const std::string& charset = "UTF-8"); + /// Decode RFC2047 string. + + private: enum Limits /// Limits for basic sanity checks when reading a header From 25f2f9b66bc5cdb8ddc4f6df347a1bcdec0d0281 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sat, 16 Jan 2016 10:46:06 +0100 Subject: [PATCH 12/23] Removed auto type as is not accepted -- --- Net/src/MessageHeader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Net/src/MessageHeader.cpp b/Net/src/MessageHeader.cpp index c3ad4877a..8c08654b1 100644 --- a/Net/src/MessageHeader.cpp +++ b/Net/src/MessageHeader.cpp @@ -346,7 +346,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string tmp = tmp.substr(pos + 2); // find the first separator - auto pos1 = tmp.find("?"); + int pos1 = tmp.find("?"); if (pos1 == std::string::npos) { // not found. outs += tmp; @@ -354,7 +354,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string } // find the second separator - auto pos2 = tmp.find("?", pos1 + 1); + int pos2 = tmp.find("?", pos1 + 1); if (pos2 == std::string::npos) { // not found outs += tmp; @@ -362,7 +362,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string } // find the end of the actual rfc2047 chunk - auto pos3 = tmp.find("?=", pos2 + 1); + int pos3 = tmp.find("?=", pos2 + 1); if (pos3 == std::string::npos) { // not found. outs += tmp; From fc2fd470ffa788dcc087eb4029450f128c51e133 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sat, 16 Jan 2016 11:26:50 +0100 Subject: [PATCH 13/23] Removed a one more auto. --- Net/src/MessageHeader.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Net/src/MessageHeader.cpp b/Net/src/MessageHeader.cpp index 8c08654b1..2030a4364 100644 --- a/Net/src/MessageHeader.cpp +++ b/Net/src/MessageHeader.cpp @@ -330,7 +330,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string do { std::string tmp2; // find the begining of the next rfc2047 chunk - auto pos = tmp.find("=?"); + size_t pos = tmp.find("=?"); if (pos == std::string::npos) { // No more found, return outs += tmp; @@ -346,7 +346,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string tmp = tmp.substr(pos + 2); // find the first separator - int pos1 = tmp.find("?"); + size_t pos1 = tmp.find("?"); if (pos1 == std::string::npos) { // not found. outs += tmp; @@ -354,7 +354,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string } // find the second separator - int pos2 = tmp.find("?", pos1 + 1); + size_t pos2 = tmp.find("?", pos1 + 1); if (pos2 == std::string::npos) { // not found outs += tmp; @@ -362,7 +362,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string } // find the end of the actual rfc2047 chunk - int pos3 = tmp.find("?=", pos2 + 1); + size_t pos3 = tmp.find("?=", pos2 + 1); if (pos3 == std::string::npos) { // not found. outs += tmp; From f94d20492af43e1f9e19b5982e4edba2a0db1d49 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sat, 16 Jan 2016 22:54:30 +0100 Subject: [PATCH 14/23] Small fix on MessageHeader decodeWord. --- Net/src/MessageHeader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Net/src/MessageHeader.cpp b/Net/src/MessageHeader.cpp index 2030a4364..6745192eb 100644 --- a/Net/src/MessageHeader.cpp +++ b/Net/src/MessageHeader.cpp @@ -339,7 +339,7 @@ std::string MessageHeader::decodeWord(const std::string& text, const std::string // check if there are standar text before the rfc2047 chunk, and if so, copy it. if (pos > 0) { - outs += tmp.substr(0, pos - 1); + outs += tmp.substr(0, pos); } // remove text already copied. From 8c98e4303c13d0936d83387f402bf8d35340dd26 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sun, 17 Jan 2016 09:27:28 +0100 Subject: [PATCH 15/23] Add test case for MessageHeader decodeWord --- Net/testsuite/src/MessageHeaderTest.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Net/testsuite/src/MessageHeaderTest.cpp b/Net/testsuite/src/MessageHeaderTest.cpp index 793119f02..e94e7e8f4 100644 --- a/Net/testsuite/src/MessageHeaderTest.cpp +++ b/Net/testsuite/src/MessageHeaderTest.cpp @@ -362,6 +362,23 @@ void MessageHeaderTest::testFieldLimit() } +void MessageHeaderTest::testDecodeWord() +{ + std::string coded("this is pure ASCII"); + std::string decoded = MessageHeader::decodeWord(coded, "ISO-8859-1"); + assert(decoded == coded); + + coded = "(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)"; + decoded = MessageHeader::decodeWord(coded, "ISO-8859-1"); + assert(decoded == "(a b)"); + + coded = "Hello =?UTF-8?B?RnJhbmNpcw==?=, good bye"; + decoded = MessageHeader::decodeWord(coded, "ISO-8859-1"); + assert(decoded == "Hello Francis, good bye"); +} + + + void MessageHeaderTest::setUp() { } @@ -392,6 +409,7 @@ CppUnit::Test* MessageHeaderTest::suite() CppUnit_addTest(pSuite, MessageHeaderTest, testSplitElements); CppUnit_addTest(pSuite, MessageHeaderTest, testSplitParameters); CppUnit_addTest(pSuite, MessageHeaderTest, testFieldLimit); - + CppUnit_addTest(pSuite, MessageHeaderTest, testDecodeWord); + return pSuite; } From cdb30f39f35b8516e01920179992231c88dbbb58 Mon Sep 17 00:00:00 2001 From: kmribti Date: Sun, 17 Jan 2016 09:28:15 +0100 Subject: [PATCH 16/23] Add test case for MessageHeader decodeWord --- Net/testsuite/src/MessageHeaderTest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Net/testsuite/src/MessageHeaderTest.h b/Net/testsuite/src/MessageHeaderTest.h index 156db25ed..759d55643 100644 --- a/Net/testsuite/src/MessageHeaderTest.h +++ b/Net/testsuite/src/MessageHeaderTest.h @@ -42,6 +42,7 @@ public: void testSplitElements(); void testSplitParameters(); void testFieldLimit(); + void testDecodeWord(); void setUp(); void tearDown(); From 556b4bd32f64452437a3cd18e98d67b680b7e517 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 19 Jan 2016 11:36:02 +0100 Subject: [PATCH 17/23] NetSSL: add support for disabling certain protocols --- NetSSL_OpenSSL/include/Poco/Net/Context.h | 17 ++++++++++ NetSSL_OpenSSL/include/Poco/Net/SSLManager.h | 4 +++ NetSSL_OpenSSL/src/Context.cpp | 35 ++++++++++++++++++++ NetSSL_OpenSSL/src/SSLManager.cpp | 22 ++++++++++++ 4 files changed, 78 insertions(+) diff --git a/NetSSL_OpenSSL/include/Poco/Net/Context.h b/NetSSL_OpenSSL/include/Poco/Net/Context.h index 24a5bc156..805885381 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/Context.h +++ b/NetSSL_OpenSSL/include/Poco/Net/Context.h @@ -95,6 +95,15 @@ public: /// /// Client: Same as VERIFY_RELAXED. }; + + enum Protocols + { + PROTO_SSLV2 = 0x01, + PROTO_SSLV3 = 0x02, + PROTO_TLSV1 = 0x04, + PROTO_TLSV1_1 = 0x08, + PROTO_TLSV1_2 = 0x10 + }; Context( Usage usage, @@ -265,6 +274,14 @@ public: /// session resumption. /// /// The feature can be disabled by calling this method. + + void disableProtocols(int protocols); + /// Disables the given protocols. + /// + /// The protocols to be disabled are specified by OR-ing + /// values from the Protocols enumeration, e.g.: + /// + /// context.disableProtocols(PROTO_SSLV2 | PROTO_SSLV3) private: void createSSLContext(); diff --git a/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h b/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h index 8aa1c8f81..058c73bac 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h +++ b/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h @@ -94,6 +94,7 @@ class NetSSL_API SSLManager /// true|false /// true|false /// true|false + /// sslv2,sslv3,tlsv1,tlsv1_1,tlsv1_2 /// /// false /// @@ -137,6 +138,8 @@ class NetSSL_API SSLManager /// - requireTLSv1 (boolean): Require a TLSv1 connection. /// - requireTLSv1_1 (boolean): Require a TLSv1.1 connection. /// - requireTLSv1_2 (boolean): Require a TLSv1.2 connection. + /// - disableProtocols (string): A comma-separated list of protocols that should be + /// disabled. Valid protocol names are sslv2, sslv3, tlsv1, tlsv1_1, tlsv1_2. /// - fips: Enable or disable OpenSSL FIPS mode. Only supported if the OpenSSL version /// that this library is built against supports FIPS mode. { @@ -320,6 +323,7 @@ private: static const std::string CFG_REQUIRE_TLSV1; static const std::string CFG_REQUIRE_TLSV1_1; static const std::string CFG_REQUIRE_TLSV1_2; + static const std::string CFG_DISABLE_PROTOCOLS; #ifdef OPENSSL_FIPS static const std::string CFG_FIPS_MODE; diff --git a/NetSSL_OpenSSL/src/Context.cpp b/NetSSL_OpenSSL/src/Context.cpp index 20c2ff6be..7a79cf0d0 100644 --- a/NetSSL_OpenSSL/src/Context.cpp +++ b/NetSSL_OpenSSL/src/Context.cpp @@ -317,6 +317,41 @@ void Context::disableStatelessSessionResumption() } +void Context::disableProtocols(int protocols) +{ + if (protocols & PROTO_SSLV2) + { +#if defined(SSL_OP_NO_SSLv2) + SSL_CTX_set_options(_pSSLContext, SSL_OP_NO_SSLv2); +#endif + } + if (protocols & PROTO_SSLV3) + { +#if defined(SSL_OP_NO_SSLv3) + SSL_CTX_set_options(_pSSLContext, SSL_OP_NO_SSLv3); +#endif + } + if (protocols & PROTO_TLSV1) + { +#if defined(SSL_OP_NO_TLSv1) + SSL_CTX_set_options(_pSSLContext, SSL_OP_NO_TLSv1); +#endif + } + if (protocols & PROTO_TLSV1_1) + { +#if defined(SSL_OP_NO_TLSv1_1) + SSL_CTX_set_options(_pSSLContext, SSL_OP_NO_TLSv1_1); +#endif + } + if (protocols & PROTO_TLSV1_2) + { +#if defined(SSL_OP_NO_TLSv1_2) + SSL_CTX_set_options(_pSSLContext, SSL_OP_NO_TLSv1_2); +#endif + } +} + + void Context::createSSLContext() { if (SSLManager::isFIPSEnabled()) diff --git a/NetSSL_OpenSSL/src/SSLManager.cpp b/NetSSL_OpenSSL/src/SSLManager.cpp index e881ebbb1..f58e5ae18 100644 --- a/NetSSL_OpenSSL/src/SSLManager.cpp +++ b/NetSSL_OpenSSL/src/SSLManager.cpp @@ -23,6 +23,7 @@ #include "Poco/Net/SSLException.h" #include "Poco/SingletonHolder.h" #include "Poco/Delegate.h" +#include "Poco/StringTokenizer.h" #include "Poco/Util/Application.h" #include "Poco/Util/OptionException.h" @@ -57,6 +58,7 @@ const std::string SSLManager::CFG_EXTENDED_VERIFICATION("extendedVerification"); const std::string SSLManager::CFG_REQUIRE_TLSV1("requireTLSv1"); const std::string SSLManager::CFG_REQUIRE_TLSV1_1("requireTLSv1_1"); const std::string SSLManager::CFG_REQUIRE_TLSV1_2("requireTLSv1_2"); +const std::string SSLManager::CFG_DISABLE_PROTOCOLS("disableProtocols"); #ifdef OPENSSL_FIPS const std::string SSLManager::CFG_FIPS_MODE("openSSL.fips"); const bool SSLManager::VAL_FIPS_MODE(false); @@ -300,6 +302,26 @@ void SSLManager::initDefaultContext(bool server) _ptrDefaultClientContext = new Context(usage, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cipherList); } + std::string disabledProtocolsList = config.getString(prefix + CFG_DISABLE_PROTOCOLS, ""); + Poco::StringTokenizer dpTok(disabledProtocolsList, ";,", Poco::StringTokenizer::TOK_TRIM | Poco::StringTokenizer::TOK_IGNORE_EMPTY); + int disabledProtocols = 0; + for (Poco::StringTokenizer::Iterator it = dpTok.begin(); it != dpTok.end(); ++it) + { + if (*it == "sslv2") + disabledProtocols |= Context::PROTO_SSLV2; + else if (*it == "sslv3") + disabledProtocols |= Context::PROTO_SSLV3; + else if (*it == "tlsv1") + disabledProtocols |= Context::PROTO_TLSV1; + else if (*it == "tlsv1_1") + disabledProtocols |= Context::PROTO_TLSV1_1; + else if (*it == "tlsv1_2") + disabledProtocols |= Context::PROTO_TLSV1_2; + } + if (server) + _ptrDefaultServerContext->disableProtocols(disabledProtocols); + else + _ptrDefaultClientContext->disableProtocols(disabledProtocols); bool cacheSessions = config.getBool(prefix + CFG_CACHE_SESSIONS, false); if (server) From b5572b3e592b97b2f0d3ae41fed3e52f7fc1a7fb Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 19 Jan 2016 11:45:35 +0100 Subject: [PATCH 18/23] add Path::PATH_URI for URI paths (same as PATH_UNIX) --- Foundation/include/Poco/Path.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Foundation/include/Poco/Path.h b/Foundation/include/Poco/Path.h index f6e824d41..6a79d46a7 100644 --- a/Foundation/include/Poco/Path.h +++ b/Foundation/include/Poco/Path.h @@ -42,11 +42,12 @@ class Foundation_API Path public: enum Style { - PATH_UNIX, /// Unix-style path - PATH_WINDOWS, /// Windows-style path - PATH_VMS, /// VMS-style path - PATH_NATIVE, /// The current platform's native style - PATH_GUESS /// Guess the style by examining the path + PATH_UNIX, /// Unix-style path + PATH_URI = PATH_UNIX, /// URI-style path, same as Unix-style + PATH_WINDOWS, /// Windows-style path + PATH_VMS, /// VMS-style path + PATH_NATIVE, /// The current platform's native style + PATH_GUESS /// Guess the style by examining the path }; typedef std::vector StringVec; From 20c772d17b63dfbf6ae4e50affc0ec6a8ace9309 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 19 Jan 2016 15:19:14 +0100 Subject: [PATCH 19/23] added support for ECDH, new Context ctor --- NetSSL_OpenSSL/include/Poco/Net/Context.h | 64 +++- NetSSL_OpenSSL/include/Poco/Net/SSLManager.h | 8 + NetSSL_OpenSSL/src/Context.cpp | 340 +++++++++++++------ NetSSL_OpenSSL/src/SSLManager.cpp | 31 +- 4 files changed, 318 insertions(+), 125 deletions(-) diff --git a/NetSSL_OpenSSL/include/Poco/Net/Context.h b/NetSSL_OpenSSL/include/Poco/Net/Context.h index 805885381..4d57b3f6e 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/Context.h +++ b/NetSSL_OpenSSL/include/Poco/Net/Context.h @@ -104,6 +104,58 @@ public: PROTO_TLSV1_1 = 0x08, PROTO_TLSV1_2 = 0x10 }; + + struct Params + { + Params(); + /// Initializes the struct with default values. + + std::string privateKeyFile; + /// Path to the private key file used for encryption. + /// Can be empty if no private key file is used. + + std::string certificateFile; + /// Path to the certificate file (in PEM format). + /// If the private key and the certificate are stored in the same file, this + /// can be empty if privateKeyFile is given. + + std::string caLocation; + /// Path to the file or directory containing the CA/root certificates. + /// Can be empty if the OpenSSL builtin CA certificates + /// are used (see loadDefaultCAs). + + VerificationMode verificationMode; + /// Specifies whether and how peer certificates are validated. + /// Defaults to VERIFY_RELAXED. + + int verificationDepth; + /// Sets the upper limit for verification chain sizes. Verification + /// will fail if a certificate chain larger than this is encountered. + /// Defaults to 9. + + bool loadDefaultCAs; + /// Specifies whether the builtin CA certificates from OpenSSL are used. + /// Defaults to false. + + std::string cipherList; + /// Specifies the supported ciphers in OpenSSL notation. + /// Defaults to "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH". + + std::string dhParamsFile; + /// Specifies a file containing Diffie-Hellman parameters. + /// If empty, the default parameters are used. + + std::string ecdhCurve; + /// Specifies the name of the curve to use for ECDH, based + /// on the curve names specified in RFC 4492. + /// Defaults to "prime256v1". + }; + + Context(Usage usage, const Params& params); + /// Creates a Context using the given parameters. + /// + /// * usage specifies whether the context is used by a client or server. + /// * params specifies the context parameters. Context( Usage usage, @@ -281,9 +333,19 @@ public: /// The protocols to be disabled are specified by OR-ing /// values from the Protocols enumeration, e.g.: /// - /// context.disableProtocols(PROTO_SSLV2 | PROTO_SSLV3) + /// context.disableProtocols(PROTO_SSLV2 | PROTO_SSLV3); private: + void init(const Params& params); + /// Initializes the Context with the given parameters. + + void initDH(const std::string& dhFile); + /// Initializes the Context with Diffie-Hellman parameters. + + void initECDH(const std::string& curve); + /// Initializes the Context with Elliptic-Curve Diffie-Hellman key + /// exchange curve parameters. + void createSSLContext(); /// Create a SSL_CTX object according to Context configuration. diff --git a/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h b/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h index 058c73bac..df9f27716 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h +++ b/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h @@ -95,6 +95,8 @@ class NetSSL_API SSLManager /// true|false /// true|false /// sslv2,sslv3,tlsv1,tlsv1_1,tlsv1_2 + /// dh.pem + /// prime256v1 /// /// false /// @@ -140,6 +142,10 @@ class NetSSL_API SSLManager /// - requireTLSv1_2 (boolean): Require a TLSv1.2 connection. /// - disableProtocols (string): A comma-separated list of protocols that should be /// disabled. Valid protocol names are sslv2, sslv3, tlsv1, tlsv1_1, tlsv1_2. + /// - dhParamsFile (string): Specifies a file containing Diffie-Hellman parameters. + /// If not specified or empty, the default parameters are used. + /// - ecdhCurve (string): Specifies the name of the curve to use for ECDH, based + /// on the curve names specified in RFC 4492. Defaults to "prime256v1". /// - fips: Enable or disable OpenSSL FIPS mode. Only supported if the OpenSSL version /// that this library is built against supports FIPS mode. { @@ -324,6 +330,8 @@ private: static const std::string CFG_REQUIRE_TLSV1_1; static const std::string CFG_REQUIRE_TLSV1_2; static const std::string CFG_DISABLE_PROTOCOLS; + static const std::string CFG_DH_PARAMS_FILE; + static const std::string CFG_ECDH_CURVE; #ifdef OPENSSL_FIPS static const std::string CFG_FIPS_MODE; diff --git a/NetSSL_OpenSSL/src/Context.cpp b/NetSSL_OpenSSL/src/Context.cpp index 7a79cf0d0..f8b606e8b 100644 --- a/NetSSL_OpenSSL/src/Context.cpp +++ b/NetSSL_OpenSSL/src/Context.cpp @@ -32,6 +32,25 @@ namespace Poco { namespace Net { +Context::Params::Params(): + verificationMode(VERIFY_RELAXED), + verificationDepth(9), + loadDefaultCAs(false), + cipherList("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH") +{ +} + + +Context::Context(Usage usage, const Params& params): + _usage(usage), + _mode(params.verificationMode), + _pSSLContext(0), + _extendedCertificateVerification(true) +{ + init(params); +} + + Context::Context( Usage usage, const std::string& privateKeyFile, @@ -46,72 +65,15 @@ Context::Context( _pSSLContext(0), _extendedCertificateVerification(true) { - Poco::Crypto::OpenSSLInitializer::initialize(); - - createSSLContext(); - - try - { - int errCode = 0; - if (!caLocation.empty()) - { - Poco::File aFile(caLocation); - if (aFile.isDirectory()) - errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, Poco::Path::transcode(caLocation).c_str()); - else - errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(caLocation).c_str(), 0); - if (errCode != 1) - { - std::string msg = Utility::getLastError(); - throw SSLContextException(std::string("Cannot load CA file/directory at ") + caLocation, msg); - } - } - - if (loadDefaultCAs) - { - errCode = SSL_CTX_set_default_verify_paths(_pSSLContext); - if (errCode != 1) - { - std::string msg = Utility::getLastError(); - throw SSLContextException("Cannot load default CA certificates", msg); - } - } - - if (!privateKeyFile.empty()) - { - errCode = SSL_CTX_use_PrivateKey_file(_pSSLContext, Poco::Path::transcode(privateKeyFile).c_str(), SSL_FILETYPE_PEM); - if (errCode != 1) - { - std::string msg = Utility::getLastError(); - throw SSLContextException(std::string("Error loading private key from file ") + privateKeyFile, msg); - } - } - - if (!certificateFile.empty()) - { - errCode = SSL_CTX_use_certificate_chain_file(_pSSLContext, Poco::Path::transcode(certificateFile).c_str()); - if (errCode != 1) - { - std::string errMsg = Utility::getLastError(); - throw SSLContextException(std::string("Error loading certificate from file ") + certificateFile, errMsg); - } - } - - if (isForServerUse()) - SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyServerCallback); - else - SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyClientCallback); - - SSL_CTX_set_cipher_list(_pSSLContext, cipherList.c_str()); - SSL_CTX_set_verify_depth(_pSSLContext, verificationDepth); - SSL_CTX_set_mode(_pSSLContext, SSL_MODE_AUTO_RETRY); - SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF); - } - catch (...) - { - SSL_CTX_free(_pSSLContext); - throw; - } + Params params; + params.privateKeyFile = privateKeyFile; + params.certificateFile = certificateFile; + params.caLocation = caLocation; + params.verificationMode = verificationMode; + params.verificationDepth = verificationDepth; + params.loadDefaultCAs = loadDefaultCAs; + params.cipherList = cipherList; + init(params); } @@ -127,52 +89,13 @@ Context::Context( _pSSLContext(0), _extendedCertificateVerification(true) { - Poco::Crypto::OpenSSLInitializer::initialize(); - - createSSLContext(); - - try - { - int errCode = 0; - if (!caLocation.empty()) - { - Poco::File aFile(caLocation); - if (aFile.isDirectory()) - errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, Poco::Path::transcode(caLocation).c_str()); - else - errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(caLocation).c_str(), 0); - if (errCode != 1) - { - std::string msg = Utility::getLastError(); - throw SSLContextException(std::string("Cannot load CA file/directory at ") + caLocation, msg); - } - } - - if (loadDefaultCAs) - { - errCode = SSL_CTX_set_default_verify_paths(_pSSLContext); - if (errCode != 1) - { - std::string msg = Utility::getLastError(); - throw SSLContextException("Cannot load default CA certificates", msg); - } - } - - if (isForServerUse()) - SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyServerCallback); - else - SSL_CTX_set_verify(_pSSLContext, verificationMode, &SSLManager::verifyClientCallback); - - SSL_CTX_set_cipher_list(_pSSLContext, cipherList.c_str()); - SSL_CTX_set_verify_depth(_pSSLContext, verificationDepth); - SSL_CTX_set_mode(_pSSLContext, SSL_MODE_AUTO_RETRY); - SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF); - } - catch (...) - { - SSL_CTX_free(_pSSLContext); - throw; - } + Params params; + params.caLocation = caLocation; + params.verificationMode = verificationMode; + params.verificationDepth = verificationDepth; + params.loadDefaultCAs = loadDefaultCAs; + params.cipherList = cipherList; + init(params); } @@ -190,6 +113,80 @@ Context::~Context() } +void Context::init(const Params& params) +{ + Poco::Crypto::OpenSSLInitializer::initialize(); + + createSSLContext(); + + try + { + int errCode = 0; + if (!params.caLocation.empty()) + { + Poco::File aFile(params.caLocation); + if (aFile.isDirectory()) + errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, Poco::Path::transcode(params.caLocation).c_str()); + else + errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(params.caLocation).c_str(), 0); + if (errCode != 1) + { + std::string msg = Utility::getLastError(); + throw SSLContextException(std::string("Cannot load CA file/directory at ") + params.caLocation, msg); + } + } + + if (params.loadDefaultCAs) + { + errCode = SSL_CTX_set_default_verify_paths(_pSSLContext); + if (errCode != 1) + { + std::string msg = Utility::getLastError(); + throw SSLContextException("Cannot load default CA certificates", msg); + } + } + + if (!params.privateKeyFile.empty()) + { + errCode = SSL_CTX_use_PrivateKey_file(_pSSLContext, Poco::Path::transcode(params.privateKeyFile).c_str(), SSL_FILETYPE_PEM); + if (errCode != 1) + { + std::string msg = Utility::getLastError(); + throw SSLContextException(std::string("Error loading private key from file ") + params.privateKeyFile, msg); + } + } + + if (!params.certificateFile.empty()) + { + errCode = SSL_CTX_use_certificate_chain_file(_pSSLContext, Poco::Path::transcode(params.certificateFile).c_str()); + if (errCode != 1) + { + std::string errMsg = Utility::getLastError(); + throw SSLContextException(std::string("Error loading certificate from file ") + params.certificateFile, errMsg); + } + } + + if (isForServerUse()) + SSL_CTX_set_verify(_pSSLContext, params.verificationMode, &SSLManager::verifyServerCallback); + else + SSL_CTX_set_verify(_pSSLContext, params.verificationMode, &SSLManager::verifyClientCallback); + + SSL_CTX_set_cipher_list(_pSSLContext, params.cipherList.c_str()); + SSL_CTX_set_verify_depth(_pSSLContext, params.verificationDepth); + SSL_CTX_set_mode(_pSSLContext, SSL_MODE_AUTO_RETRY); + SSL_CTX_set_session_cache_mode(_pSSLContext, SSL_SESS_CACHE_OFF); + + initDH(params.dhParamsFile); + initECDH(params.ecdhCurve); + } + catch (...) + { + SSL_CTX_free(_pSSLContext); + throw; + } +} + + void Context::useCertificate(const Poco::Crypto::X509Certificate& certificate) { int errCode = SSL_CTX_use_certificate(_pSSLContext, const_cast(certificate.certificate())); @@ -412,4 +409,123 @@ void Context::createSSLContext() } +void Context::initDH(const std::string& dhParamsFile) +{ +#ifndef OPENSSL_NO_DH + // 1024-bit MODP Group with 160-bit prime order subgroup (RFC5114) + // -----BEGIN DH PARAMETERS----- + // MIIBDAKBgQCxC4+WoIDgHd6S3l6uXVTsUsmfvPsGo8aaap3KUtI7YWBz4oZ1oj0Y + // mDjvHi7mUsAT7LSuqQYRIySXXDzUm4O/rMvdfZDEvXCYSI6cIZpzck7/1vrlZEc4 + // +qMaT/VbzMChUa9fDci0vUW/N982XBpl5oz9p21NpwjfH7K8LkpDcQKBgQCk0cvV + // w/00EmdlpELvuZkF+BBN0lisUH/WQGz/FCZtMSZv6h5cQVZLd35pD1UE8hMWAhe0 + // sBuIal6RVH+eJ0n01/vX07mpLuGQnQ0iY/gKdqaiTAh6CR9THb8KAWm2oorWYqTR + // jnOvoy13nVkY0IvIhY9Nzvl8KiSFXm7rIrOy5QICAKA= + // -----END DH PARAMETERS----- + // + + static const unsigned char dh1024_p[] = + { + 0xB1,0x0B,0x8F,0x96,0xA0,0x80,0xE0,0x1D,0xDE,0x92,0xDE,0x5E, + 0xAE,0x5D,0x54,0xEC,0x52,0xC9,0x9F,0xBC,0xFB,0x06,0xA3,0xC6, + 0x9A,0x6A,0x9D,0xCA,0x52,0xD2,0x3B,0x61,0x60,0x73,0xE2,0x86, + 0x75,0xA2,0x3D,0x18,0x98,0x38,0xEF,0x1E,0x2E,0xE6,0x52,0xC0, + 0x13,0xEC,0xB4,0xAE,0xA9,0x06,0x11,0x23,0x24,0x97,0x5C,0x3C, + 0xD4,0x9B,0x83,0xBF,0xAC,0xCB,0xDD,0x7D,0x90,0xC4,0xBD,0x70, + 0x98,0x48,0x8E,0x9C,0x21,0x9A,0x73,0x72,0x4E,0xFF,0xD6,0xFA, + 0xE5,0x64,0x47,0x38,0xFA,0xA3,0x1A,0x4F,0xF5,0x5B,0xCC,0xC0, + 0xA1,0x51,0xAF,0x5F,0x0D,0xC8,0xB4,0xBD,0x45,0xBF,0x37,0xDF, + 0x36,0x5C,0x1A,0x65,0xE6,0x8C,0xFD,0xA7,0x6D,0x4D,0xA7,0x08, + 0xDF,0x1F,0xB2,0xBC,0x2E,0x4A,0x43,0x71, + }; + + static const unsigned char dh1024_g[] = + { + 0xA4,0xD1,0xCB,0xD5,0xC3,0xFD,0x34,0x12,0x67,0x65,0xA4,0x42, + 0xEF,0xB9,0x99,0x05,0xF8,0x10,0x4D,0xD2,0x58,0xAC,0x50,0x7F, + 0xD6,0x40,0x6C,0xFF,0x14,0x26,0x6D,0x31,0x26,0x6F,0xEA,0x1E, + 0x5C,0x41,0x56,0x4B,0x77,0x7E,0x69,0x0F,0x55,0x04,0xF2,0x13, + 0x16,0x02,0x17,0xB4,0xB0,0x1B,0x88,0x6A,0x5E,0x91,0x54,0x7F, + 0x9E,0x27,0x49,0xF4,0xD7,0xFB,0xD7,0xD3,0xB9,0xA9,0x2E,0xE1, + 0x90,0x9D,0x0D,0x22,0x63,0xF8,0x0A,0x76,0xA6,0xA2,0x4C,0x08, + 0x7A,0x09,0x1F,0x53,0x1D,0xBF,0x0A,0x01,0x69,0xB6,0xA2,0x8A, + 0xD6,0x62,0xA4,0xD1,0x8E,0x73,0xAF,0xA3,0x2D,0x77,0x9D,0x59, + 0x18,0xD0,0x8B,0xC8,0x85,0x8F,0x4D,0xCE,0xF9,0x7C,0x2A,0x24, + 0x85,0x5E,0x6E,0xEB,0x22,0xB3,0xB2,0xE5, + }; + + DH* dh = 0; + if (!dhParamsFile.empty()) + { + BIO* bio = BIO_new_file(dhParamsFile.c_str(), "r"); + if (!bio) + { + std::string msg = Utility::getLastError(); + throw SSLContextException(std::string("Error opening Diffie-Hellman parameters file ") + dhParamsFile, msg); + } + dh = PEM_read_bio_DHparams(bio, 0, 0, 0); + BIO_free(bio); + if (!dh) + { + std::string msg = Utility::getLastError(); + throw SSLContextException(std::string("Error reading Diffie-Hellman parameters from file ") + dhParamsFile, msg); + } + } + else + { + dh = DH_new(); + if (!dh) + { + std::string msg = Utility::getLastError(); + throw SSLContextException("Error creating Diffie-Hellman parameters", msg); + } + dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), 0); + dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), 0); + dh->length = 160; + if ((!dh->p) || (!dh->g)) + { + DH_free(dh); + throw SSLContextException("Error creating Diffie-Hellman parameters"); + } + } + SSL_CTX_set_tmp_dh(_pSSLContext, dh); + SSL_CTX_set_options(_pSSLContext, SSL_OP_SINGLE_DH_USE); + DH_free(dh); +#else + if (!dhParamsFile.empty()) + throw SSLContextException("OpenSSL does not support DH"); +#endif +} + + +void Context::initECDH(const std::string& curve) +{ +#if OPENSSL_VERSION_NUMBER >= 0x0090800fL +#ifndef OPENSSL_NO_ECDH + int nid = 0; + if (!curve.empty()) + { + nid = OBJ_sn2nid(curve.c_str()); + } + else + { + nid = OBJ_sn2nid("prime256v1"); + } + if (nid == 0) + { + throw SSLContextException("Unknown ECDH curve name", curve); + } + + EC_KEY* ecdh = EC_KEY_new_by_curve_name(nid); + if (!ecdh) + { + throw SSLContextException("Cannot create ECDH curve"); + } + SSL_CTX_set_tmp_ecdh(_pSSLContext, ecdh); + SSL_CTX_set_options(_pSSLContext, SSL_OP_SINGLE_ECDH_USE); + EC_KEY_free(ecdh); +#endif +#endif +} + + } } // namespace Poco::Net diff --git a/NetSSL_OpenSSL/src/SSLManager.cpp b/NetSSL_OpenSSL/src/SSLManager.cpp index f58e5ae18..5bd52cddb 100644 --- a/NetSSL_OpenSSL/src/SSLManager.cpp +++ b/NetSSL_OpenSSL/src/SSLManager.cpp @@ -59,6 +59,8 @@ const std::string SSLManager::CFG_REQUIRE_TLSV1("requireTLSv1"); const std::string SSLManager::CFG_REQUIRE_TLSV1_1("requireTLSv1_1"); const std::string SSLManager::CFG_REQUIRE_TLSV1_2("requireTLSv1_2"); const std::string SSLManager::CFG_DISABLE_PROTOCOLS("disableProtocols"); +const std::string SSLManager::CFG_DH_PARAMS_FILE("dhParamsFile"); +const std::string SSLManager::CFG_ECDH_CURVE("ecdhCurve"); #ifdef OPENSSL_FIPS const std::string SSLManager::CFG_FIPS_MODE("openSSL.fips"); const bool SSLManager::VAL_FIPS_MODE(false); @@ -251,30 +253,35 @@ void SSLManager::initDefaultContext(bool server) std::string prefix = server ? CFG_SERVER_PREFIX : CFG_CLIENT_PREFIX; + Context::Params params; // mandatory options - std::string privKeyFile = config.getString(prefix + CFG_PRIV_KEY_FILE, ""); - std::string certFile = config.getString(prefix + CFG_CERTIFICATE_FILE, privKeyFile); - std::string caLocation = config.getString(prefix + CFG_CA_LOCATION, ""); + params.privateKeyFile = config.getString(prefix + CFG_PRIV_KEY_FILE, ""); + params.certificateFile = config.getString(prefix + CFG_CERTIFICATE_FILE, params.privateKeyFile); + params.caLocation = config.getString(prefix + CFG_CA_LOCATION, ""); - if (server && certFile.empty() && privKeyFile.empty()) + if (server && params.certificateFile.empty() && params.privateKeyFile.empty()) throw SSLException("Configuration error: no certificate file has been specified"); // optional options for which we have defaults defined - Context::VerificationMode verMode = VAL_VER_MODE; + params.verificationMode = VAL_VER_MODE; if (config.hasProperty(prefix + CFG_VER_MODE)) { // either: none, relaxed, strict, once std::string mode = config.getString(prefix + CFG_VER_MODE); - verMode = Utility::convertVerificationMode(mode); + params.verificationMode = Utility::convertVerificationMode(mode); } - int verDepth = config.getInt(prefix + CFG_VER_DEPTH, VAL_VER_DEPTH); - bool loadDefCA = config.getBool(prefix + CFG_ENABLE_DEFAULT_CA, VAL_ENABLE_DEFAULT_CA); - std::string cipherList = config.getString(prefix + CFG_CIPHER_LIST, VAL_CIPHER_LIST); - cipherList = config.getString(prefix + CFG_CYPHER_LIST, cipherList); // for backwards compatibility + params.verificationDepth = config.getInt(prefix + CFG_VER_DEPTH, VAL_VER_DEPTH); + params.loadDefaultCAs = config.getBool(prefix + CFG_ENABLE_DEFAULT_CA, VAL_ENABLE_DEFAULT_CA); + params.cipherList = config.getString(prefix + CFG_CIPHER_LIST, VAL_CIPHER_LIST); + params.cipherList = config.getString(prefix + CFG_CYPHER_LIST, params.cipherList); // for backwards compatibility bool requireTLSv1 = config.getBool(prefix + CFG_REQUIRE_TLSV1, false); bool requireTLSv1_1 = config.getBool(prefix + CFG_REQUIRE_TLSV1_1, false); bool requireTLSv1_2 = config.getBool(prefix + CFG_REQUIRE_TLSV1_2, false); + + params.dhParamsFile = config.getString(prefix + CFG_DH_PARAMS_FILE, ""); + params.ecdhCurve = config.getString(prefix + CFG_ECDH_CURVE, ""); + Context::Usage usage; if (server) @@ -287,7 +294,7 @@ void SSLManager::initDefaultContext(bool server) usage = Context::TLSV1_SERVER_USE; else usage = Context::SERVER_USE; - _ptrDefaultServerContext = new Context(usage, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cipherList); + _ptrDefaultServerContext = new Context(usage, params); } else { @@ -299,7 +306,7 @@ void SSLManager::initDefaultContext(bool server) usage = Context::TLSV1_CLIENT_USE; else usage = Context::CLIENT_USE; - _ptrDefaultClientContext = new Context(usage, privKeyFile, certFile, caLocation, verMode, verDepth, loadDefCA, cipherList); + _ptrDefaultClientContext = new Context(usage, params); } std::string disabledProtocolsList = config.getString(prefix + CFG_DISABLE_PROTOCOLS, ""); From 59b5b4e46e6b2727d9c4540a52a43f549aea2ab6 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 19 Jan 2016 16:01:17 +0100 Subject: [PATCH 20/23] added Context::preferServerCiphers() --- NetSSL_OpenSSL/include/Poco/Net/Context.h | 6 ++++++ NetSSL_OpenSSL/include/Poco/Net/SSLManager.h | 6 ++++++ NetSSL_OpenSSL/src/Context.cpp | 8 ++++++++ NetSSL_OpenSSL/src/SSLManager.cpp | 10 ++++++++++ 4 files changed, 30 insertions(+) diff --git a/NetSSL_OpenSSL/include/Poco/Net/Context.h b/NetSSL_OpenSSL/include/Poco/Net/Context.h index 4d57b3f6e..ffdc62bbc 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/Context.h +++ b/NetSSL_OpenSSL/include/Poco/Net/Context.h @@ -334,6 +334,12 @@ public: /// values from the Protocols enumeration, e.g.: /// /// context.disableProtocols(PROTO_SSLV2 | PROTO_SSLV3); + + void preferServerCiphers(); + /// When choosing a cipher, use the server's preferences instead of the client + /// preferences. When not called, the SSL server will always follow the clients + /// preferences. When called, the SSL/TLS server will choose following its own + /// preferences. private: void init(const Params& params); diff --git a/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h b/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h index df9f27716..9af8a7f37 100644 --- a/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h +++ b/NetSSL_OpenSSL/include/Poco/Net/SSLManager.h @@ -77,6 +77,7 @@ class NetSSL_API SSLManager /// 1..9 /// true|false /// ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH + /// true|false /// /// KeyFileHandler /// @@ -118,6 +119,10 @@ class NetSSL_API SSLManager /// - loadDefaultCAFile (boolean): Specifies whether the builtin CA certificates from OpenSSL are used. /// - cipherList (string): Specifies the supported ciphers in OpenSSL notation /// (e.g. "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"). + /// - preferServerCiphers (bool): When choosing a cipher, use the server's preferences instead of the + /// client preferences. When not called, the SSL server will always follow the clients + /// preferences. When called, the SSL/TLS server will choose following its own + /// preferences. /// - privateKeyPassphraseHandler.name (string): The name of the class (subclass of PrivateKeyPassphraseHandler) /// used for obtaining the passphrase for accessing the private key. /// - privateKeyPassphraseHandler.options.password (string): The password to be used by KeyFileHandler. @@ -317,6 +322,7 @@ private: static const std::string CFG_CIPHER_LIST; static const std::string CFG_CYPHER_LIST; // for backwards compatibility static const std::string VAL_CIPHER_LIST; + static const std::string CFG_PREFER_SERVER_CIPHERS; static const std::string CFG_DELEGATE_HANDLER; static const std::string VAL_DELEGATE_HANDLER; static const std::string CFG_CERTIFICATE_HANDLER; diff --git a/NetSSL_OpenSSL/src/Context.cpp b/NetSSL_OpenSSL/src/Context.cpp index f8b606e8b..2696de937 100644 --- a/NetSSL_OpenSSL/src/Context.cpp +++ b/NetSSL_OpenSSL/src/Context.cpp @@ -349,6 +349,14 @@ void Context::disableProtocols(int protocols) } +void Context::preferServerCiphers() +{ +#if defined(SSL_OP_CIPHER_SERVER_PREFERENCE) + SSL_CTX_set_options(_pSSLContext, SSL_OP_CIPHER_SERVER_PREFERENCE); +#endif +} + + void Context::createSSLContext() { if (SSLManager::isFIPSEnabled()) diff --git a/NetSSL_OpenSSL/src/SSLManager.cpp b/NetSSL_OpenSSL/src/SSLManager.cpp index 5bd52cddb..0e7c0560f 100644 --- a/NetSSL_OpenSSL/src/SSLManager.cpp +++ b/NetSSL_OpenSSL/src/SSLManager.cpp @@ -44,6 +44,7 @@ const bool SSLManager::VAL_ENABLE_DEFAULT_CA(true); const std::string SSLManager::CFG_CIPHER_LIST("cipherList"); const std::string SSLManager::CFG_CYPHER_LIST("cypherList"); const std::string SSLManager::VAL_CIPHER_LIST("ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"); +const std::string SSLManager::CFG_PREFER_SERVER_CIPHERS("preferServerCiphers"); const std::string SSLManager::CFG_DELEGATE_HANDLER("privateKeyPassphraseHandler.name"); const std::string SSLManager::VAL_DELEGATE_HANDLER("KeyConsoleHandler"); const std::string SSLManager::CFG_CERTIFICATE_HANDLER("invalidCertificateHandler.name"); @@ -355,6 +356,15 @@ void SSLManager::initDefaultContext(bool server) _ptrDefaultServerContext->enableExtendedCertificateVerification(extendedVerification); else _ptrDefaultClientContext->enableExtendedCertificateVerification(extendedVerification); + + bool preferServerCiphers = config.getBool(prefix + CFG_PREFER_SERVER_CIPHERS, false); + if (preferServerCiphers) + { + if (server) + _ptrDefaultServerContext->preferServerCiphers(); + else + _ptrDefaultClientContext->preferServerCiphers(); + } } From e395f416fb7308e9cba20e32173d9cb0b219f4f9 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Tue, 2 Feb 2016 14:37:04 +0100 Subject: [PATCH 21/23] pass -DPOCO_TARGET_OSNAME and -DPOCO_TARGET_OSARCH to compiler --- build/rules/global | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rules/global b/build/rules/global index ea1ef2cec..50c0eb525 100644 --- a/build/rules/global +++ b/build/rules/global @@ -241,7 +241,7 @@ endif # # Compose compiler flags # -COMMONFLAGS = -DPOCO_BUILD_HOST=$(HOSTNAME) $(POCO_FLAGS) +COMMONFLAGS = -DPOCO_BUILD_HOST=$(HOSTNAME) -DPOCO_TARGET_OSNAME=$(OSNAME) -DPOCO_TARGET_OSARCH=$(OSARCH) $(POCO_FLAGS) CFLAGS += $(COMMONFLAGS) $(SYSFLAGS) CXXFLAGS += $(COMMONFLAGS) $(SYSFLAGS) LINKFLAGS += $(COMMONFLAGS) $(SYSFLAGS) From 48111c3809c7477e644daa14f12ccd68159842be Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Sat, 6 Feb 2016 20:36:05 -0500 Subject: [PATCH 22/23] Guard SQLITE_BUSY_SNAPSHOT which is not available in older SQLite releases When building POCO unbundled with older versions of SQLite (such as on RHEL7) SQLITE_BUSY_SNAPSHOT is not defined, so #ifdef guard it. --- Data/SQLite/src/Utility.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Data/SQLite/src/Utility.cpp b/Data/SQLite/src/Utility.cpp index fa3efa783..44c2a8ebe 100644 --- a/Data/SQLite/src/Utility.cpp +++ b/Data/SQLite/src/Utility.cpp @@ -168,7 +168,9 @@ void Utility::throwException(int rc, const std::string& addErrMsg) throw ExecutionAbortedException(std::string("Callback routine requested an abort"), addErrMsg); case SQLITE_BUSY: case SQLITE_BUSY_RECOVERY: +#if defined(SQLITE_BUSY_SNAPSHOT) case SQLITE_BUSY_SNAPSHOT: +#endif throw DBLockedException(std::string("The database file is locked"), addErrMsg); case SQLITE_LOCKED: throw TableLockedException(std::string("A table in the database is locked"), addErrMsg); From 7c10b9f4da148d908dd6e0a9f1d410bac2f0fcd4 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Sat, 6 Feb 2016 20:39:15 -0500 Subject: [PATCH 23/23] Add support PPC64LE (little endian) PPC64 has both big and little endian variants; add support for LE. --- Foundation/include/Poco/Platform.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Foundation/include/Poco/Platform.h b/Foundation/include/Poco/Platform.h index def8f0733..b1e776315 100644 --- a/Foundation/include/Poco/Platform.h +++ b/Foundation/include/Poco/Platform.h @@ -166,7 +166,11 @@ #elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \ defined(__powerpc__) || defined(__ppc__) || defined(__ppc) || defined(_ARCH_PPC) || defined(_M_PPC) #define POCO_ARCH POCO_ARCH_PPC - #define POCO_ARCH_BIG_ENDIAN 1 + #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + #define POCO_ARCH_LITTLE_ENDIAN 1 + #else + #define POCO_ARCH_BIG_ENDIAN 1 + #endif #elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \ defined(_ARCH_PWR4) || defined(__THW_RS6000) #define POCO_ARCH POCO_ARCH_POWER