Closed popovec closed 1 year ago
I have currently tested the above fix and it seems that the segfault problem exists not only when using openssl 3.X. This segfault also occurs when using openssl 1.1.1n (Debian 11, openssl 1.1.1n-0+deb11u5).
I am canceling this issue, more information in #511
While viewing the test logs (cat tests/*.log), I accidentally found "Segmentation fault".
The problem can be easily reproduced (openssl version 3.0.9):
Here is the relevant part of log:
As a first fix, I suggest fixing the test:
It seems that there was a similar problem with freeing memory, more can be read from the comments in
src/eng_front.c
https://github.com/OpenSC/libp11/blob/6c96847f1f52a5ccc76e8f8d14820cc4d6af1ecb/src/eng_front.c#L116C1-L126C1 https://github.com/OpenSC/libp11/blob/6c96847f1f52a5ccc76e8f8d14820cc4d6af1ecb/src/eng_front.c#L153C1-L166C1
I think for openssl 3.x it is also convenient to omit the
ctx_finish(ctx);
call. So I propose the following modification:If no one suggests a better solution, I will prepare a PR.