diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8e615bfd1..8ef4fd9734 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -216,8 +216,7 @@ jobs: CppUnit::TestCaller.testExpireN, CppUnit::TestCaller.testAccessExpireN, CppUnit::TestCaller.testOldBSD, - CppUnit::TestCaller.testPollClosedServer, - CppUnit::TestCaller.testEncryptDecryptGCM" + CppUnit::TestCaller.testPollClosedServer" EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF" ./ci/runtests.sh @@ -242,8 +241,7 @@ jobs: CppUnit::TestCaller.testAccessExpireN, CppUnit::TestCaller.testExpireN, CppUnit::TestCaller.testAccessExpireN, - CppUnit::TestCaller.testPollClosedServer, - CppUnit::TestCaller.testEncryptDecryptGCM" + CppUnit::TestCaller.testPollClosedServer" PWD=`pwd` ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)" @@ -268,11 +266,100 @@ jobs: CppUnit::TestCaller.testAccessExpireN, CppUnit::TestCaller.testExpireN, CppUnit::TestCaller.testAccessExpireN, - CppUnit::TestCaller.testPollClosedServer, - CppUnit::TestCaller.testEncryptDecryptGCM" + CppUnit::TestCaller.testPollClosedServer" PWD=`pwd` ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)" + macos-clang-make-openssl3-tsan: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - run: brew install openssl@3 + - run: >- + ./configure --everything --no-prefix --no-samples --omit=CppParser,Encodings,Data/MySQL,Data/ODBC,Data/PostgreSQL,MongoDB,PageCompiler,PDF,PocoDoc,ProGen,Redis,SevenZip + --odbc-include=/usr/local/opt/unixodbc/include --odbc-lib=/usr/local/opt/unixodbc/lib + --mysql-include=/usr/local/opt/mysql-client/include --mysql-lib=/usr/local/opt/mysql-client/lib + --include-path="/usr/local/opt/openssl@3/include" --library-path="/usr/local/opt/openssl@3/lib" && + make all -s -j4 SANITIZEFLAGS=-fsanitize=thread + + - uses: ./.github/actions/retry-action + with: + timeout_minutes: 90 + max_attempts: 3 + retry_on: any + command: >- + sudo -s + CPPUNIT_IGNORE=" + CppUnit::TestCaller.testTrySleep, + CppUnit::TestCaller.testTimestamp, + CppUnit::TestCaller.testExpireN, + CppUnit::TestCaller.testAccessExpireN, + CppUnit::TestCaller.testExpireN, + CppUnit::TestCaller.testAccessExpireN, + CppUnit::TestCaller.testPollClosedServer" + EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF" + ./ci/runtests.sh TSAN + + macos-clang-make-openssl3-ubsan: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - run: brew install openssl@3 mysql-client unixodbc libpq + - run: >- + ./configure --everything --no-prefix --no-samples --omit=PDF + --odbc-include=/usr/local/opt/unixodbc/include --odbc-lib=/usr/local/opt/unixodbc/lib + --mysql-include=/usr/local/opt/mysql-client/include --mysql-lib=/usr/local/opt/mysql-client/lib + --include-path="/usr/local/opt/openssl@3/include" --library-path="/usr/local/opt/openssl@3/lib" && + make all -s -j4 SANITIZEFLAGS=-fsanitize=undefined + + - uses: ./.github/actions/retry-action + with: + timeout_minutes: 90 + max_attempts: 3 + retry_on: any + command: >- + sudo -s + CPPUNIT_IGNORE=" + CppUnit::TestCaller.testTrySleep, + CppUnit::TestCaller.testTimestamp, + CppUnit::TestCaller.testExpireN, + CppUnit::TestCaller.testAccessExpireN, + CppUnit::TestCaller.testExpireN, + CppUnit::TestCaller.testAccessExpireN, + CppUnit::TestCaller.testPollClosedServer" + EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF" + ./ci/runtests.sh + + macos-clang-make-openssl3-asan: + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - run: brew install openssl@3 mysql-client unixodbc libpq + - run: >- + ./configure --everything --no-prefix --no-samples --omit=PDF + --odbc-include=/usr/local/opt/unixodbc/include --odbc-lib=/usr/local/opt/unixodbc/lib + --mysql-include=/usr/local/opt/mysql-client/include --mysql-lib=/usr/local/opt/mysql-client/lib + --include-path="/usr/local/opt/openssl@3/include" --library-path="/usr/local/opt/openssl@3/lib" && + make all -s -j4 SANITIZEFLAGS=-fsanitize=address + + - uses: ./.github/actions/retry-action + with: + timeout_minutes: 90 + max_attempts: 3 + retry_on: any + command: >- + sudo -s + CPPUNIT_IGNORE=" + CppUnit::TestCaller.testTrySleep, + CppUnit::TestCaller.testTimestamp, + CppUnit::TestCaller.testExpireN, + CppUnit::TestCaller.testAccessExpireN, + CppUnit::TestCaller.testExpireN, + CppUnit::TestCaller.testAccessExpireN, + CppUnit::TestCaller.testPollClosedServer" + EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF" + ./ci/runtests.sh + # windows-2019-msvc-cmake: # runs-on: windows-2019 # env: diff --git a/Crypto/testsuite/src/CryptoTest.cpp b/Crypto/testsuite/src/CryptoTest.cpp index 6aa9a1f8d5..214395b9ba 100644 --- a/Crypto/testsuite/src/CryptoTest.cpp +++ b/Crypto/testsuite/src/CryptoTest.cpp @@ -212,15 +212,12 @@ void CryptoTest::testEncryptDecryptDESECB() void CryptoTest::testEncryptDecryptGCM() { - // - // The test sometimes fails when it is running for longer time - // This conversation perhaps contains a hint: - // https://github.com/openssl/openssl/issues/21119 - // - CipherKey key("aes-256-gcm"); - CipherKey::ByteVec iv(20, 213); + // 96-bit (12 byte) IV is recommended for usage with GCM. + // https://crypto.stackexchange.com/questions/41601/aes-gcm-recommended-iv-size-why-12-bytes + + CipherKey::ByteVec iv(12, 213); key.setIV(iv); Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(key); diff --git a/Net/testsuite/src/TCPServerTest.cpp b/Net/testsuite/src/TCPServerTest.cpp index 195b4162a0..8e2dc30009 100644 --- a/Net/testsuite/src/TCPServerTest.cpp +++ b/Net/testsuite/src/TCPServerTest.cpp @@ -18,6 +18,7 @@ #include "Poco/Net/StreamSocket.h" #include "Poco/Net/ServerSocket.h" #include "Poco/Thread.h" +#include "Poco/Mutex.h" #include @@ -35,6 +36,8 @@ using Poco::Thread; namespace { + static Poco::FastMutex cerrMutex; + class EchoConnection: public TCPServerConnection { public: @@ -55,8 +58,10 @@ namespace n = ss.receiveBytes(buffer, sizeof(buffer)); } } - catch (Poco::Exception& exc) + catch (const Poco::Exception& exc) { + Poco::FastMutex::ScopedLock l(cerrMutex); + std::cerr << "EchoConnection: " << exc.displayText() << std::endl; } } diff --git a/NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp b/NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp index af98055ea5..0da2367d8c 100644 --- a/NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp +++ b/NetSSL_OpenSSL/testsuite/src/TCPServerTest.cpp @@ -25,6 +25,7 @@ #include "Poco/Util/Application.h" #include "Poco/Util/AbstractConfiguration.h" #include "Poco/Thread.h" +#include "Poco/Mutex.h" #include @@ -46,6 +47,8 @@ using Poco::Util::Application; namespace { + static Poco::FastMutex cerrMutex; + class EchoConnection: public TCPServerConnection { public: @@ -66,8 +69,10 @@ namespace n = ss.receiveBytes(buffer, sizeof(buffer)); } } - catch (Poco::Exception& exc) + catch (const Poco::Exception& exc) { + Poco::FastMutex::ScopedLock l(cerrMutex); + std::cerr << "EchoConnection: " << exc.displayText() << std::endl; } } diff --git a/NetSSL_Win/testsuite/src/TCPServerTest.cpp b/NetSSL_Win/testsuite/src/TCPServerTest.cpp index 75cce0dd7a..950a29b4fb 100644 --- a/NetSSL_Win/testsuite/src/TCPServerTest.cpp +++ b/NetSSL_Win/testsuite/src/TCPServerTest.cpp @@ -23,6 +23,7 @@ #include "Poco/Util/Application.h" #include "Poco/Util/AbstractConfiguration.h" #include "Poco/Thread.h" +#include "Poco/Mutex.h" #include @@ -44,6 +45,8 @@ using Poco::Util::Application; namespace { + static Poco::FastMutex cerrMutex; + class EchoConnection: public TCPServerConnection { public: @@ -66,6 +69,8 @@ namespace } catch (Poco::Exception& exc) { + Poco::FastMutex::ScopedLock l(cerrMutex); + std::cerr << "EchoConnection: " << exc.displayText() << std::endl; } }