From ddb6efe6c386b77fa482de4588672e65ffd32e5d Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Thu, 27 Jul 2023 06:20:18 +0000 Subject: [PATCH] PDFBOX-5639: add test git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1911309 13f79535-47bb-0310-9956-ffa450edef68 --- .../encryption/TestSymmetricKeyEncryption.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java b/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java index 4ac77fd2663..b3bed4c3072 100644 --- a/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java +++ b/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java @@ -327,6 +327,21 @@ void testPDFBox4453() throws IOException } } + /** + * test AESV3 with R=5 and excess bytes. + * + * @throws IOException + */ + @Test + void testPDFBox5639() throws IOException + { + File file = new File("target/pdfs", "PDFBOX-5639.pdf"); + try (PDDocument document = Loader.loadPDF(file, "JUL2023rfi")) + { + assertEquals(2, document.getNumberOfPages()); + } + } + private void testSymmEncrForKeySize(String filename, int keyLength, boolean preferAES, int sizePriorToEncr, byte[] inputFileAsByteArray, String userpassword, String ownerpassword,