tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
150 stars 100 forks source link

ECDSA operations fails #261

Open jingkang99 opened 2 years ago

jingkang99 commented 2 years ago

creates an ECDSA key using the TPM, signs a data file using the TPM and validates the signature:

tpm2tss-genkey -a ecdsa mykey OK

openssl pkeyutl -engine tpm2tss -keyform engine -inkey mykey -sign -in mydata -out mysig engine "tpm2tss" set. Public Key operation error 140354988619072:error:8007806B:tpm2-tss-engine:ecdsa_sign:Unknown padding scheme requested:src/tpm2-tss-engine-ecc.c:374: 140354988619072:error:8007406F:tpm2-tss-engine:esys_ctx_free:Some unknown error occurred:src/tpm2-tss-engine-common.c:106:


cat mykey

-----BEGIN TSS2 PRIVATE KEY----- MIHwBgZngQUKAQOgAwEB/wIEQAAAAQRYAFYAIwALAAQEcgAAABAAEAADABAAIJHe XjpJJKTrljljplP8NPh5CKZ6EKVJ1sfAg9R32sF2ACDoGKhJO/bqlnh0wbzcaboG xM88611ygDykygksLdfuiASBgAB+ACDRA99DXQ6ndEbXTrl3arAkrtAyPSZeH9F8 gHQd9Juz2gAQmYWAEacFreB2AKGL5DivZNUVl8jiiP9lLwn1EO7jlEelb6eySEgl LTNJlEAY0kmxFGv8q4+7Xa9ksPKmI7owM7oDx+llIULzMB2Ps3rDYBUhra1b6HpE 4l4g

AndreasFuchsTPM commented 1 year ago

This is weird. P.S. the key you posted is incomplete. Would you mind sending the complete key so I can decode it and have a look ?