Skip to content

.net core zip+aes ReadAsync failed on one of files #572

@ShadowTeolog

Description

@ShadowTeolog

Steps 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions