I generated and made persistent a TPM key according to the steps in the wiki.
However, it turns out that this TPM already contains a few different keys these are also listed;
$ tpm2_listpersistent
- { persistent-handle: 0x81000001, key-alg: rsa, hash-alg: sha256, object-attr: fixedtpm|fixedparent|sensitivedataorigin|userwithauth|noda|restricted|decrypt }
- { persistent-handle: 0x81000002, key-alg: rsa, hash-alg: sha256, object-attr: fixedtpm|fixedparent|sensitivedataorigin|userwithauth|noda|restricted|sign }
- { persistent-handle: 0x81010001, key-alg: rsa, hash-alg: sha256, object-attr: fixedtpm|fixedparent|sensitivedataorigin|adminwithpolicy|restricted|decrypt }
- { persistent-handle: 0x81010010, key-alg: rsa, hash-alg: sha256, object-attr: fixedtpm|fixedparent|sensitivedataorigin|userwithauth|decrypt|sign }
$ ssh-keygen -D libtpm2-pk11.so
ssh-rsa AAAAB3N...
ssh-rsa AAAAB3N...
ssh-rsa AAAAB3N...
ssh-rsa AAAAB3N...
The keys have no identifiers at the end, so I cannot distinguish them. However only the first of these keys (I assume this is the one I generated for the purpose, 0x81010010) actually works with ssh. The others, if used, give an error at connection time:
C_Sign failed: 5
sign_and_send_pubkey: signing failed: error in libcrypto
Which makes sense, as they have different policies.
I generated and made persistent a TPM key according to the steps in the wiki.
However, it turns out that this TPM already contains a few different keys these are also listed;
The keys have no identifiers at the end, so I cannot distinguish them. However only the first of these keys (I assume this is the one I generated for the purpose, 0x81010010) actually works with ssh. The others, if used, give an error at connection time:
Which makes sense, as they have different policies.