Skip to main content

zip_extensions/audit/handlers/
encryption.rs

1use crate::audit::entry_audit_handler::EntryAuditHandler;
2use crate::audit::entry_view::EntryView;
3use crate::audit::report::ZipAuditReport;
4
5/// An `EncryptionHandler` is used to track and report on encrypted entries. Encrypted entries can
6/// trigger password prompts or hide payloads. Many extraction workflows choose to refuse them.
7pub struct EncryptionHandler;
8
9impl EntryAuditHandler for EncryptionHandler {
10    fn visit(&mut self, view: &EntryView, report: &mut ZipAuditReport) {
11        if view.encrypted {
12            report.trace_encrypted(view.enclosed_name.clone());
13        }
14    }
15}