diff --git a/src/cpp/test/crypto/TestAuthenticatedEncryption.cpp b/src/cpp/test/crypto/TestAuthenticatedEncryption.cpp index 22c6a9dfe..93c19bc9b 100644 --- a/src/cpp/test/crypto/TestAuthenticatedEncryption.cpp +++ b/src/cpp/test/crypto/TestAuthenticatedEncryption.cpp @@ -9,13 +9,6 @@ void TestAuthenticatedEncryption::SetUp() { - if (!ServerConfig::g_CryptoAppSecret) { - ServerConfig::g_CryptoAppSecret = DataTypeConverter::hexToBin("21ffbbc616fe"); - } - if (!ServerConfig::g_ServerCryptoKey) { - auto serverKey = DataTypeConverter::hexToBin("a51ef8ac7ef1abf162fb7a65261acd7a"); - ServerConfig::g_ServerCryptoKey = new ObfusArray(serverKey->size(), *serverKey); - } } TEST_F(TestAuthenticatedEncryption, encryptDecryptTest) { diff --git a/src/cpp/test/crypto/TestPassphrase.cpp b/src/cpp/test/crypto/TestPassphrase.cpp index 747d953b9..128a461f6 100644 --- a/src/cpp/test/crypto/TestPassphrase.cpp +++ b/src/cpp/test/crypto/TestPassphrase.cpp @@ -84,7 +84,7 @@ void PassphraseTest::SetUp() wordIndices3 )); - ServerConfig::loadMnemonicWordLists(); + } TEST_F(PassphraseTest, detectMnemonic) { diff --git a/src/cpp/test/main.cpp b/src/cpp/test/main.cpp index 1d6182b7f..c7fe97240 100644 --- a/src/cpp/test/main.cpp +++ b/src/cpp/test/main.cpp @@ -3,6 +3,10 @@ #include #include "gtest/gtest.h" +#include "Poco/Util/PropertyFileConfiguration.h" + + + std::list gTests; void fillTests() @@ -16,6 +20,21 @@ void fillTests() int load() { // init server config, init seed array + + Poco::AutoPtr test_config(new Poco::Util::LayeredConfiguration); + auto cfg = new Poco::Util::PropertyFileConfiguration("Gradido_LoginServer_Test.properties"); + test_config->add(cfg); + + if (!ServerConfig::initServerCrypto(*test_config)) { + //printf("[Gradido_LoginServer::%s] error init server crypto\n", __FUNCTION__); + printf("[load] error init server crypto"); + return -1; + } + if (!ServerConfig::loadMnemonicWordLists()) { + printf("[load] error in loadMnemonicWordLists"); + return -2; + } + fillTests(); for (std::list::iterator it = gTests.begin(); it != gTests.end(); it++) {