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

Use network byte order when encoding ipv4 address and port for Socks codecs #13427

Merged
merged 5 commits into from Jun 9, 2023

Conversation

laurentgo
Copy link
Contributor

Motivation:

Socks codecs do not always use network byte ordering when encoding/decoding socks messages resulting in connection issues

Modification:

Use BE methods to properly read/write socks messages

Result:

Fixes #13426

Motivation:

Socks encoders do not always use network byte order when encoding port
resulting in connection errors when buffer's order is little endian

Modifications:

Use ByteBufUtil.writeShortBE to make sure the right byte order is used

Result:

Socks messages are now using the right encoding.
Motivation:

Socks decoders do not always use network byte order when decoding ipv4
address and port resulting in connection errors when buffer's order is little endian

Modifications:

Add readIntBE readUnsignedShortBE to SocksCommonUtils in order to read
data properly

Result:

Socks messages are now decoded properly
@normanmaurer
Copy link
Member

@laurentgo did you sign our ICLA yet ? https://netty.io/s/icla

@laurentgo
Copy link
Contributor Author

@laurentgo did you sign our ICLA yet ? https://netty.io/s/icla

I just did

@normanmaurer normanmaurer added this to the 4.1.94.Final milestone Jun 7, 2023
@normanmaurer normanmaurer merged commit 385b288 into netty:4.1 Jun 9, 2023
14 checks passed
@laurentgo laurentgo deleted the laurentgo/fix-13426 branch June 9, 2023 15:05
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.

Socks encoder/decoder do not always follow RFC regarding port
3 participants