irtimmer / tpm2-pk11

[DEPRECATED] PKCS#11 Module for TPM 2.0
BSD 2-Clause "Simplified" License
68 stars 24 forks source link

Listing ssh keys fails if TPM only supports one session #65

Closed laanwj closed 6 years ago

laanwj commented 6 years ago

My AMD laptop's TPM (kernel driver tpm_crb) only supports one session at a time.

This causes the following to fail:

ssh-keygen -D libtpm2-pk11.so
C_OpenSession failed: 5
cannot read public key from pkcs11

I checked in a debugger and the reason for this is that /dev/tpm0 is opened twice - once in C_Initialize (which works) and another time in C_OpenSession (which fails).

Not sure at which level this problem would need to be resolved, if possible at all. (I've, for now, hacked around this in a very ugly way)

irtimmer commented 6 years ago

Fixed with commit 2f0ed78f33d09b401f2392b34c12dae0152e5519

laanwj commented 6 years ago

Thanks!