Re: sslinfo extension - add notbefore and notafter timestamps - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: sslinfo extension - add notbefore and notafter timestamps
Date
Msg-id 60F62500-0225-4CC2-8233-1C4700452128@yesql.se
Whole thread Raw
In response to Re: sslinfo extension - add notbefore and notafter timestamps  (Jacob Champion <jacob.champion@enterprisedb.com>)
Responses Re: sslinfo extension - add notbefore and notafter timestamps
List pgsql-hackers
> On 20 Mar 2024, at 15:28, Jacob Champion <jacob.champion@enterprisedb.com> wrote:

>> +   result -= ((POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY);
>> +   return TimestampTzGetDatum(result);
>
> Is that final bare subtraction able to wrap around for dates far in the past?

We are subtracting 30 years from a calculation that we know didnt overflow, so
I guess if the certificate notBefore (the notAfter cannot be that early since
we wouldn't be able to connect with it) was set to early enough?  It didn't
strike me as anything above academical unless I'm thinking wrong here.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: documentation structure
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: Possibility to disable `ALTER SYSTEM`