[
https://issues.apache.org/jira/browse/PDFBOX-6218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095847#comment-18095847
]
ASF subversion and git services commented on PDFBOX-6218:
---------------------------------------------------------
Commit 1936104 from Tilman Hausherr in branch 'pdfbox/branches/3.0'
[ https://svn.apache.org/r1936104 ]
PDFBOX-6218: use ByteArrrayInputStream as workaround because of changed
behavior in bc 1.85
> org.bouncycastle.cms.CMSException: IOException reading content.
> ---------------------------------------------------------------
>
> Key: PDFBOX-6218
> URL: https://issues.apache.org/jira/browse/PDFBOX-6218
> Project: PDFBox
> Issue Type: Bug
> Components: Crypto
> Affects Versions: 2.0.37, 3.0.8 PDFBox
> Reporter: Tilman Hausherr
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 2.0.38, 3.0.9 PDFBox, 4.0.0
>
>
> The latest bouncy castle version 1.85 has a new "feature", it checks input
> for extra bytes so all signature tests fail because we don't know the real
> length of the signature, we write into an array of zero bytes which worked
> fine in the past.
> It happened in this commit:
> https://github.com/bcgit/bc-java/commit/ca74bb8e27fa75fa52fceec0c1553b25ce1d3192
> org.bouncycastle.cms.CMSException: IOException reading content.
> at org.bouncycastle.cms.CMSUtils.readContentInfo(Unknown Source)
> at org.bouncycastle.cms.CMSSignedData.<init>(Unknown Source)
> at
> org.apache.pdfbox.examples.pdmodel.TestCreateSignature.testCRL(TestCreateSignature.java:876)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
> at
> java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
> at
> java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
> at
> java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
> at
> java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
> Caused by: java.io.IOException: Extra data detected in stream
> at org.bouncycastle.asn1.ASN1Primitive.fromByteArray(Unknown Source)
> ... 9 more
> I was able to find one workaround for some of the cases, which is to wrap the
> byte array into a ByteArrayInputStream, e.g. in testCRL().
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]