From 883af074543631fa286babcef15502645cb533cc Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Fri, 26 Jul 2024 16:44:05 +0200 Subject: [PATCH] fix(core): remove `handshake hash` from `auth_data` in transport noise messages [no changelog] --- core/src/trezor/wire/thp/channel.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/src/trezor/wire/thp/channel.py b/core/src/trezor/wire/thp/channel.py index ae1f41368..6c1a30f34 100644 --- a/core/src/trezor/wire/thp/channel.py +++ b/core/src/trezor/wire/thp/channel.py @@ -183,15 +183,13 @@ class Channel: else: key_receive = self.channel_cache.get(CHANNEL_KEY_RECEIVE) nonce_receive = self.channel_cache.get_int(CHANNEL_NONCE_RECEIVE) - auth_data = self.get_handshake_hash() assert key_receive is not None assert nonce_receive is not None - assert auth_data is not None print("Buffer before decryption:", hexlify(noise_buffer)) is_tag_valid = crypto.dec( - noise_buffer, tag, key_receive, nonce_receive, auth_data + noise_buffer, tag, key_receive, nonce_receive, b"" ) print("Buffer after decryption:", hexlify(noise_buffer)) @@ -217,13 +215,11 @@ class Channel: else: key_send = self.channel_cache.get(CHANNEL_KEY_SEND) nonce_send = self.channel_cache.get_int(CHANNEL_NONCE_SEND) - auth_data = self.get_handshake_hash() assert key_send is not None assert nonce_send is not None - assert auth_data is not None - tag = crypto.enc(noise_buffer, key_send, nonce_send, auth_data) + tag = crypto.enc(noise_buffer, key_send, nonce_send, b"") self.channel_cache.set_int(CHANNEL_NONCE_SEND, nonce_send + 1) if __debug__: