Skip to content

Commit

Permalink
rdp: do not use zero-bit bitflag
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber authored and victorjulien committed Sep 4, 2023
1 parent b235e85 commit 5bdbc1a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rust/src/rdp/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ pub enum Protocol {
// rdp-spec, section 2.2.1.1.1
bitflags! {
pub struct ProtocolFlags: u32 {
const PROTOCOL_RDP = Protocol::ProtocolRdp as u32;
//Protocol::ProtocolRdp is 0 as always supported
//and bitflags crate does not like zero-bit flags
const PROTOCOL_SSL = Protocol::ProtocolSsl as u32;
const PROTOCOL_HYBRID = Protocol::ProtocolHybrid as u32;
const PROTOCOL_RDSTLS = Protocol::ProtocolRdsTls as u32;
Expand Down Expand Up @@ -1089,7 +1090,7 @@ mod tests_negotiate_49350 {
cookie: None,
negotiation_request: Some(NegotiationRequest {
flags: NegotiationRequestFlags::empty(),
protocols: ProtocolFlags::PROTOCOL_RDP,
protocols: ProtocolFlags { bits: Protocol::ProtocolRdp as u32 },
}),
data: Vec::new(),
}),
Expand Down Expand Up @@ -1179,7 +1180,7 @@ mod tests_core_49350 {
),
client_dig_product_id: Some(String::from("")),
connection_hint: Some(ConnectionHint::ConnectionHintNotProvided),
server_selected_protocol: Some(ProtocolFlags::PROTOCOL_RDP),
server_selected_protocol: Some(ProtocolFlags { bits: Protocol::ProtocolRdp as u32 }),
desktop_physical_width: None,
desktop_physical_height: None,
desktop_orientation: None,
Expand Down

0 comments on commit 5bdbc1a

Please sign in to comment.