diff --git a/service-providers/authenticator/src/mixnet_listener.rs b/service-providers/authenticator/src/mixnet_listener.rs index 8fbd3e2b29..0c4d8dfb0f 100644 --- a/service-providers/authenticator/src/mixnet_listener.rs +++ b/service-providers/authenticator/src/mixnet_listener.rs @@ -316,6 +316,7 @@ impl MixnetListener { .filter(|r| r.1.is_none()) .choose(&mut thread_rng()) .ok_or(AuthenticatorError::NoFreeIp)?; + let private_ips = *private_ip_ref.0; // mark it as used, even though it's not final *private_ip_ref.1 = Some(SystemTime::now()); let gateway_data = GatewayClient::new( @@ -337,11 +338,12 @@ impl MixnetListener { v1::response::AuthenticatorResponse::new_pending_registration_success( v1::registration::RegistrationData { nonce: registration_data.nonce, - gateway_data: v1::GatewayClient { - pub_key: gateway_data.pub_key, - private_ip: gateway_data.private_ips.ipv4.into(), - mac: v1::ClientMac::new(gateway_data.mac.to_vec()), - }, + gateway_data: v1::registration::GatewayClient::new( + self.keypair().private_key(), + remote_public.inner(), + private_ips.ipv4.into(), + nonce, + ), wg_port: registration_data.wg_port, }, request_id, @@ -356,7 +358,12 @@ impl MixnetListener { v2::response::AuthenticatorResponse::new_pending_registration_success( v2::registration::RegistrationData { nonce: registration_data.nonce, - gateway_data: registration_data.gateway_data.into(), + gateway_data: v2::registration::GatewayClient::new( + self.keypair().private_key(), + remote_public.inner(), + private_ips.ipv4.into(), + nonce, + ), wg_port: registration_data.wg_port, }, request_id, @@ -371,7 +378,12 @@ impl MixnetListener { v3::response::AuthenticatorResponse::new_pending_registration_success( v3::registration::RegistrationData { nonce: registration_data.nonce, - gateway_data: registration_data.gateway_data.into(), + gateway_data: v3::registration::GatewayClient::new( + self.keypair().private_key(), + remote_public.inner(), + private_ips.ipv4.into(), + nonce, + ), wg_port: registration_data.wg_port, }, request_id,