zip-extensions 0.14.1

An extension crate for zip.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::audit::entry_audit_handler::EntryAuditHandler;
use crate::audit::entry_view::EntryView;
use crate::audit::report::ZipAuditReport;

/// An `EncryptionHandler` is used to track and report on encrypted entries. Encrypted entries can
/// trigger password prompts or hide payloads. Many extraction workflows choose to refuse them.
pub struct EncryptionHandler;

impl EntryAuditHandler for EncryptionHandler {
    fn visit(&mut self, view: &EntryView, report: &mut ZipAuditReport) {
        if view.encrypted {
            report.trace_encrypted(view.enclosed_name.clone());
        }
    }
}