Magic number for SSLRequest

Started by PG Bug reporting formover 5 years ago3 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/protocol-message-formats.html
Description:

On page: https://www.postgresql.org/docs/11/protocol-message-formats.html

it says for SSLRequest packet:

Int32(80877103)
The SSL request code. The value is chosen to contain 1234 in the most
significant 16 bits, and 5679 in the least significant 16 bits.

I don't see how that works. 0x12345678 is 305,419,897.

80877103 decimal in hex is 0x04D2162F

I looked at the packet using Wireshark and it is indeed 0x4D2162F, so the
documentation is correct, except for the explanation about why this number.
It looks like an arbitrary number to me. Not that there's anything wrong
with that.

I suggest removing the sentence "The value is chosen to contain 1234 in the
most significant 16 bits, and 5679 in the least significant 16 bits." which
seems incorrect to me.

Thanks!

#2Magnus Hagander
magnus@hagander.net
In reply to: PG Bug reporting form (#1)
Re: Magic number for SSLRequest

On Fri, Sep 18, 2020 at 1:07 PM PG Doc comments form <noreply@postgresql.org>
wrote:

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/protocol-message-formats.html
Description:

On page: https://www.postgresql.org/docs/11/protocol-message-formats.html

it says for SSLRequest packet:

Int32(80877103)
The SSL request code. The value is chosen to contain 1234 in the most
significant 16 bits, and 5679 in the least significant 16 bits.

I don't see how that works. 0x12345678 is 305,419,897.

80877103 decimal in hex is 0x04D2162F

It's 1234 and 5679, not 0x1234 and 0x5679. That is, it's decimal, not
hexadecimal.

0x04D2 = 1234
0x162F = 5679

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/&gt;
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/&gt;

#3Max Tardiveau
maxtardiveau@yahoo.com
In reply to: Magnus Hagander (#2)
Re: Magic number for SSLRequest

My bad -- thanks for the clarification.

— Max

Show quoted text

On Sep 18, 2020, at 4:09 AM, Magnus Hagander <magnus@hagander.net> wrote:



On Fri, Sep 18, 2020 at 1:07 PM PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/protocol-message-formats.html
Description:

On page: https://www.postgresql.org/docs/11/protocol-message-formats.html

it says for SSLRequest packet:

Int32(80877103)
The SSL request code. The value is chosen to contain 1234 in the most
significant 16 bits, and 5679 in the least significant 16 bits.

I don't see how that works. 0x12345678 is 305,419,897.

80877103 decimal in hex is 0x04D2162F

It's 1234 and 5679, not 0x1234 and 0x5679. That is, it's decimal, not hexadecimal.

0x04D2 = 1234
0x162F = 5679

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/