Skip to content

Commit 270227c

Browse files
committed
Throw ZipException instead of generic Exception on password error
1 parent ad755c5 commit 270227c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ICSharpCode.SharpZipLib/Zip/ZipFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3196,7 +3196,7 @@ Stream CreateAndInitDecryptionStream(Stream baseStream, ZipEntry entry)
31963196
var decryptor = new ZipAESTransform(rawPassword_, saltBytes, blockSize, false);
31973197
byte[] pwdVerifyCalc = decryptor.PwdVerifier;
31983198
if (pwdVerifyCalc[0] != pwdVerifyRead[0] || pwdVerifyCalc[1] != pwdVerifyRead[1])
3199-
throw new Exception("Invalid password for AES");
3199+
throw new ZipException("Invalid password for AES");
32003200
result = new ZipAESStream(baseStream, decryptor, CryptoStreamMode.Read);
32013201
} else {
32023202
throw new ZipException("Decryption method not supported");

0 commit comments

Comments
 (0)