Importing SSH Keys strips comments from public key disabling certain workflows

zyreph
zyreph
Community Member

When a SSH Key-Pair is imported (by file or via clipboard), the comment at the end of the public key is always removed. This behavior has been brought up by a couple of threads in the forum already, but sadly no attempts on fixing the issue have been made so far.

As far as i can see, the removal is due to the current implementation using solely the private key and retrieving the public key afterwards from said private key. As the comment is not part of the actual authorization, it obviously cannot be reconstructed by just the private key.

This behavior works fine for most use cases, but fails in certain scenarios as some services use the comment inside the public key as part of their authorization process.
This is done to ensure that the key actually belongs to e.g. the email of the account which the person tries to prove ownership for. Such a service is the open source git provider Gitea; an explanation on why they do their authorization for commit signing like this can be read in this github issue.

With the current implementation, use cases like the the one described above are not possible to be managed by 1Password.
Therefore I would suggest, that a new input field is added, which allows to set the comment of the public key while saving / after importing the key-pair. As the comment is not part of the canonical authorization process, users cannot compromise the integrity of their key-pairs with an input field like that, and the actual import logic does not have to be changed.
This would enable to import key-pairs without any stripping while maintaining the current implementation as much as possible.

I also think, that a small notice should be added, that informs the user of the standard stripping of the comment in public keys, as this is not directly visible / clear to the end user in the current implementation.


1Password Version: 8.10.40
Extension Version: 2.27.1
OS Version: Linux
Browser: Firefox