-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
I am using SharpZipLib v1.2.0.246 to zip and unzip the files with AES encryption.
Steps to reproduce
- I have set the zipEntry.AESKeySize to 128 or 256
- I have a zip file which contains a zip-entry i.e. 'Test.xml' file which i reads during initialization.
- The Test.xml file contents is getting updated and i have to update the zip file accordingly.
- To do this firstly i am removing the 'Test.xml' from zip(deleting the file) and add new entry with same name using StaticDataSource.
- While doing this, the version of zip-entry is getting changed. i.e. when zip file is got created the version of zip entry was '51' but after deleting and adding new entry it became '20'. so i got the "Decryption method not supported, at ICSharpCode.SharpZipLib.Zip.ZipFile.CreateAndInitDecryptionStream(Stream baseStream, ZipEntry entry) in 'zipfilepath' "
Expected behavior
It should update zipfile with latest zip entry and should be AES encrypted.
Actual behavior
It throws exception :
ICSharpCode.SharpZipLib.Zip.ZipException: 'Decryption method not supported
at ICSharpCode.SharpZipLib.Zip.ZipFile.CreateAndInitDecryptionStream(Stream baseStream, ZipEntry entry) in C:\projects\sharpziplib\src\ICSharpCode.SharpZipLib\Zip\ZipFile.cs:line 3606
at ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream(Int64 entryIndex) in C:\projects\sharpziplib\src\ICSharpCode.SharpZipLib\Zip\ZipFile.cs:line 867
at ICSharpCode.SharpZipLib.Zip.ZipFile.GetInputStream(ZipEntry entry) in C:\projects\sharpziplib\src\ICSharpCode.SharpZipLib\Zip\ZipFile.cs:line 835
at Knorr.DF.Zip.KBZipContainer.ExtractZipEntries(Stream str, String password, Int32 aesKeySize)
Version of SharpZipLib
ICSharpCode.SharpZipLib v1.2.0.246
Obtained from (only keep the relevant lines)
- Package installed using NuGet