mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-22 16:26:31 +03:00
some edits in OuterEncryptionReader
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user