Skip to content

sign: skip ssl_util_attrs_to_evp when signing#936

Open
xzz53 wants to merge 1 commit into
tpm2-software:masterfrom
xzz53:fix-sign
Open

sign: skip ssl_util_attrs_to_evp when signing#936
xzz53 wants to merge 1 commit into
tpm2-software:masterfrom
xzz53:fix-sign

Conversation

@xzz53

@xzz53 xzz53 commented Jun 12, 2026

Copy link
Copy Markdown

Starting with this libp11 commit [1] (release 0.4.18), tpm2-pkcs + opennsl is broken. Any attempt to sign result in the following error:

$ openssl dgst -engine pkcs11 -keyform engine -sign "pkcs11:object=key-label;type=private" -sha256 -out /tmp/example.bin /dev/null
Engine "pkcs11" set.
WARNING:fapi:src/tss2-fapi/api/Fapi_List.c:228:Fapi_List_Finish() Profile of path not provisioned: /HS/SRK
ERROR:fapi:src/tss2-fapi/api/Fapi_List.c:81:Fapi_List() ErrorCode (0x00060034) Entities_List
WARNING: Listing FAPI token objects failed: "fapi:Provisioning was not executed."
Please see https://github.com/tpm2-software/tpm2-pkcs11/blob/1.10.0/docs/FAPI.md for more details
WARNING: Getting tokens from fapi backend failed.
Enter PKCS#11 token PIN for tpm-token:
ERROR: EVP_PKEY_fromdata_init: error:03000096:digital envelope routines::operation not supported for this keytype
Error signing data

This also breaks EAP_TLS auth in wpa_supplicant.

A suggested fix from issue [2] solves this problem. Specifically, we skip generation of pkey in sign_opdata_new for signing operations, since it is not actually needed in that case.

[1] OpenSC/libp11@60329e0
[2] #830

Starting with this libp11 commit [1] (release 0.4.18), tpm2-pkcs +
opennsl is broken. Any attempt to sign result in the following error:

    $ openssl dgst -engine pkcs11 -keyform engine -sign "pkcs11:object=key-label;type=private" -sha256 -out /tmp/example.bin /dev/null
    Engine "pkcs11" set.
    WARNING:fapi:src/tss2-fapi/api/Fapi_List.c:228:Fapi_List_Finish() Profile of path not provisioned: /HS/SRK
    ERROR:fapi:src/tss2-fapi/api/Fapi_List.c:81:Fapi_List() ErrorCode (0x00060034) Entities_List
    WARNING: Listing FAPI token objects failed: "fapi:Provisioning was not executed."
    Please see https://github.com/tpm2-software/tpm2-pkcs11/blob/1.10.0/docs/FAPI.md for more details
    WARNING: Getting tokens from fapi backend failed.
    Enter PKCS#11 token PIN for tpm-token:
    ERROR: EVP_PKEY_fromdata_init: error:03000096:digital envelope routines::operation not supported for this keytype
    Error signing data

This also breaks EAP_TLS auth in wpa_supplicant.

A suggested fix from issue [2] solves this problem. Specifically, we
skip generation of pkey in sign_opdata_new for signing operations,
since it is not actually needed in that case.

[1] OpenSC/libp11@60329e0
[2] tpm2-software#830

Signed-off-by: Mikhail Rudenko <xyzzy@yandex-team.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant