Bug 1377524 - engine_pkcs11-0.4.0-2.fc24 can't read private key from pkcs token
Summary: engine_pkcs11-0.4.0-2.fc24 can't read private key from pkcs token
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: engine_pkcs11
Version: 24
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Nikos Mavrogiannopoulos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-20 02:48 UTC by Denis Kostousov
Modified: 2017-08-08 17:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 17:29:15 UTC
Type: Bug


Attachments (Terms of Use)

Description Denis Kostousov 2016-09-20 02:48:23 UTC
Description of problem:
I use rutoken-csp. With engine_pkcs11-0.2.0-2.fc24.x86_64 openssl can read private key from the token.

Command:
echo "engine -t dynamic -pre SO_PATH:/usr/lib64/openssl/engines/libpkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -pre LOAD -pre MODULE_PATH:/usr/lib64/opensc-pkcs11.so
rsautl -engine pkcs11 -keyform engine -inkey slot_1-id_123456 -sign -in ./cs_pkcs11_in -out ./cs_pkcs11_out" |openssl

With engine_pkcs11-0.2.0-2.fc24.x86_64 openssl requests a pin. After upgrading to engine_pkcs11-0.4.0-2.fc24.x86_64 openssl reports about error:
OpenSSL> (dynamic) Dynamic engine loading support
[Success]: SO_PATH:/usr/lib64/openssl/engines/libpkcs11.so
[Success]: ID:pkcs11
[Success]: LIST_ADD:1
[Success]: LOAD
[Success]: MODULE_PATH:/usr/lib64/opensc-pkcs11.so
Loaded: (pkcs11) pkcs11 engine
     [ available ]
OpenSSL> engine "pkcs11" set.
Invalid slot number: 1
PKCS11_get_private_key returned NULL
cannot load Private Key from engine
140337634576248:error:26096080:engine routines:ENGINE_load_private_key:failed loading private key:eng_pkey.c:124:
unable to load Private Key
error in rsautl


Version-Release number of selected component (if applicable):
0.4.0-2.fc24

How reproducible:


Steps to Reproduce:
1. create a rsa:2048 keypair on a token (with  engine_pkcs11-0.2.0)
2. upgrade to engine_pkcs11-0.4.0
3. sign some data with above command

Actual results:
unable to load Private Key
error in rsautl

Expected results:
openssl requests a pin

Additional info:
downgrading to engine_pkcs11-0.2.0-2.fc24.x86_64 solves the problem

Comment 1 Nikos Mavrogiannopoulos 2016-09-20 07:19:03 UTC
I'd strongly suggest to report this to upstream tracker, since this is not Fedora specific. I can forward your request, but I'll be mostly delaying the process by acting as man in the middle:
https://github.com/opensc/libp11/issues

Comment 2 Denis Kostousov 2016-09-20 07:55:22 UTC
https://github.com/OpenSC/libp11/issues/104

Comment 3 Fedora End Of Life 2017-07-25 23:08:37 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 4 Fedora End Of Life 2017-08-08 17:29:15 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.