some edits in OuterEncryptionReader

This commit is contained in:
2025-12-02 22:19:10 +03:00
parent c3bc68b6e9
commit 403283a30b

View File

@@ -23,7 +23,7 @@ public class OuterEncryptionReader : Stream
public override long Position public override long Position
{ {
get => position; get => position;
set => position = value; set { throw new NotSupportedException(); }
} }
public override long Length => throw new NotSupportedException(); public override long Length => throw new NotSupportedException();
@@ -42,7 +42,7 @@ public class OuterEncryptionReader : Stream
/// <summary> /// <summary>
/// Порядковый номер чанка, лежащего в <see cref="currentChunk"/>. /// Порядковый номер чанка, лежащего в <see cref="currentChunk"/>.
/// </summary> /// </summary>
private int currentChunkOrdinal = 0; private int nextChunkOrdinal = 0;
private bool isCurrentChunkLast; private bool isCurrentChunkLast;
private long position = 0; private long position = 0;
@@ -148,7 +148,8 @@ public class OuterEncryptionReader : Stream
{ {
if (isCurrentChunkLast) if (isCurrentChunkLast)
return; return;
var chunk = PassStoreContentChunk.GetFromStream(file, key, currentChunkOrdinal); var chunk = PassStoreContentChunk.GetFromStream(file, key, nextChunkOrdinal);
nextChunkOrdinal += 1;
isCurrentChunkLast = chunk.IsLast; isCurrentChunkLast = chunk.IsLast;
var encryptedData = chunk.GetContent(); var encryptedData = chunk.GetContent();
EraseCurrentChunk(); EraseCurrentChunk();