diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ff4a5e56..7a79762d68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https:// ## [Unreleased] +## [2024.14-crunch-patched] (2024-12-17) + +- Fixes an issue to allow previously registred clients to connect to latest nym-nodes +- Fixes compatibility issues between nym-nodes and older clients + ## [2024.14-crunch] (2024-12-11) - Merge/release/2024.14-crunch ([#5242]) diff --git a/nym-node/Cargo.toml b/nym-node/Cargo.toml index 897a70cb0c..6908bcd023 100644 --- a/nym-node/Cargo.toml +++ b/nym-node/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "nym-node" -version = "1.2.0" +version = "1.2.1" authors.workspace = true repository.workspace = true homepage.workspace = true diff --git a/service-providers/authenticator/src/mixnet_listener.rs b/service-providers/authenticator/src/mixnet_listener.rs index 0c4d8dfb0f..1209c4cd17 100644 --- a/service-providers/authenticator/src/mixnet_listener.rs +++ b/service-providers/authenticator/src/mixnet_listener.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use std::{ + net::IpAddr, sync::Arc, time::{Duration, SystemTime}, }; @@ -11,7 +12,9 @@ use crate::{error::AuthenticatorError, peer_manager::PeerManager}; use defguard_wireguard_rs::net::IpAddrMask; use defguard_wireguard_rs::{host::Peer, key::Key}; use futures::StreamExt; -use nym_authenticator_requests::latest::registration::RegistrationData; +use nym_authenticator_requests::{ + latest::registration::RegistrationData, v4::registration::IpPair, +}; use nym_authenticator_requests::{ latest::registration::{GatewayClient, PendingRegistrations, PrivateIPs}, traits::{ @@ -233,25 +236,24 @@ impl MixnetListener { let peer = self.peer_manager.query_peer(remote_public).await?; if let Some(peer) = peer { - let private_ipv4 = peer + let allowed_ipv4 = peer .allowed_ips .iter() .find_map(|ip_mask| match ip_mask.ip { std::net::IpAddr::V4(ipv4_addr) => Some(ipv4_addr), _ => None, - }); - let private_ipv6 = peer + }) + .ok_or(AuthenticatorError::InternalError( + "there should be one private IPv4 in the list".to_string(), + ))?; + let allowed_ipv6 = peer .allowed_ips .iter() .find_map(|ip_mask| match ip_mask.ip { std::net::IpAddr::V6(ipv6_addr) => Some(ipv6_addr), _ => None, - }); - let (Some(allowed_ipv4), Some(allowed_ipv6)) = (private_ipv4, private_ipv6) else { - return Err(AuthenticatorError::InternalError( - "there should be one private IP pair in the list".to_string(), - )); - }; + }) + .unwrap_or(IpPair::from(IpAddr::from(allowed_ipv4)).ipv6); let bytes = match AuthenticatorVersion::from(protocol) { AuthenticatorVersion::V1 => v1::response::AuthenticatorResponse::new_registered( v1::registration::RegistredData {