Hide Forgot
Description of problem: If we provide openssl PKCS#11 URI such as "pkcs11:id=%01", it is not able use the referenced object. Version-Release number of selected component (if applicable): openssl-1.1.1-8.el8.x86_64 p11-kit-0.23.14-4.el8.x86_64 How reproducible: always Steps to Reproduce: 1. set up softhsm token with private key; echo "secret" >in.txt 2. openssl pkeyutl -engine pkcs11 -keyform engine -inkey 'pkcs11:token=softhsm;id=%9b%c9%62%90%a2%46%c1%37%1b%83%4c%10%65%fa%7e%6e%ac%a9%59%ad;type=private?pin-value=123456' -encrypt -out output.bin -in in.txt 3. openssl pkeyutl -engine pkcs11 -keyform engine -inkey 'pkcs11:id=%9b%c9%62%90%a2%46%c1%37%1b%83%4c%10%65%fa%7e%6e%ac%a9%59%ad;type=private?pin-value=123456' -encrypt -out output.bin -in in.txt Actual results: 3: fails engine "pkcs11" set. Found uninitialized token Unable to check if already logged in Login failed Login to token failed, returning NULL... PKCS11_get_private_key returned NULL cannot load Private Key from engine 140399542032192:error:820780E1:PKCS#11 module:pkcs11_open_session:PKCS#11 token not recognized:p11_slot.c:156: 140399542032192:error:820780E1:PKCS#11 module:pkcs11_open_session:PKCS#11 token not recognized:p11_slot.c:156: 140399542032192:error:26096080:engine routines:ENGINE_load_private_key:failed loading private key:crypto/engine/eng_pkey.c:78: unable to load Private Key pkeyutl: Error initializing context Segmentation fault (core dumped) Expected results: both 2. and 3. pass
Upstream fix: https://github.com/OpenSC/libp11/pull/303
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:1871