diff --git a/crates/ironrdp-connector/src/channel_connection.rs b/crates/ironrdp-connector/src/channel_connection.rs index c6fcd7d1b..9e917a68d 100644 --- a/crates/ironrdp-connector/src/channel_connection.rs +++ b/crates/ironrdp-connector/src/channel_connection.rs @@ -173,11 +173,29 @@ impl Sequence for ChannelConnectionSequence { debug!(message = ?channel_join_confirm, "Received"); - if channel_join_confirm.initiator_id != user_channel_id - || channel_join_confirm.channel_id != channel_join_confirm.requested_channel_id - || channel_join_confirm.channel_id != channel_id - { - return Err(general_err!("received bad MCS Channel Join Confirm")); + if channel_join_confirm.initiator_id != user_channel_id { + warn!( + channel_join_confirm.initiator_id, + user_channel_id, "Inconsistent initiator ID for MCS Channel Join Confirm", + ) + } + + if channel_id != channel_join_confirm.requested_channel_id { + return Err(reason_err!( + "ChannelJoinConfirm", + "unexpected requested_channel_id in MCS Channel Join Confirm: received {}, got {}", + channel_id, + channel_join_confirm.requested_channel_id, + )); + } + + if channel_id != channel_join_confirm.channel_id { + return Err(reason_err!( + "ChannelJoinConfirm", + "unexpected channel_id in MCS Channel Join Confirm: received {}, got {}", + channel_id, + channel_join_confirm.channel_id, + )); } let next_index = index.checked_add(1).unwrap(); diff --git a/crates/ironrdp-connector/src/connection.rs b/crates/ironrdp-connector/src/connection.rs index 364522415..051f65925 100644 --- a/crates/ironrdp-connector/src/connection.rs +++ b/crates/ironrdp-connector/src/connection.rs @@ -348,13 +348,13 @@ impl Sequence for ClientConnector { debug!(?static_channel_ids, io_channel_id); - let joined: Vec<_> = self + let zipped: Vec<_> = self .static_channels .type_ids() .zip(static_channel_ids.iter().copied()) .collect(); - joined.into_iter().for_each(|(channel, channel_id)| { + zipped.into_iter().for_each(|(channel, channel_id)| { self.static_channels.attach_channel_id(channel, channel_id); });