1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 18:59:39 +02:00

Create TeeBCPGInputStream to move teeing logic out of OpenPgpMessageInputStream

This commit is contained in:
Paul Schaub 2022-10-08 13:57:53 +02:00
parent e420678076
commit bdc968dd43
7 changed files with 182 additions and 129 deletions

View file

@ -49,7 +49,6 @@ import org.pgpainless.util.Tuple;
public class OpenPgpMessageInputStreamTest {
public static final String KEY = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
"Version: PGPainless\n" +
"Comment: DA05 848F 37D4 68E6 F982 C889 7A70 1FC6 904D 3F4C\n" +
@ -241,7 +240,7 @@ public class OpenPgpMessageInputStreamTest {
System.out);
}
public static void genSIG_LIT() throws PGPException, IOException {
public static void genSIG_COMP_LIT() throws PGPException, IOException {
PGPSecretKeyRing secretKeys = PGPainless.readKeyRing().secretKeyRing(KEY);
ByteArrayOutputStream msgOut = new ByteArrayOutputStream();
EncryptionStream signer = PGPainless.encryptAndOrSign()

View file

@ -30,9 +30,9 @@ public class PDATest {
@Test
public void testSimpleOpsSignedMesssageIsValid() throws MalformedOpenPgpMessageException {
PDA automaton = new PDA();
automaton.next(InputAlphabet.OnePassSignatures);
automaton.next(InputAlphabet.OnePassSignature);
automaton.next(InputAlphabet.LiteralData);
automaton.next(InputAlphabet.Signatures);
automaton.next(InputAlphabet.Signature);
automaton.next(InputAlphabet.EndOfSequence);
assertTrue(automaton.isValid());
@ -47,7 +47,7 @@ public class PDATest {
@Test
public void testSimplePrependSignedMessageIsValid() throws MalformedOpenPgpMessageException {
PDA automaton = new PDA();
automaton.next(InputAlphabet.Signatures);
automaton.next(InputAlphabet.Signature);
automaton.next(InputAlphabet.LiteralData);
automaton.next(InputAlphabet.EndOfSequence);
@ -63,10 +63,10 @@ public class PDATest {
@Test
public void testOPSSignedCompressedMessageIsValid() throws MalformedOpenPgpMessageException {
PDA automaton = new PDA();
automaton.next(InputAlphabet.OnePassSignatures);
automaton.next(InputAlphabet.OnePassSignature);
automaton.next(InputAlphabet.CompressedData);
// Here would be a nested PDA for the LiteralData packet
automaton.next(InputAlphabet.Signatures);
automaton.next(InputAlphabet.Signature);
automaton.next(InputAlphabet.EndOfSequence);
assertTrue(automaton.isValid());