File tree 3 files changed +6
-5
lines changed 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub(crate) const SIZE_LEN: usize = 4;
30
30
pub ( crate ) trait BlockDecryptor : Debug + Send + Sync {
31
31
fn decrypt ( & self , length_and_ciphertext : & [ u8 ] , aad : & [ u8 ] ) -> Result < Vec < u8 > > ;
32
32
33
- fn compute_plaintext_tag ( & self , aad : & [ u8 ] , plaintext : & mut [ u8 ] ) -> Result < Vec < u8 > > ;
33
+ fn compute_plaintext_tag ( & self , aad : & [ u8 ] , plaintext : & [ u8 ] ) -> Result < Vec < u8 > > ;
34
34
}
35
35
36
36
#[ derive( Debug , Clone ) ]
@@ -66,7 +66,8 @@ impl BlockDecryptor for RingGcmBlockDecryptor {
66
66
Ok ( result)
67
67
}
68
68
69
- fn compute_plaintext_tag ( & self , aad : & [ u8 ] , plaintext : & mut [ u8 ] ) -> Result < Vec < u8 > > {
69
+ fn compute_plaintext_tag ( & self , aad : & [ u8 ] , plaintext : & [ u8 ] ) -> Result < Vec < u8 > > {
70
+ let mut plaintext = plaintext. to_vec ( ) ;
70
71
let nonce = & plaintext[ plaintext. len ( ) - NONCE_LEN - TAG_LEN ..plaintext. len ( ) - TAG_LEN ] ;
71
72
let nonce = ring:: aead:: Nonce :: try_assume_unique_for_key ( nonce) ?;
72
73
let plaintext_end = plaintext. len ( ) - NONCE_LEN - TAG_LEN ;
Original file line number Diff line number Diff line change @@ -558,10 +558,10 @@ impl FileDecryptor {
558
558
/// Verify the signature of the footer
559
559
pub ( crate ) fn verify_plaintext_footer_signature (
560
560
& self ,
561
- plaintext_footer : & mut [ u8 ] ,
561
+ plaintext_footer : & [ u8 ] ,
562
562
) -> Result < ( ) > {
563
563
// Plaintext footer format is: [plaintext metadata, nonce, authentication tag]
564
- let tag = plaintext_footer[ plaintext_footer. len ( ) - TAG_LEN ..] . to_vec ( ) ;
564
+ let tag = & plaintext_footer[ plaintext_footer. len ( ) - TAG_LEN ..] ;
565
565
let aad = create_footer_aad ( self . file_aad ( ) ) ?;
566
566
let footer_decryptor = self . get_footer_decryptor ( ) ?;
567
567
Original file line number Diff line number Diff line change @@ -972,7 +972,7 @@ impl ParquetMetaDataReader {
972
972
file_decryption_properties,
973
973
) ?;
974
974
if file_decryption_properties. check_plaintext_footer_integrity ( ) && !encrypted_footer {
975
- file_decryptor_value. verify_plaintext_footer_signature ( buf. to_vec ( ) . as_mut ( ) ) ?;
975
+ file_decryptor_value. verify_plaintext_footer_signature ( buf) ?;
976
976
}
977
977
file_decryptor = Some ( file_decryptor_value) ;
978
978
}
You can’t perform that action at this time.
0 commit comments