fix(test): Use 96-bit IV with aes-256-gcm to fix (#4347):

I/O error: error:1C800066:Provider routines::cipher operation failed
This commit is contained in:
Matej Kenda 2024-01-03 20:13:57 +01:00
parent db63550ce9
commit b33e02d253
2 changed files with 10 additions and 19 deletions

View File

@ -216,8 +216,7 @@ jobs:
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<SyslogTest>.testOldBSD,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh
@ -242,8 +241,7 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
PWD=`pwd`
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"
@ -268,8 +266,7 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
PWD=`pwd`
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"
@ -299,8 +296,7 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh TSAN
@ -330,8 +326,7 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh
@ -361,8 +356,7 @@ jobs:
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<UniqueExpireLRUCacheTest>.testExpireN,
CppUnit::TestCaller<ExpireLRUCacheTest>.testAccessExpireN,
CppUnit::TestCaller<PollSetTest>.testPollClosedServer,
CppUnit::TestCaller<CryptoTest>.testEncryptDecryptGCM"
CppUnit::TestCaller<PollSetTest>.testPollClosedServer"
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh

View File

@ -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);