Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2030981

Summary: Kerberos pkinit should follow consistent pkcs11 support in RHEL
Product: Red Hat Enterprise Linux 9 Reporter: Jakub Jelen <jjelen>
Component: krb5Assignee: Julien Rische <jrische>
Status: CLOSED ERRATA QA Contact: Filip Dvorak <fdvorak>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: abokovoy, fdvorak, gkaihoro, jrische, myusuf
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: krb5-1.19.1-19.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2073274 (view as bug list) Environment:
Last Closed: 2022-11-15 11:11:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2073274    

Description Jakub Jelen 2021-12-10 08:15:23 UTC
Description of problem:
The pkinit hardcodes the path to the opensc-pkcs11.so module, which is not aligned to the rest of the RHEL's consistent pkcs11 support, which we introduced in RHEL8

krb5-1.19.1/src/plugins/preauth/pkinit/pkinit.h:#define PKCS11_MODNAME "opensc-pkcs11.so"

The pkinit should use p11-kit-proxy.so, which is installed by default on RHEL and which automatically loads any installed pkcs11 module on the system to simplify configuration and usage.

Version-Release number of selected component (if applicable):
current rhel8 and rhel9

How reproducible:
always

Steps to Reproduce:
0. Install and configure softhsm or any other pkcs11 module other than opensc to provide certificate for pkinit
1. kinit -X kinit -X X509_user_identity=PKCS11: ipauser1

Actual results:
The pkinit is unable to find the certificate

Expected results:
The pkinit finds the certificate (without specifying the pkcs11 module with PKCS11:module_name=/usr/lib64/libsofthsm2.so or PKCS11:module_name=/usr/lib64/p11-kit-proxy.so

Additional info:
Similar behavior is described by the PKCS#11 URIs:

https://datatracker.ietf.org/doc/html/rfc7512

and is implemented by most of the software using smart cards in the operating system including openssh, wget, curl, librewan, ngingx, httpd, ...

https://www.redhat.com/en/blog/consistent-pkcs-11-support-red-hat-enterprise-linux-8

Comment 1 Alexander Bokovoy 2022-04-04 05:56:47 UTC
Julien,

this looks like a sensible downstream change for a define.

I think we should do it both in Fedora and RHEL.

Comment 5 Julien Rische 2022-05-02 08:41:54 UTC
Upstream PR merged:
https://github.com/krb5/krb5/commit/855c715e90f4f115e77136f42b4570c03d325cae

Comment 6 Julien Rische 2022-05-02 16:51:26 UTC
CentOS 9 Stream pull request:
https://gitlab.com/redhat/centos-stream/rpms/krb5/-/merge_requests/17

Comment 21 Julien Rische 2022-06-13 10:19:21 UTC
I opened the RFE bug 2096219 to discuss the possibility to search for a certlabel across all tokens.

Comment 25 errata-xmlrpc 2022-11-15 11:11:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (krb5 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8271