Skip to content

Commit 0261b29

Browse files
committed
Fix
1 parent 046c058 commit 0261b29

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

parquet/src/file/metadata/reader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ impl ParquetMetaDataReader {
974974
.as_deref(),
975975
file_decryption_properties,
976976
)?);
977-
if file_decryption_properties.check_plaintext_footer_integrity() {
977+
if file_decryption_properties.check_plaintext_footer_integrity() && !encrypted_footer {
978978
file_decryptor
979979
.clone()
980980
.unwrap()

parquet/src/file/metadata/writer.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -636,22 +636,21 @@ impl MetadataObjectWriter {
636636
}
637637

638638
fn get_footer_encryption_algorithm(&self) -> Option<EncryptionAlgorithm> {
639-
let file_encryptor = self.file_encryptor.as_ref().unwrap();
640-
if !file_encryptor.properties().encrypt_footer() {
639+
if let Some(file_encryptor) = &self.file_encryptor {
641640
let supply_aad_prefix = file_encryptor
642641
.properties()
643642
.aad_prefix()
644643
.map(|_| !file_encryptor.properties().store_aad_prefix());
645-
let encryption_algorithm = Some(EncryptionAlgorithm::AESGCMV1(AesGcmV1 {
644+
let encryption_algorithm = EncryptionAlgorithm::AESGCMV1(AesGcmV1 {
646645
aad_prefix: if file_encryptor.properties().store_aad_prefix() {
647646
file_encryptor.properties().aad_prefix().cloned()
648647
} else {
649648
None
650649
},
651650
aad_file_unique: Some(file_encryptor.aad_file_unique().clone()),
652651
supply_aad_prefix,
653-
}));
654-
return encryption_algorithm;
652+
});
653+
return Some(encryption_algorithm);
655654
}
656655
None
657656
}

0 commit comments

Comments
 (0)