Open
Description
Rationale
New Trezor devices will use a new session-based Trezor-Host Protocol with encrypted channels. For HWI to support such devices, changes in trezorlib
are necessary. Furthermore, to avoid a new handshake for each command, information about the connection needs to be temporarily stored (encryption and decryption keys, nonces, synchronization bits, channel id). Optionally, Trezor can issue a long-term pairing credential to avoid repeated pairing.
Brief description of the new protocol
Handshake, encryption:
- Handshake is based on the XX handshake pattern as specified in Noise Protocol Framework. With a modification that instead of using Trezor's public static key directly, a masked key is used:
trezor_masked_static_pubkey = X25519(SHA-256(trezor_static_pubkey || trezor_ephemeral_pubkey), trezor_static_pubkey)
. - Elliptic curve Curve25519, function X25519, and key pair generation are specified in RFC 7748.
- Communication is encrypted using AES-GCM.
Pairing:
- Newly, authentication of the host is mandatory. Trezor supports several pairing procedures.
- The CodeEntry (user rewrites short code from Trezor's display to the host) is implemented in
trezorlib
.
Pairing credential:
- After successful pairing/connection, the host can ask Trezor for a long-term pairing credential.
- When the host presents with a valid pairing credential during the Handshake phase, the pairing is skipped.
cc: @matejcik
Metadata
Metadata
Assignees
Labels
No labels