bugfix: salt recheck will cause duplicated iv/salt error

This commit is contained in:
hanwei
2023-01-13 15:20:53 +08:00
committed by ty
parent 163b2d2a35
commit 3948d6d496

View File

@@ -254,8 +254,9 @@ impl DecryptedReader {
}
// Check repeated salt after first successful decryption #442
if let Some(ref salt) = self.salt {
context.check_nonce_replay(self.method, salt)?;
if self.salt.is_some() {
let salt = self.salt.take().unwrap();
context.check_nonce_replay(self.method, &salt)?;
}
// Remote TAG