#[non_exhaustive]pub enum ZipConsistencyPolicy {
Enforce,
Ignore,
}Expand description
How ZIP structure that different readers interpret differently is handled.
A ZIP archive stores each entry’s metadata twice, in a local header and in the central directory. Random-access readers follow the central directory and streaming readers follow the local headers, so an archive whose copies disagree, that hides records, repeats a name or overlaps entries is a parser differential (“Zip Cloaking”).
Enforce (the default, also for SecurityConfig::permissive)
rejects such archives in extract and list and reports them in
verify. Ignore keeps the central-directory interpretation and
raises no structural finding; resource limits still apply.
§Examples
use exarch_core::SecurityConfig;
use exarch_core::ZipConsistencyPolicy;
assert_eq!(
SecurityConfig::default().zip_consistency,
ZipConsistencyPolicy::Enforce
);
let relaxed = SecurityConfig::default().with_zip_consistency(ZipConsistencyPolicy::Ignore);
assert_eq!(relaxed.zip_consistency.as_str(), "ignore");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Enforce
Reject or report structurally ambiguous ZIP archives
Ignore
Use the central directory interpretation without structural findings
Implementations§
Trait Implementations§
Source§impl Clone for ZipConsistencyPolicy
impl Clone for ZipConsistencyPolicy
impl Copy for ZipConsistencyPolicy
Source§impl Debug for ZipConsistencyPolicy
impl Debug for ZipConsistencyPolicy
Source§impl Default for ZipConsistencyPolicy
impl Default for ZipConsistencyPolicy
Source§impl Display for ZipConsistencyPolicy
impl Display for ZipConsistencyPolicy
impl Eq for ZipConsistencyPolicy
Source§impl PartialEq for ZipConsistencyPolicy
impl PartialEq for ZipConsistencyPolicy
impl StructuralPartialEq for ZipConsistencyPolicy
Auto Trait Implementations§
impl Freeze for ZipConsistencyPolicy
impl RefUnwindSafe for ZipConsistencyPolicy
impl Send for ZipConsistencyPolicy
impl Sync for ZipConsistencyPolicy
impl Unpin for ZipConsistencyPolicy
impl UnsafeUnpin for ZipConsistencyPolicy
impl UnwindSafe for ZipConsistencyPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.