IMPALA-13728: OpenSSLUtilTest.ValidateInitialize failed by AES_128_GCM not supported

The test failed because AES_128_GCM is not supported
in all OpenSSL versions. Replacing it with
AES_256_CFB fixes the test as it is supported in all
OpenSSL versions.

Change-Id: If5b3a000e302d2705a02820c560b474f0c311560
Reviewed-on: http://gerrit.cloudera.org:8080/22477
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
pranav.lodha
2025-02-12 10:54:54 +05:30
committed by Peter Rozsa
parent f1f0680f8b
commit 17e99767a5

View File

@@ -144,12 +144,14 @@ TEST_F(OpenSSLUtilTest, Encryption) {
TEST_F(OpenSSLUtilTest, ValidateInitialize) {
EncryptionKey key;
uint8_t IV[AES_BLOCK_SIZE] = {};
uint8_t key16bits[16] = {};
uint8_t key32bits[32] = {};
// Using AES_256_CFB mode to test since it's supported in all Impala
// supported OpenSSL versions.
Status status_initialize_fields = key.InitializeFields
(key16bits,16, IV, AES_BLOCK_SIZE, AES_CIPHER_MODE::AES_256_GCM);
(key32bits, 16, IV, AES_BLOCK_SIZE, AES_CIPHER_MODE::AES_256_CFB);
ASSERT_FALSE(status_initialize_fields.ok());
ASSERT_OK(key.InitializeFields(key16bits,
16, IV, AES_BLOCK_SIZE, AES_CIPHER_MODE::AES_128_GCM));
ASSERT_OK(key.InitializeFields(key32bits,
32, IV, AES_BLOCK_SIZE, AES_CIPHER_MODE::AES_256_CFB));
}
/// Test that encryption and decryption work in-place.