rok commented on code in PR #7459: URL: https://github.com/apache/arrow-rs/pull/7459#discussion_r2075232822
########## parquet/src/file/metadata/reader.rs: ########## @@ -967,11 +966,15 @@ impl ParquetMetaDataReader { file_decryption_properties, ) { // File has a plaintext footer but encryption algorithm is set - file_decryptor = Some(get_file_decryptor( + let file_decryptor_value = get_file_decryptor( algo, t_file_metadata.footer_signing_key_metadata.as_deref(), file_decryption_properties, - )?); + )?; + if file_decryption_properties.check_plaintext_footer_integrity() && !encrypted_footer { + file_decryptor_value.verify_plaintext_footer_signature(buf.to_vec().as_mut())?; Review Comment: Good point. Done. ########## parquet/src/encryption/decrypt.rs: ########## @@ -538,6 +555,28 @@ impl FileDecryptor { Ok(self.footer_decryptor.clone()) } + /// Verify the signature of the footer + pub(crate) fn verify_plaintext_footer_signature( + &self, + plaintext_footer: &mut [u8], + ) -> Result<()> { + // Plaintext footer format is: [plaintext metadata, nonce, authentication tag] + let tag = plaintext_footer[plaintext_footer.len() - TAG_LEN..].to_vec(); Review Comment: Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org