This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2173781 - C_GetInfo can throw an exception if called before initialization in some PKCS #11 tokens [rhel-8, openjdk-17]
Summary: C_GetInfo can throw an exception if called before initialization in some PKCS...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: java-17-openjdk
Version: 8.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Martin Balao
QA Contact: OpenJDK QA
URL:
Whiteboard:
Depends On:
Blocks: 2186830 2186831 2186832 2186833
TreeView+ depends on / blocked
 
Reported: 2023-02-28 00:06 UTC by Martin Balao
Modified: 2024-05-10 23:58 UTC (History)
3 users (show)

Fixed In Version: java-17-openjdk-17.0.7.0.7-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2186830 2186831 2186832 2186833 (view as bug list)
Environment:
Last Closed: 2024-05-10 23:58:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rh-openjdk jdk pull 26 0 None open Avoid calling C_GetInfo() too early, before cryptoki is initialized 2023-02-28 00:06:27 UTC
Red Hat Issue Tracker   RHEL-36134 0 None Migrated None 2024-05-10 23:58:33 UTC
Red Hat Issue Tracker RHELPLAN-149969 0 None None None 2023-02-28 00:21:18 UTC

Description Martin Balao 2023-02-28 00:06:28 UTC
In some PKCS #11 tokens, calling C_GetInfo before initialization returns a CKR_CRYPTOKI_NOT_INITIALIZED error [1]. If this happens, the error is then transformed into a PKCS11Exception and thrown in the PKCS11 constructor [2]. Throwing an exception at that point would be unnecessarily fatal: execution should continue and it's only Password-Based Encryption who might, at some point, require the information —hopefully, the token will be initialized by then. Notice that this problem could not be reproduced with the NSS Software Token but with p11-kit-trust.so.

JDK-8255409 [3], available since JDK-18 (OpenJDK upstream), seems to handle a C_GetInfo throwing an exception in the constructor of PKCS11 [4]. It's not the goal of this ticket to backport JDK-8255409 to 17u but to fix this regression. Other options, such as backporting JDK-8255409 to 17u, will be considered in the future once the Password-Based Cryptography enhancement is accepted in OpenJDK head and backported to 17u [5].

PR discussion: https://github.com/rh-openjdk/jdk/pull/26

--
[1] - https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/cs01/pkcs11-spec-v3.1-cs01.html#_Toc111203257
[2] - https://github.com/rh-openjdk/jdk/blob/1e26894969d911776f60eaa557d25a2b389060da/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/PKCS11.java#L156
[3] - https://bugs.openjdk.org/browse/JDK-8255409
[4] - https://github.com/openjdk/jdk/commit/83e6a4c0e9e4a9474ae0c1252378b1a09d1d2df0#diff-507046ab6e8d2a75a31fe49822a43729eefa2ca12b4fe1c27f427ebb0702e208R160
[5] - https://github.com/openjdk/jdk/pull/12396

Comment 8 RHEL Program Management 2024-05-10 23:58:12 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 9 RHEL Program Management 2024-05-10 23:58:38 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


Note You need to log in before you can comment on or make changes to this bug.