Foxboron / ssh-tpm-agent

:computer: :key: ssh-agent for TPMs
MIT License
355 stars 20 forks source link

Fix .tpm suffix in ssh-tmp-keygen #27

Closed rafiramadhana closed 1 year ago

rafiramadhana commented 1 year ago

Resolves https://github.com/Foxboron/ssh-tpm-agent/issues/25

Tested in my local

Generating a sealed public/private ecdsa key pair.
Enter file in which to save the key (/root/.ssh/id_ecdsa): /root/.ssh/id_ecdsa_demo2.tpm
Enter pin (empty for no pin): 
Confirm pin: 
Your identification has been saved in /root/.ssh/id_ecdsa_demo2.tpm
jtagcat commented 1 year ago

The separate function and checking are not needed. Trim already checks for suffix.

image

Instead, just change line 265 to filename = strings.TrimSuffix(filenameInput, ".tpm")

Thanks for finding the spot where to make the change and testing!

rafiramadhana commented 1 year ago

The separate function and checking are not needed. Trim already checks for suffix.

image

Instead, just change line 265 to filename = strings.TrimSuffix(filenameInput, ".tpm")

Thanks for finding the spot where to make the change and testing!

updated https://github.com/Foxboron/ssh-tpm-agent/pull/27/commits/ea50a8a8ee216f703d112f8c9ca5722a4c3a828e

Foxboron commented 1 year ago

Please squash the two commits.

rafiramadhana commented 1 year ago

Please squash the two commits.

Ok, done