mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-11-15 17:02:03 +00:00
Merge remote-tracking branch 'origin/release' into fix/1439-sevenzip-password-exceptions
# Conflicts: # docs/API.md
This commit is contained in:
12
docs/API.md
12
docs/API.md
@@ -81,6 +81,8 @@ using (var archive = ArchiveFactory.OpenArchive(parts))
|
||||
|
||||
Stored (compression method 0) comments are supported up to 16 MiB of unpacked data; larger or unknown-size comments throw `InvalidFormatException`. Comments using other compression methods are skipped without affecting entry extraction.
|
||||
|
||||
Truncated encrypted comment data throws `InvalidFormatException` on synchronous reads or `IncompleteArchiveException` on asynchronous reads. RAR5 KDF counts above 24 are rejected with `CryptographicException` before deriving encryption keys.
|
||||
|
||||
```csharp
|
||||
using var archive = RarArchive.OpenArchive(
|
||||
"encrypted.rar",
|
||||
@@ -484,6 +486,10 @@ using (var archive = ZipArchive.OpenArchive("file.zip"))
|
||||
|
||||
`CheckCrc` validates archive-level payload checksums when the format stores reliable metadata, such as ZIP CRC32 values. Formats without payload checksums skip this validation. Decompressor integrity checks that are required to decode a stream may still fail even when `CheckCrc` is disabled.
|
||||
|
||||
WinZip AES authentication is always checked, including when `CheckCrc` is disabled. Complete or dispose entry streams to verify authentication; plaintext returned before completion must not be treated as authenticated. Invalid authentication tags throw `InvalidFormatException`, and missing ciphertext or tag bytes throw `IncompleteArchiveException`.
|
||||
|
||||
7z AES key derivation accepts iteration exponents 0 through 24 and the special `0x3F` direct-key mode. Larger iteration exponents throw `NotSupportedException` before key derivation, including when salt and IV are absent.
|
||||
|
||||
When using `SymbolicLinkHandler`, directory extraction rejects link targets outside the extraction root and never follows symbolic links or reparse points while extracting later entries. The handler itself remains trusted application code.
|
||||
|
||||
### Options matrix
|
||||
@@ -831,6 +837,7 @@ using (var reader = ReaderFactory.OpenReader(stream))
|
||||
- [USAGE.md](USAGE.md) - Complete code examples
|
||||
- [FORMATS.md](FORMATS.md) - Supported formats
|
||||
- [PERFORMANCE.md](PERFORMANCE.md) - API selection guide
|
||||
|
||||
## 7z Encrypted Decoding Errors
|
||||
|
||||
AES-encrypted 7z codec data errors and encrypted-header CRC failures throw `SharpCompress.Common.CryptographicException`,
|
||||
@@ -839,3 +846,8 @@ incorrect password or corrupt encrypted data; 7z AES has no independent password
|
||||
`CryptographicException(string message, Exception inner)` preserves an underlying failure.
|
||||
Unencrypted codec errors retain their existing behavior. This does not guarantee detection
|
||||
of every incorrect password, particularly for data without compression or integrity checking.
|
||||
|
||||
## 7z Encryption Detection
|
||||
|
||||
For 7z archives, `IsEncrypted` is true when any entry has an AES-encrypted data stream.
|
||||
Streamless empty files and directories are not encrypted. Archives without files return false.
|
||||
|
||||
Reference in New Issue
Block a user