trezor-agent icon indicating copy to clipboard operation
trezor-agent copied to clipboard

Allow signing arbitrary SSH messages

Open clehner opened this issue 4 years ago • 1 comments

Hi,

Thanks for making trezor-agent!

Currently the Trezor SSH Agent closes the client connection if the payload of a signing request fails to parse as a SSH2_MSG_USERAUTH_REQUEST data structure (and/or a SSH Signature blob in #370). But the SSH agent protocol, and Trezor, allows signing arbitrary messages. This PR enables SSH signature requests to be passed through to Trezor even if they do not match the known formats. This change enables signing for other applications, such as using JSON Web Signatures and Verifiable Credentials.

clehner avatar Nov 13 '21 20:11 clehner

Hi :)

But the SSH agent protocol, and Trezor, allows signing arbitrary messages.

I agree, but we should make sure that we don't make the user vulnerable to cross-protocol attacks (as described by @agwa here):

Always be wary of repurposing cryptographic keys for a different protocol. If not done carefully, there's a risk of cross-protocol attacks. For example, if the structure of the messages signed by Git is similar to the structure of SSH protocol messages, an attacker might be able to forge Git artifacts by misappropriating the signature from an SSH transcript.

romanz avatar Nov 14 '21 07:11 romanz

Closing, since it's already supported (#411).

romanz avatar Jan 18 '23 19:01 romanz