Bug 1278323
Summary: | Can't load pkcs11 engine into openssl | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Denis Kostousov <denis.kostousov> |
Component: | libp11 | Assignee: | Kalev Lember <klember> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 23 | CC: | denis.kostousov, dwmw2, klember, nmavrogi, tmraz |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libp11-0.3.0-1.fc23 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-11-17 15:51:41 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: | |
Embargoed: |
Description
Denis Kostousov
2015-11-05 09:27:35 UTC
Or, put more simply since ENGINE_pkcs11 now does the right thing and automatically loads the correct PKCS#11 modules so you shouldn't need all the complex configuration: $ openssl engine pkcs11 139716144940920:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:187:filename(/usr/lib64/openssl/engines/libpkcs11.so): /lib64/libp11.so.2: undefined symbol: lt_dlopen 139716144940920:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:232: 139716144940920:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:465: 139716144940920:error:2606A074:engine routines:ENGINE_by_id:no such engine:eng_list.c:391:id=pkcs11 If I fix that with the following patch, I still get a failure: [dwoodhou@i7 f23]$ openssl engine pkcs11 140288589592440:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:187:filename(/usr/lib64/openssl/engines/libpkcs11.so): /lib64/libp11.so.2: undefined symbol: LOCK --- libp11-0.2.8/src/Makefile.am~ 2015-11-05 10:55:08.656434013 +0000 +++ libp11-0.2.8/src/Makefile.am 2015-11-05 10:58:01.151574773 +0000 @@ -17,7 +17,7 @@ else dist_noinst_DATA = versioninfo.rc endif libp11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS) $(LTLIB_CFLAGS) -libp11_la_LIBADD = $(OPENSSL_LIBS) +libp11_la_LIBADD = $(OPENSSL_LIBS) $(LTLIB_LIBS) libp11_la_LDFLAGS = $(AM_LDFLAGS) \ -version-info @LIBP11_LT_CURRENT@:@LIBP11_LT_REVISION@:@LIBP11_LT_AGE@ \ I'll bring libp11 0.3.0 and engine_pkcs11 0.2.0 to f23, which fix both issues. libp11-0.3.0-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-b911ae7eb4 I had to install softhsm to build that. And now... [root@i7 f23]# openssl engine pkcs11 -t (pkcs11) pkcs11 engine [ available ] Segmentation fault (core dumped) Program received signal SIGSEGV, Segmentation fault. 0x00007ffff4754840 in ?? () (gdb) bt #0 0x00007ffff4754840 in ?? () #1 0x00007ffff6e192f2 in CRYPTO_THREADID_current () from /lib64/libcrypto.so.10 #2 0x00007ffff6ec578c in ERR_print_errors_cb () from /lib64/libcrypto.so.10 #3 0x000000000045ed18 in engine_main () #4 0x000000000041a458 in do_cmd () #5 0x000000000041a0c7 in main () Is some library registering thread locking functions with OpenSSL and failing to unregister them when it gets unloaded? Without SoftHSM installed, it's working (the engine can only access keys through the engine easily; certs are handled strangely by OpenSSL so we extract it first): $ p11tool --export 'pkcs11:manufacturer=piv_II;id=%01;type=cert' > cert.pem $ openssl smime -sign -engine pkcs11 -keyform engine -inkey 'pkcs11:manufacturer=piv_II;id=%01' -in libp11.spec -out signed -signer cert.pem engine "pkcs11" set. PKCS#11 token PIN: $ I was seeing something similar. Could it be related with that? https://github.com/OpenSC/libp11/commit/b2ac83353e4d51115744da96fc5a5bd00b964dd2 engine_pkcs11-0.2.0-1.fc23, libp11-0.3.0-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update engine_pkcs11 libp11' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-b911ae7eb4 Denis could you verify that the update works for you? It's works in my case engine_pkcs11-0.2.0-1.fc23, libp11-0.3.0-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. |