mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-12 19:59:38 +02:00
Reinstate integrity-protection and fix tests
Integrity Protection is now checked when reading from the stream, not only when closing.
This commit is contained in:
parent
654493dfcc
commit
fbcde13df3
3 changed files with 46 additions and 15 deletions
|
@ -238,8 +238,10 @@ public class ModificationDetectionTests {
|
|||
);
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
assertThrows(ModificationDetectionException.class, decryptionStream::close);
|
||||
assertThrows(ModificationDetectionException.class, () -> {
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
decryptionStream.close();
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
@ -269,8 +271,10 @@ public class ModificationDetectionTests {
|
|||
);
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
assertThrows(ModificationDetectionException.class, decryptionStream::close);
|
||||
assertThrows(ModificationDetectionException.class, () -> {
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
decryptionStream.close();
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
@ -313,8 +317,10 @@ public class ModificationDetectionTests {
|
|||
);
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
assertThrows(ModificationDetectionException.class, decryptionStream::close);
|
||||
assertThrows(ModificationDetectionException.class, () -> {
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
decryptionStream.close();
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
@ -344,8 +350,10 @@ public class ModificationDetectionTests {
|
|||
);
|
||||
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
assertThrows(ModificationDetectionException.class, decryptionStream::close);
|
||||
assertThrows(ModificationDetectionException.class, () -> {
|
||||
Streams.pipeAll(decryptionStream, out);
|
||||
decryptionStream.close();
|
||||
});
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue