Skip to content

Commit 3dd630c

Browse files
committed
Updated test for almost valid ciphertext input for ParsedCipherText
1 parent 22c3e7d commit 3dd630c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/com/amazonaws/encryptionsdk/ParsedCiphertextTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ public void incompleteCiphertext() {
8787
masterKeyProvider,
8888
plaintextBytes,
8989
encryptionContext).getResult();
90-
byte[] incompleteCipherText = Arrays.copyOfRange(cipherText, 1, cipherText.length);
90+
ParsedCiphertext pCt = new ParsedCiphertext(cipherText);
9191

92-
final ParsedCiphertext pCt = new ParsedCiphertext(incompleteCipherText);
92+
byte[] incompleteCiphertext = Arrays.copyOf(pCt.getCiphertext(), pCt.getOffset() - 1);
93+
ParsedCiphertext badPCt = new ParsedCiphertext(incompleteCiphertext);
9394
}
9495
}

0 commit comments

Comments
 (0)