Bug 296549 - print/pdftk is broken after java/bouncycastle update to 1.83
Summary: print/pdftk is broken after java/bouncycastle update to 1.83
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
: 296566 (view as bug list)
Depends on:
Blocks:
 
Reported: 2026-07-06 07:28 UTC by Konstantin Belousov
Modified: 2026-07-10 16:00 UTC (History)
5 users (show)

See Also:


Attachments
poudriere log of the build failure (26.44 KB, text/plain)
2026-07-06 07:28 UTC, Konstantin Belousov
no flags Details
git diff to use an older bouncycastle version (3.10 KB, patch)
2026-07-10 15:05 UTC, Ronald Klop
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Belousov freebsd_committer freebsd_triage 2026-07-06 07:28:42 UTC
Created attachment 272533 [details]
poudriere log of the build failure

[javac]         ASN1Sequence content = (ASN1Sequence)((DERTaggedObject)signe
dData.getObjectAt(1)).getObject();
    [javac]
                     ^
    [javac]   symbol:   method getObject()
    [javac]   location: class DERTaggedObject
 and so on
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2026-07-07 09:33:00 UTC
*** Bug 296566 has been marked as a duplicate of this bug. ***
Comment 2 Thierry Thomas freebsd_committer freebsd_triage 2026-07-07 10:10:11 UTC
Bouncycastle 1.83 broke pdktk, which is unmaintained upstream since 22 sept. 2022.
And we should even upgrade it to the latest, to resolve several vulnerabilities, see
https://www.bouncycastle.org/resources/new-releases-bouncy-castle-java-1-84-and-bouncy-castle-java-lts-2-73-11/

My knowledge of Java is outdated, and I don't know how to fix this issue, but I can see two possibilities:

1) Do not try to build it, but download pre-built jars:
https://gitlab.com/api/v4/projects/5024297/packages/generic/pdftk-java/v3.3.3/pdftk-all.jar is available.

2) Extract the ancient bouncycastle source under ${WRKSRC}java/org/bouncycastle and fix the paths to use it.

Cc: java@, because they might have better ideas.
Comment 3 Ronald Klop freebsd_committer freebsd_triage 2026-07-07 12:18:43 UTC
I'm not officially @java, so speaking on personal terms.

We can mark print/pdftk broken and deprecated with a remark that it needs a maintainer, somebody to supply a patch or enough people that tell that they use it to spark interest in fixing the situation.
Comment 4 Robert William Vesterman 2026-07-08 01:42:05 UTC
Bouncy Castle is a cryptography library, right? I have to imagine that I'm probably not the only pdftk user who doesn't really care about encrypted PDFs, rather just using it to paste a few pages from separate PDFs into one, or rotating a page so it's no longer upside down, or something like that. Maybe there could be a build option for cryptographic support?
Comment 5 Thomas Mueller 2026-07-08 05:47:39 UTC
The second item in comment #2 could be achieved by reverting bug #260883.
Comment 6 Thierry Thomas freebsd_committer freebsd_triage 2026-07-08 08:04:18 UTC
(In reply to Thomas Mueller from comment #5)
Yes, you are right!
Comment 7 Ronald Klop freebsd_committer freebsd_triage 2026-07-10 15:05:17 UTC
Created attachment 272697 [details]
git diff to use an older bouncycastle version

I created a commit with a revert of bug #260883.

If I commit this I do plan to mention this port as vulnerable to the bouncycastle vuln.

It builds fine with the patch in my poudriere setup.
Comment 8 Ronald Klop freebsd_committer freebsd_triage 2026-07-10 15:14:16 UTC
(In reply to Ronald Klop from comment #7)
Oh never mind my remark about a "bouncycastle vuln".
That has nothing to do with the recent bouncycastle upgrade that broke pdftk.

Ok, to commit the patch?
Comment 9 Thierry Thomas freebsd_committer freebsd_triage 2026-07-10 15:51:44 UTC
(In reply to Ronald Klop from comment #8)

OK, please go!
Comment 10 commit-hook freebsd_committer freebsd_triage 2026-07-10 16:00:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a1c8d7e6b3554e4e61f76e04db6b6b4613824f27

commit a1c8d7e6b3554e4e61f76e04db6b6b4613824f27
Author:     Ronald Klop <ronald@FreeBSD.org>
AuthorDate: 2026-07-10 14:51:15 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2026-07-10 15:59:55 +0000

    print/pdftk: Revert "print/pdftk: Use bouncycastle dependency from ports tree"

    This reverts commit 5511c16caba4bba47d1d8f197b95144b29014d6f.

    The latest bouncycastle update is incompatible with pdftk.
    Pdftk is unmaintained upstream. Get pdftk working for now by having
    the bouncycastle version embedded.

    PR:     296549
    Approved-by:    Thierry Thomas <thierry@>

 print/pdftk/Makefile | 20 +++++++++++---------
 print/pdftk/distinfo |  4 +++-
 2 files changed, 14 insertions(+), 10 deletions(-)