From c39d42b7ddd47adcb510edf0a845fb875c96e560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Mon, 16 Sep 2024 17:37:53 +0100 Subject: [PATCH] fixed deserialisation of updated gateway shared materials --- .../gateway-requests/src/registration/handshake/messages.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/gateway-requests/src/registration/handshake/messages.rs b/common/gateway-requests/src/registration/handshake/messages.rs index 0d3195aad5..d2f08708c1 100644 --- a/common/gateway-requests/src/registration/handshake/messages.rs +++ b/common/gateway-requests/src/registration/handshake/messages.rs @@ -177,9 +177,11 @@ impl HandshakeMessage for GatewayMaterialExchange { { // we expect to receive either: // LEGACY: x25519 pubkey + ed25519 signature ciphertext (96 bytes) - // CURRENT: x25519 pubkey + ed25519 signature ciphertext + AES256-GCM-SIV nonce (112 bytes) + // CURRENT: x25519 pubkey + ed25519 signature ciphertext (+ tag)+ AES256-GCM-SIV nonce (124 bytes) let legacy_len = x25519::PUBLIC_KEY_SIZE + ed25519::SIGNATURE_LENGTH; - let current_len = legacy_len + nonce_size::(); + let current_len = legacy_len + + nonce_size::() + + tag_size::(); if bytes.len() != legacy_len && bytes.len() != current_len { return Err(HandshakeError::MalformedResponse);