gamringer/php-pkcs11

0160-rsa-encrypt-pkcs - segfault with HSM

Closed this issue · 5 comments

While running the test 0160 with a HSM, we get the following segfault:

Program received signal SIGSEGV, Segmentation fault.
0x000055555582e334 in zend_std_write_property ()
(gdb) bt
#0  0x000055555582e334 in zend_std_write_property ()
#1  0x00005555557fd0be in add_property_zval_ex ()
#2  0x00007ffff56cc13e in zim_Session_generateKeyPair (execute_data=<optimized out>, return_value=0x7ffff5414290)
    at php-pkcs11/pkcs11session.c:387
#3  0x0000555555881af5 in execute_ex ()
#4  0x000055555588314b in zend_execute ()
#5  0x00005555557fa1ec in zend_execute_scripts ()
#6  0x0000555555799ed0 in php_execute_script ()
#7  0x0000555555885282 in ?? ()
#8  0x0000555555661938 in ?? ()
#9  0x00007ffff764f0b3 in __libc_start_main (main=0x555555661530, argc=68, argv=0x7fffffffde78, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffde68) at ../csu/libc-start.c:308
#10 0x0000555555661ade in _start ()

We should also check for function availability in relevant tests

I have a WIP patch, first I need to apply some checks.

I look forward to it. Make sure you rebase it on top of the latest master.

Of course, it has to be rebased after so many churns.

I guess this issue can be closed once the previous pull request regarding C_GenerateKeyPair() will be merged.