Skip to content
This repository was archived by the owner on May 16, 2020. It is now read-only.
This repository was archived by the owner on May 16, 2020. It is now read-only.

ssh-keygen -D libtpm2-pk11.so returns multiple keys, how to distinguish them? #66

Description

@laanwj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions