Closed grawity closed 8 months ago
same on my end. specifying the -b parameter works
❯ ssh-tpm-keygen
2024/02/27 18:34:59 invalid ecdsa key length: TPM does not support 0 bits
❯ ssh-tpm-keygen -b 256
Generating a sealed public/private ecdsa key pair.
Enter file in which to save the key (/home/XXXX/.ssh/id_ecdsa):
Maybe a small upgrade guide should be placed in the release notes for users who has already used the other keys =) for me works removing the .tpm file, reimport with ssh-tpm-keygen --import id_ecdsa -b 256
@FLX-0x00 Lol, what? Does that actually work?
Yes. was wondering what if i specify my own key leng....yep. works. maybe there is also something wrong with the parser. =) happy to help
Because the error was the same in the import i tried it out with -b and now I can use ssh again =) I converted all my ssh stuff to this tool, so I was really in a rush to get this running again :D
That shouldn't work. The --import
code literally parses the secret parts of the key out of an existing ssh formatted private key.
I suspect you are accidentally importing your old id_ecdsa
key.
.rw-r--r-- 505 xxx xxx 27 Feb 18:56 id_ecdsa
❯ file id_ecdsa
id_ecdsa: OpenSSH private key
❯ ssh-tpm-keygen --import id_ecdsa
2024/02/27 18:56:05 invalid ecdsa key length: TPM does not support 0 bits
❯ ssh-tpm-keygen --import id_ecdsa -b 256
Sealing an existing public/private ecdsa key pair.
I added my "old" key again yes. The key is ecdsa-sha2-nistp256
That shouldn't work. The
--import
code literally parses the secret parts of the key out of an existing ssh formatted private key.I suspect you are accidentally importing your old
id_ecdsa
key.
Of course I have made a backup before sealing the key with the .tpm extension. So I removed the old .tpm file, and imported my backup key again. now the "new" sealed key works with the agent. Was it wrong?
Of course I have made a backup before sealing the key with the .tpm extension. So I removed the old .tpm file, and imported my backup key again. now the "new" sealed key works with the agent. Was it wrong?
No it only confused me how you where re-importing the key. But all good.
Hard to hear from the owner of the repo but hey, if you need anything that helps on debugging this stuff just hit me here. I will provide everything except the armored output of my private key ;)
Docs say that ECDSA P-256 is the default if neither
-t
nor-b
is not specified, but that doesn't seem to be the case:Specifying
-t rsa
without-b
seems to correctly generate a 2048-bit RSA key.