Skip to content

Commit c58c43e

Browse files
committed
apacheGH-51669: Fix generated encryption test portability
Convert the fixed footer key length explicitly to int32_t for strict Clang warning builds. Construct the footer AAD locally from the file AAD and module byte so the test does not reference an unexported function. Keep the existing on-disk GCM tag verification and parameter coverage.
1 parent 5e7a7e6 commit c58c43e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎cpp/src/parquet/encryption/write_configurations_test.cc‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,13 @@ class TestGeneratedEncryptionConfiguration
285285
const auto metadata = footer_span.first(footer_size - signature_size);
286286
const auto nonce = footer_span.subspan(metadata.size(), kNonceLength);
287287
const auto tag = footer_span.last(kGcmTagLength);
288-
const auto aad = CreateFooterAad(file_aad_);
288+
// Footer AAD is the file AAD followed by the footer module type byte.
289+
const auto aad = file_aad_ + static_cast<char>(kFooter);
289290

290291
// Verify the on-disk tag with GCM explicitly, independently of reader selection.
291292
auto encryptor = AesEncryptor::Make(ParquetCipher::AES_GCM_V1,
292-
kFooterEncryptionKey.size(), /*metadata=*/true,
293+
static_cast<int32_t>(kFooterEncryptionKey.size()),
294+
/*metadata=*/true,
293295
/*write_length=*/false);
294296
std::vector<uint8_t> encrypted(encryptor->CiphertextLength(metadata.size()));
295297
encryptor->SignedFooterEncrypt(metadata, kFooterEncryptionKey.as_span(),

0 commit comments

Comments
 (0)