mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Add encryptionNotSupported error for 7z
This commit is contained in:
@@ -39,4 +39,5 @@ public enum SevenZipError: Error {
|
||||
case noPackInfoFound
|
||||
case streamOverread
|
||||
case dataIsUnavailable
|
||||
case encryptionNotSupported
|
||||
}
|
||||
|
||||
@@ -166,7 +166,11 @@ class SevenZipFolder {
|
||||
try lzmaDecoder.decodeLZMA(unpackSize, properties[0], dictionarySize)
|
||||
decodedData = Data(bytes: lzmaDecoder.out)
|
||||
} else {
|
||||
throw SevenZipError.compressionNotSupported
|
||||
if coder.id[0] == 0x06 {
|
||||
throw SevenZipError.encryptionNotSupported
|
||||
} else {
|
||||
throw SevenZipError.compressionNotSupported
|
||||
}
|
||||
}
|
||||
|
||||
guard decodedData.count == unpackSize
|
||||
|
||||
Reference in New Issue
Block a user