pub struct SecurityLimits {
pub max_archive_size: u64,
pub max_hash_entries: u32,
pub max_block_entries: u32,
pub max_sector_shift: u16,
pub max_path_length: usize,
pub max_compression_ratio: u32,
pub max_decompressed_size: u64,
pub max_file_count: u32,
pub max_session_decompressed: u64,
pub max_decompression_time: Duration,
pub enable_pattern_detection: bool,
pub enable_adaptive_limits: bool,
}Expand description
Security limits for various MPQ structures
Fields§
§max_archive_size: u64Maximum allowed archive size (default: 4GB)
max_hash_entries: u32Maximum allowed hash table entries (default: 1M)
max_block_entries: u32Maximum allowed block table entries (default: 1M)
max_sector_shift: u16Maximum allowed sector size shift (default: 20 for 512MB sectors)
max_path_length: usizeMaximum allowed file path length (default: 260 chars)
max_compression_ratio: u32Maximum allowed compression ratio (default: 1000:1)
max_decompressed_size: u64Maximum allowed decompressed size per file (default: 100MB)
max_file_count: u32Maximum allowed number of files in archive (default: 100k)
max_session_decompressed: u64Maximum total decompressed bytes per session (default: 1GB)
max_decompression_time: DurationMaximum decompression time per file (default: 30 seconds)
enable_pattern_detection: boolEnable pattern-based compression bomb detection (default: true)
enable_adaptive_limits: boolAdaptive compression ratio limits (default: true)
Implementations§
Source§impl SecurityLimits
impl SecurityLimits
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create new security limits with more permissive settings
Trait Implementations§
Source§impl Clone for SecurityLimits
impl Clone for SecurityLimits
Source§fn clone(&self) -> SecurityLimits
fn clone(&self) -> SecurityLimits
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityLimits
impl Debug for SecurityLimits
Auto Trait Implementations§
impl Freeze for SecurityLimits
impl RefUnwindSafe for SecurityLimits
impl Send for SecurityLimits
impl Sync for SecurityLimits
impl Unpin for SecurityLimits
impl UnwindSafe for SecurityLimits
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more