stunnel4 received signal SIGILL, Illegal instruction when using PKCS11 infrastructure

Asked by Dominik Reusser

My ultimate goal is to connect stunnel to a PKCS11 HSM or SmartCard. Since the device is not available at the moment, I'm runnig tests with libsofthsm2 or opencryptoki as PKCS11 device.

I set up the software hsm by importing an existing key and certificate.

Next step is the configuration of stunnel, which looks the following way:

pid = /tmp/stunnel_hsm.pid
foreground = yes
debug = 7
output = /tmp/stunnel_hsm.log
engine=dynamic
engineCtrl=SO_PATH:/usr/lib/engines/engine_pkcs11.so
engineCtrl=ID:pkcs11
engineCtrl=LIST_ADD:1
engineCtrl=LOAD
engineCtrl=MODULE_PATH:/usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so
;engineCtrl=MODULE_PATH:libopencryptoki.so.0
engineCtrl=INIT
engineCtrl=PIN:000000
[server]
accept = 10407
exec = /home/theUser/bin/simpleServerProcess.sh
CAfile = /home/theUser/CA_file.pem
verify = 0
engineNum=1
key=id_2
cert=id_3

If I run stunnel against this configuration, I get a SIGILL with the following backtrace (in any case using either libsofthsm2 or libopencryptoki):
#0 __GI___pthread_rwlock_unlock (rwlock=0x5555557e7330) at pthread_rwlock_unlock.c:38
#1 0x00007ffff778c4b3 in CRYPTO_lock () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#2 0x00007ffff4f59b16 in PKCS11_enumerate_certs () from /usr/lib/x86_64-linux-gnu/libp11.so.2
#3 0x00007ffff51640a4 in ?? () from /usr/lib/engines/engine_pkcs11.so
#4 0x00007ffff51655f4 in ?? () from /usr/lib/engines/engine_pkcs11.so
#5 0x00007ffff78371ad in ENGINE_load_private_key () from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
#6 0x000055555556c0c8 in ?? ()
#7 0x000055555556c424 in ?? ()
#8 0x00005555555649c8 in ?? ()
#9 0x0000555555565c76 in ?? ()
#10 0x000055555556f739 in ?? ()
#11 0x000055555555c01c in ?? ()
#12 0x00007ffff6d57830 in __libc_start_main (main=0x55555555bfc0, argc=2, argv=0x7fffffffde08, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffddf8) at ../csu/libc-start.c:291
#13 0x000055555555c3c9 in ?? ()

Any further information I can provide to help debugging this?

How do I go about resolving this bug?

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu stunnel4 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.