.net core zip+aes ReadAsync failed on one of files
See original GitHub issueSteps to reproduce
1.open archive with password “TestStorage” 2.try extract file “[www/autopilotandbridge/home.png]” using
var entry = _zf.GetEntry(path);
var zipStream = _zf.GetInputStream(entry);
var buffer = new byte[entry.Size];
var result = await zipStream.ReadAsync(buffer, 0, buffer.Length);
Expected behavior
file is extracted
Actual behavior
Got exception
TransformFinalBlock is not implemented and inputCount is greater than 0
at ICSharpCode.SharpZipLib.Encryption.ZipAESTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.<ReadAsyncCore>d__43.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at System.Security.Cryptography.CryptoStream.<ReadAsyncInternal>d__38.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at ResourceCollection.LazyZipDirectoryLoader.
Version of SharpZipLib
Obtained from (only keep the relevant lines)
- Package installed using NuGet v1.3.1 ConsoleApp2.zip
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
c# - How to Async Files.ReadAllLines and await for results?
Apparently that the StreamReader "async" methods block the current thread for a considerable amount of time before returning an incomplete Task.
Read more >File IO improvements in .NET 6 - .NET Blog
Learn about high-performance file IO features in NET 6, like concurrent reads and writes, scatter/gather IO and many more.
Read more >StopNow(), Backup and cancellation tokens - Developer
Hi @gpatel-fr, I've been looking at the StopNow() issue, and attempting like you to looking at the code. My threading skills around async ......
Read more >Issues to address to get out of beta - Developer
So the aftp issue seems to be fixed now. Has anyone else tested it in any way? I started testing with 2.0.4.29 yesterday,...
Read more >ftp2? Evolving File Transfer with msgfiles
This low-level library wraps 3 rd party dependencies, including ZIP, AES, and JSON. It also includes the core TLS code including self-signed ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, sync read work flawless. But this should be fixed somehow anyway or throw exception on any attempt to ReadAsync on ZIP+AES. Too many people will be puzzled by an error like: (only this file out of a hundred cannot be read), a lot of projects will be moved to .net 5.0 from .net Framework
@ShadowTeolog You should no longer get this error with the new 1.3.2 release, though the stream reads won’t actually be async yet.