mirror of
https://github.com/google/nomulus
synced 2026-09-19 14:34:18 +00:00
Move the RDE encryption to a dedicated file
Merges the encryptor creation between RyDE and Ghostryde. The new file - RydeEncryption.java - is a merge of the removed functions in Ghostryde.java and the RydePgpEncryptionOutputStream.java. This is one of a series of CLs - each merging a single "part" of the encoding. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=205246053
This commit is contained in:
@@ -161,13 +161,15 @@ public class GhostrydeTest {
|
||||
korruption(ciphertext, ciphertext.length / 2);
|
||||
|
||||
ByteArrayInputStream bsIn = new ByteArrayInputStream(ciphertext);
|
||||
assertThrows(
|
||||
PGPException.class,
|
||||
() -> {
|
||||
try (InputStream decoder = Ghostryde.decoder(bsIn, privateKey)) {
|
||||
ByteStreams.copy(decoder, ByteStreams.nullOutputStream());
|
||||
}
|
||||
});
|
||||
RuntimeException thrown =
|
||||
assertThrows(
|
||||
RuntimeException.class,
|
||||
() -> {
|
||||
try (InputStream decoder = Ghostryde.decoder(bsIn, privateKey)) {
|
||||
ByteStreams.copy(decoder, ByteStreams.nullOutputStream());
|
||||
}
|
||||
});
|
||||
assertThat(thrown).hasCauseThat().isInstanceOf(PGPException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -219,15 +221,17 @@ public class GhostrydeTest {
|
||||
}
|
||||
|
||||
ByteArrayInputStream bsIn = new ByteArrayInputStream(bsOut.toByteArray());
|
||||
PGPException thrown =
|
||||
RuntimeException thrown =
|
||||
assertThrows(
|
||||
PGPException.class,
|
||||
RuntimeException.class,
|
||||
() -> {
|
||||
try (InputStream decoder = Ghostryde.decoder(bsIn, privateKey)) {
|
||||
ByteStreams.copy(decoder, ByteStreams.nullOutputStream());
|
||||
}
|
||||
});
|
||||
assertThat(thrown).hasCauseThat().isInstanceOf(PGPException.class);
|
||||
assertThat(thrown)
|
||||
.hasCauseThat()
|
||||
.hasMessageThat()
|
||||
.contains(
|
||||
"Message was encrypted for keyids [a59c132f3589a1d5] but ours is c9598c84ec70b9fd");
|
||||
|
||||
Reference in New Issue
Block a user