| Summary: | coolkey should not present and accept CKM_ECDSA_SHA1 mechanism on ECC PIV cards | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jakub Jelen <jjelen> |
| Component: | coolkey | Assignee: | Bob Relyea <rrelyea> |
| Status: | CLOSED ERRATA | QA Contact: | Asha Akkiangady <aakkiang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.4 | CC: | rpattath, rrelyea |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | coolkey-1.1.0-34.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-04 06:52:38 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: | |
fixed in coolkey-1.1.0-34.el7 Bob, Please provide testing instructions. 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.
[root@dhcp129-54 ~]# rpm -qi coolkey Name : coolkey Version : 1.1.0 Release : 35.el7 Architecture: x86_64 Install Date: Thu 04 Aug 2016 11:38:21 AM EDT Group : System Environment/Libraries Size : 300220 License : LGPLv2 Signature : RSA/SHA256, Thu 28 Jul 2016 01:24:44 PM EDT, Key ID 938a80caf21541eb Source RPM : coolkey-1.1.0-35.el7.src.rpm Build Date : Fri 01 Jul 2016 05:09:30 PM EDT Build Host : x86-034.build.eng.bos.redhat.com Relocations : (not relocatable) Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Vendor : Red Hat, Inc. URL : http://directory.fedora.redhat.com/wiki/CoolKey Summary : CoolKey PKCS #11 module Installed opensc for pkcs11-tool [root@dhcp129-54 ~]# pkcs11-tool -M --module=/usr/lib64/pkcs11/libcoolkeypk11.so Using slot 0 with a present token (0x1) Supported mechanisms: ECDSA, keySize={256,521}, hw, sign, other flags=0x100000 ECDH1-DERIVE, keySize={256,521}, hw, derive, other flags=0x100000 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: