tomaswolf commented on PR #716:
URL: https://github.com/apache/mina-sshd/pull/716#issuecomment-2768781853

   The X11 connection setup is not very well explained in the [official X11 
documentation](https://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#Connection_Setup).
 The current code does not match this documentation; obviously the 
documentation leaves out a lot of details.
   
   Some more information can be gleaned from the sources:
   
   The connection message has the format
   ```
   Offset    Number of bytes   Content
   0             1             Byte order. 'B' or 'R' for MSB first, 'l' or 'r' 
for LSB first. 'R' and 'r' indicate a remote X client.
   1             1             Padding for alignment; unused
   2             2             Major version
   4             2             Minor version
   6             2             N = length of authentication protocol name
   8             2             M = length of authentication data
   10            2             Padding for alignment, unused
   12            N             authentication protocol name 
("MIT-MAGIC-COOKIE-1"; N = 18)
   12+N          X             0 <= X <= 3; up the three padding bytes for 
alignment to 4-byte boundary
   12+N+X        M             authentication data (for MIT-MAGIC_COOKIE-1 the 
cookie in binary: M = 16)
   ```
   Followed again by 0 to 3 padding bytes to align the whole size to a multiple 
of 4. (In case of MIT-MAGIC-COOKIE-1, none.)
   
   See 
https://gitlab.freedesktop.org/xorg/xserver/-/blob/5ac0a19e7f488e8ae7e35157a3982d826e296038/os/connection.c#L492
 and 
https://gitlab.freedesktop.org/xorg/xserver/-/blob/5ac0a19e7f488e8ae7e35157a3982d826e296038/dix/dispatch.c#L3791


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to