pkcs11-tool fails to import EC public keys

Bug #1646387 reported by Dominik Reusser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
opensc (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

This is maybe related to #1312462.

After setting up either as Software HSM from opencryptoki or libSoftHSM, do the following to reproduce the problem:

> openssl ecparam -name brainpoolP256r1 -out test.pem -genkey

> openssl ec -in test.pem -pubout -out test_pub.pem

> pkcs11-tool --module /usr/lib/opencryptoki/libopencryptoki.so.0 --login --pin 000000 --write-object test_pub.pem --type pubkey
Using slot 0 with a present token (0x3)
error: OpenSSL error during RSA public key parsing
Aborting.

Expected behaviour: the key is imported as elliptic curve key.

Importing the private key works:

> pkcs11-tool --module /usr/lib/opencryptoki/libopencryptoki.so.0 --login --pin 000000 --write-object test.pem --type privkey
Using slot 0 with a present token (0x3)
Created private key:
Private Key Object; EC
  label:
  Usage: decrypt, sign, unwrap
warning: PKCS11 function C_GetAttributeValue(ALWAYS_AUTHENTICATE) failed: rv = CKR_ATTRIBUTE_TYPE_INVALID (0x12)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: opensc 0.15.0-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-47.68-generic 4.4.24
Uname: Linux 4.4.0-47-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Dec 1 09:31:46 2016
InstallationDate: Installed on 2016-07-07 (146 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: opensc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dominik Reusser (d-reusser) wrote :
Revision history for this message
David Ward (dpward) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. The issue that you reported is one that should be reproducible with the live environment of the Desktop ISO of the development release. It would help us greatly if you could test with it so we can work on getting it fixed in the next release of Ubuntu. You can find out more about the development release at http://www.ubuntu.com/testing/. Thanks again and we appreciate your help.

David Ward (dpward)
Changed in opensc (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for opensc (Ubuntu) because there has been no activity for 60 days.]

Changed in opensc (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.