Description of problem:
I have two PRs in upstream accepted for better support of CloudHSM in FIPS mode. They address two separate issues:
1. Write EC public key objects with full DER (instead of just the content bytes)
2. Specify mechanism for RSA key generation in hexadecimal (for vendor proprietary mechanisms). In FIPS mode SafeNet uses 0x8000014 0x80000143 instead of 0x0 and 0xA
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Put CloudHSM/SafeNet Luna in FIPS mode
1. pkcs11-tool --module /usr/lib/libCryptoki2_64.so --slot 0 --pin PIN --login --write ec_publickey.der
- will fail as we are not sending the correct bytes (missing ASN.1 TL)
2. pkcs11-tool --module /usr/lib/libCryptoki2_64.so --slot 0 --pin PIN --login --keypairgen --key-type RSA:2048
- will fail, SafeNet needs -m 0x80000142 or -m 0x80000143 (possible with the PR)
Both operations fail
Both operations succeed
Accepted by upstream
1. Fix EC public key(send complete DER): bytes https://github.com/OpenSC/OpenSC/pull/1287
2. Accept hexadecimal for mechanism: https://github.com/OpenSC/OpenSC/pull/1302
Please backport to RHEL 7.5 and Fedora 28.
Here we talk about the following two upstream commits, that really makes sense to bring in:
*** Bug 1557740 has been marked as a duplicate of this bug. ***
[root@dhcp129-188 ~]# rpm -qi opensc
Name : opensc
Version : 0.16.0
Release : 10.20170227git777e2a3.el7
Install Date: Tue 31 Jul 2018 10:10:39 AM EDT
Group : System Environment/Libraries
Size : 3260617
License : LGPLv2+
Signature : RSA/SHA256, Tue 03 Jul 2018 04:12:33 AM EDT, Key ID 199e2f91fd431d51
Source RPM : opensc-0.16.0-10.20170227git777e2a3.el7.src.rpm
Build Date : Tue 03 Jul 2018 03:59:44 AM EDT
Build Host : x86-019.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Vendor : Red Hat, Inc.
URL : https://github.com/OpenSC/OpenSC/wiki
Summary : Smart card library and applications
Sanity tests look good.
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.