tpm2-software / tpm2-tools

The source repository for the Trusted Platform Module (TPM2.0) tools
https://tpm2-software.github.io
707 stars 377 forks source link

tpm2_createek works with formats 'tss' and 'tpmt' but with not 'der' or 'pem' #3417

Closed mike-extr closed 1 month ago

mike-extr commented 1 month ago

Execution of the 'tpm2_createek' command (version 5.5) works when I specify format as tss or tpmt, but not when specifying pem or der. The pem and der formats used to work for me when using tools version 4.1.3.

bash-5.1# tpm2_createek --version tool="tpm2_createek" version="5.5" tctis="libtss2-tctildr" tcti-default=tcti-abrmd bash-5.1# openssl version
OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)

bash-5.1# tpm2_createek --key-algorithm rsa --ek-context ek.ctx --public ek_tss.pub --tcti device --format tss

bash-5.1# tpm2_createek --key-algorithm rsa --ek-context ek.ctx --public ek_tpmt.pub --tcti device --format tpmt bash-5.1# tpm2_createek --key-algorithm rsa --ek-context ek.ctx --public ek_pem.pub --tcti device --format pem ERROR: Failed to create a RSA public key: error:00000000:lib(0)::reason(0) ERROR: Unable to run tpm2_createek bash-5.1# tpm2_createek --key-algorithm rsa --ek-context ek.ctx --public ek_der.pub --tcti device --format der ERROR: Failed to create a RSA public key: error:00000000:lib(0)::reason(0) ERROR: Unable to run tpm2_createek
mike-extr commented 1 month ago

This might be due to a compile time error on my side (wrong OpenSSL version specified?) or because I have FIPS mode enabled. Will post an update when I more more.

mike-extr commented 1 month ago

This was a problem with how I built tpm2tools. Nothing to fix here.