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.
DescriptionOrion Poplawski
2019-03-19 16:37:59 UTC
Description of problem:
I'm trying to make use of a YubiKey configured as follows:
* Certificate for PIV Authentication - slot 9a: USER certificate
* Certificate for Key Management - slot 9d: MacOS encryption certificate
* Retired Certificate for Key Management 1 - slot 82: USER-admin certificate
This is because the of the apparent requirement for an encryption certificate to use the yubikey on a Mac: https://support.yubico.com/support/solutions/articles/15000010854-macos-native-smart-card-support-for-logon-with-windows-server and the need for a separate -admin certificate.
The Windows minidriver puts the admin certificate into slot 82 will look at the retired certificate slots automatically, so that works out of the box. For Linux though, we need to tell OpenSC that the extra slots are available. The magic incantation to do this is:
echo C10114C20100FE00 | xxd -r -p | ykman piv write-object 0x5FC10C -
See https://github.com/OpenSC/OpenSC/issues/847#issuecomment-238119888 for more information about that.
This allows me to login/su using the certificates and pin. However, using the ssh agent with my orion-admin certificate in slot 82 is flaky. It works fine until some other authentication operation is done with the card (su - orion-admin for example):
sign_and_send_pubkey: signing failed: agent refused operation
ssh-pkcs11-helper[28856]: error: C_Sign failed: 257
ssh-agent[28815]: error: process_sign_request2: sshkey_sign: error in libcrypto
or
ssh-pkcs11-helper[28856]: error: cannot find private key
ssh-agent[28815]: error: process_sign_request2: sshkey_sign: error in libcrypto
I enabled opensc debugging - and I see entries when I successfully add the card to the agent, but I don't see any further activity when I ssh to other machines.
I do not have this problem with a different yubikey with my orion-admin certificate in the Key Management slot 9d.
Version-Release number of selected component (if applicable):
openssh-7.4p1-16.el7.x86_64
The current RHEL7.6 OpenSC does not have any mechanisms to detect and resolve concurrent access to the PIV card from different applications. Actually even existence of the "magic object" (0x5FC10C) and some operation might break the login state so I really think this should be filled against opensc.
To follow up from here, we actually know about this issue and it should be already resolved in the current opensc. Can you check that current master will work for you? If not, I will need some more debugging information from OpenSC.