Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endianness of options field in CHANNEL_DEF #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JiajunW
Copy link

@JiajunW JiajunW commented Feb 21, 2019

No description provided.

@JiajunW
Copy link
Author

JiajunW commented Feb 21, 2019

The options field should be little-endian.

The example packet is recorded in MS-RDPBCGR section 4.1.3:

03 00 00 00 -> TS_UD_CS_NET::channelCount = 3
72 64 70 64 72 00 00 00 -> CHANNEL_DEF::name = "rdpdr"
00 00 80 80 -> CHANNEL_DEF::options = 0x80800000
0x80800000
= 0x80000000 | 0x00800000
= CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_COMPRESS_RDP
63 6c 69 70 72 64 72 00 -> CHANNEL_DEF::name = "cliprdr"
00 00 a0 c0 -> CHANNEL_DEF::options = 0xc0a00000
0xc0a00000
= 0x80000000 |
 0x40000000 |
 0x00800000 |
 0x00200000
= CHANNEL_OPTION_INITIALIZED |
 CHANNEL_OPTION_ENCRYPT_RDP |
 CHANNEL_OPTION_COMPRESS_RDP |
 CHANNEL_OPTION_SHOW_PROTOCOL
72 64 70 73 6e 64 00 00 -> CHANNEL_DEF::name = "rdpsnd"
00 00 00 c0 -> CHANNEL_DEF::options = 0xc0000000
0xc0000000
= 0x80000000 | 0x40000000
= CHANNEL_OPTION_INITIALIZED |
 CHANNEL_OPTION_ENCRYPT_RDP

@CendioOssman
Copy link
Member

Hmm... Odd. The code has been like this for ages an things have worked fine. Have you seen any practical issues?

We would need to re-test these channels to make sure such a change doesn't break anything.

@JiajunW
Copy link
Author

JiajunW commented Mar 4, 2019

I haven't see any issues right now. I just analyze the network trace and found the endianness is incorrect.

@CendioOssman
Copy link
Member

Alright, great.

I'm afraid I don't have time to test this right now. But I'll leave this PR open and hopefully someone can verify things and we can merge it.

@ThomasAdam
Copy link

Hi @JiajunW,

This change makes sense to me given the packet capture is indicating a change in endianness. Have you been able to test this sufficiently that you've not seen any negative impact?

@JiajunW
Copy link
Author

JiajunW commented Aug 7, 2020

No I have not done a thorough testing. But I have not seen anything broken by this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants