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.
Description of problem:
CKM_ECDSA_SHA1 mechanism is provided by coolkey (with flag CKF_HW), but (I suspect) it does not do the hash in hardware (not separately provided).
Opensc does not report this mechanism for the same card. It reports digests mechanisms, but without pretending that they are HW.
Robert Relyea wrote:
> It doesn't support it (even without the hardware flag). Hmm I'm looking at slot::signInit in coolkey and it doesn't even check the mechanism type! So you won't get an error if you call it, it will just silently CKM_ECDSA sign the data you send (truncating it appropriately).
Version-Release number of selected component (if applicable):
coolkey-1.1.0-33.el7.x86_64
How reproducible:
deterministic
Steps to Reproduce:
1. Call C_GetMechanismList PKCS#11 function
2. Call C_SignInit
Actual results:
11: C_GetMechanismList
2016-04-21 15:18:09.154
[in] slotID = 0x1
[out] pMechanismList[3]:
CKM_ECDSA
CKM_ECDSA_SHA1
CKM_ECDH1_DERIVE
Returned: 0 CKR_OK
[...]
142: C_SignInit
2016-04-21 15:18:12.071
[in] hSession = 0x1000002
pMechanism->type=CKM_ECDSA_SHA1
[in] hKey = 0x401
Returned: 0 CKR_OK
Expected results:
11: C_GetMechanismList
2016-04-21 15:18:09.154
[in] slotID = 0x1
[out] pMechanismList[2]:
CKM_ECDSA
CKM_ECDH1_DERIVE
Returned: 0 CKR_OK
[...]
142: C_SignInit
<< should check mechanisms and fail >>
Additional info:
Hello Roshni,
the problem can be demonstrated using testing PIV card number 4, which has EC keys and supports ECDSA mechanism. But it does not support ECDSA_SHA1.
The simplest way to reproduce is to use pkcs11-tool:
pkcs11-tool -M --module=/usr/lib64/pkcs11/libcoolkeypk11.so
Currently, the list shows
Using slot 0 with a present token (0x1)
Supported mechanisms:
ECDSA, keySize={256,521}, hw, sign, other flags=0x100000
ECDSA-SHA1, keySize={256,521}, hw, sign, other flags=0x100000
ECDH1-DERIVE, keySize={256,521}, hw, derive, other flags=0x100000
But the second line should not be there. I manually verified that the coolkey.x86_64 1.1.0-35.el7 does what it should.
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, 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://rhn.redhat.com/errata/RHBA-2016-2465.html
Description of problem: CKM_ECDSA_SHA1 mechanism is provided by coolkey (with flag CKF_HW), but (I suspect) it does not do the hash in hardware (not separately provided). Opensc does not report this mechanism for the same card. It reports digests mechanisms, but without pretending that they are HW. Robert Relyea wrote: > It doesn't support it (even without the hardware flag). Hmm I'm looking at slot::signInit in coolkey and it doesn't even check the mechanism type! So you won't get an error if you call it, it will just silently CKM_ECDSA sign the data you send (truncating it appropriately). Version-Release number of selected component (if applicable): coolkey-1.1.0-33.el7.x86_64 How reproducible: deterministic Steps to Reproduce: 1. Call C_GetMechanismList PKCS#11 function 2. Call C_SignInit Actual results: 11: C_GetMechanismList 2016-04-21 15:18:09.154 [in] slotID = 0x1 [out] pMechanismList[3]: CKM_ECDSA CKM_ECDSA_SHA1 CKM_ECDH1_DERIVE Returned: 0 CKR_OK [...] 142: C_SignInit 2016-04-21 15:18:12.071 [in] hSession = 0x1000002 pMechanism->type=CKM_ECDSA_SHA1 [in] hKey = 0x401 Returned: 0 CKR_OK Expected results: 11: C_GetMechanismList 2016-04-21 15:18:09.154 [in] slotID = 0x1 [out] pMechanismList[2]: CKM_ECDSA CKM_ECDH1_DERIVE Returned: 0 CKR_OK [...] 142: C_SignInit << should check mechanisms and fail >> Additional info: