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 1532349

Summary: Gemalto 64K card is identified as CAC with configuration preferring CAC cards
Product: Red Hat Enterprise Linux 7 Reporter: Roshni <rpattath>
Component: openscAssignee: Jakub Jelen <jjelen>
Status: CLOSED NOTABUG QA Contact: Asha Akkiangady <aakkiang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-27 18:33:07 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:
Attachments:
Description Flags
opensc debug log for non CAC/PIV cards none

Description Roshni 2018-01-08 17:36:07 UTC
Description of problem:
Gemalto 64K card is identified as CAC with configuration preferring CAC cards

Version-Release number of selected component (if applicable):
opensc-0.16.0-8.20170227git777e2a3.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. Refer https://bugzilla.redhat.com/show_bug.cgi?id=1473335#c20
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Jakub Jelen 2018-01-09 09:48:17 UTC
It looks like I don't have a card that would behave this way. Please, let me know when you will have this card spare in some computer and I could remotely investigate this issue further.

Or at least provide the debug log from the attempt with the latest OpenSC package to see what is going on there.

Comment 3 Roshni 2018-01-09 14:12:52 UTC
Hi Jakub,

i had provided the log messages here https://bugzilla.redhat.com/show_bug.cgi?id=1473335#c18, please let me know if you need additional information or if you want me to insert card on my test machine for you to debug the issue.

Comment 4 Jakub Jelen 2018-01-09 14:39:55 UTC
That was a log from the scratch build with wrong fix. With current fix from comment 19 it behaves differently.
Also if I read right, the log is successful with PIV Test card 7.

Comment 5 Roshni 2018-01-10 16:41:38 UTC
PIV and CAC cards are working as expected. This issue is when I have the following config and I use a non-CAC card

vi /etc/opensc-x86_64.conf
# Set the following:
card_drivers = cac, PIV-II;

Attaching the debug log with the very latest builds

Comment 6 Roshni 2018-01-10 16:42:12 UTC
Created attachment 1379603 [details]
opensc debug log for non CAC/PIV cards

Comment 7 Jakub Jelen 2018-01-11 10:55:44 UTC
In the first place, this is misconfiguration so nothing very important, but more like nice to have.

This is getting complicated, because the execution goes through the code paths created for the CAC Alt tokens, which for detection does not actually read the ACA object, as it should.

I have got a patch that reads the ACA befor marking it as a CAC-2 card, but we might hit the same issue with the CAC1 code paths. Also before using this patch, we would need to make sure it still works also with the Alt Tokens.

Here is a scratch build:

https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=14919212

If it will not resolve the issue, please attach the debug logs from the same test case.

Comment 8 Roshni 2018-04-27 18:33:07 UTC
This issue will not be seen with the correct card_drivers configuration when different cards are used as mentioned under FAQ section of https://access.redhat.com/articles/3034441