pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Magic number for SSLRequest
3+ messages / 3 participants
[nested] [flat]

* Magic number for SSLRequest
@ 2020-09-18 09:22 PG Doc comments form <noreply@postgresql.org>
  2020-09-18 11:08 ` Re: Magic number for SSLRequest Magnus Hagander <magnus@hagander.net>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Doc comments form @ 2020-09-18 09:22 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: maxtardiveau@yahoo.com

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!


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Magic number for SSLRequest
  2020-09-18 09:22 Magic number for SSLRequest PG Doc comments form <noreply@postgresql.org>
@ 2020-09-18 11:08 ` Magnus Hagander <magnus@hagander.net>
  2020-09-18 18:12   ` Re: Magic number for SSLRequest Max Tardiveau <maxtardiveau@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Magnus Hagander @ 2020-09-18 11:08 UTC (permalink / raw)
  To: maxtardiveau@yahoo.com, Pg Docs <pgsql-docs@lists.postgresql.org>

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/;
 Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/;

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Magic number for SSLRequest
  2020-09-18 09:22 Magic number for SSLRequest PG Doc comments form <noreply@postgresql.org>
  2020-09-18 11:08 ` Re: Magic number for SSLRequest Magnus Hagander <magnus@hagander.net>
@ 2020-09-18 18:12   ` Max Tardiveau <maxtardiveau@yahoo.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Max Tardiveau @ 2020-09-18 18:12 UTC (permalink / raw)
  To: Magnus Hagander <magnus@hagander.net>; +Cc: Pg Docs <pgsql-docs@lists.postgresql.org>

My bad -- thanks for the clarification.

— Max


> 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/

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-09-18 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 09:22 Magic number for SSLRequest PG Doc comments form <noreply@postgresql.org>
2020-09-18 11:08 ` Magnus Hagander <magnus@hagander.net>
2020-09-18 18:12   ` Max Tardiveau <maxtardiveau@yahoo.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox