pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix SetClientEncoding() to maintain a cache of previously
6+ messages / 4 participants
[nested] [flat]

Commits from this thread:
  2024-03-22 697f8d266c  Revert "Add notBefore and notAfter to SSL cert info display"
* pgsql: Fix SetClientEncoding() to maintain a cache of previously
@ 2009-04-02 17:30 Tom Lane <tgl@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: tgl@postgresql.org @ 2009-04-02 17:30 UTC (permalink / raw)
  To: pgsql-committers

Log Message:
-----------
Fix SetClientEncoding() to maintain a cache of previously selected encoding
conversion functions.  This allows transaction rollback to revert to a
previous client_encoding setting without doing fresh catalog lookups.
I believe that this explains and fixes the recent report of "failed to commit
client_encoding" failures.

This bug is present in 8.3.x, but it doesn't seem prudent to back-patch
the fix, at least not till it's had some time for field testing in HEAD.

In passing, remove SetDefaultClientEncoding(), which was used nowhere.

Modified Files:
--------------
    pgsql/src/backend/utils/mb:
        mbutils.c (r1.82 -> r1.83)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/mbutils.c?r1=1.82&r2=1.83)
    pgsql/src/include/mb:
        pg_wchar.h (r1.87 -> r1.88)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/mb/pg_wchar.h?r1=1.87&r2=1.88)




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

* pgsql: Add notBefore and notAfter to SSL cert info display
@ 2023-07-20 15:10 Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Daniel Gustafsson @ 2023-07-20 15:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add notBefore and notAfter to SSL cert info display

This adds the X509 attributes notBefore and notAfter to sslinfo
as well as pg_stat_ssl to allow verifying and identifying the
validity period of the current client certificate.

Author: Cary Huang <cary.huang@highgo.ca>
Discussion: https://postgr.es/m/182b8565486.10af1a86f158715.2387262617218380588@highgo.ca

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/75ec5e7bec700577d39d653c316e3ae6c505842c

Modified Files
--------------
contrib/sslinfo/Makefile                    |  2 +-
contrib/sslinfo/meson.build                 |  1 +
contrib/sslinfo/sslinfo--1.2--1.3.sql       | 12 ++++++
contrib/sslinfo/sslinfo.c                   | 67 +++++++++++++++++++++++++++++
contrib/sslinfo/sslinfo.control             |  2 +-
doc/src/sgml/monitoring.sgml                | 20 +++++++++
doc/src/sgml/sslinfo.sgml                   | 30 +++++++++++++
src/backend/catalog/system_views.sql        |  4 +-
src/backend/libpq/be-secure-openssl.c       | 47 ++++++++++++++++++++
src/backend/utils/activity/backend_status.c |  2 +
src/backend/utils/adt/pgstatfuncs.c         | 46 ++++++++++++--------
src/include/catalog/catversion.h            |  2 +-
src/include/catalog/pg_proc.dat             |  6 +--
src/include/libpq/libpq-be.h                |  2 +
src/include/utils/backend_status.h          |  2 +
src/test/regress/expected/rules.out         | 12 +++---
src/test/ssl/t/001_ssltests.pl              |  8 ++--
src/test/ssl/t/003_sslinfo.pl               | 14 ++++++
18 files changed, 246 insertions(+), 33 deletions(-)



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

* pgsql: Add notBefore and notAfter to SSL cert info display
@ 2024-03-22 20:30 Daniel Gustafsson <dgustafsson@postgresql.org>
  2024-03-22 21:17 ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 6+ messages in thread

From: Daniel Gustafsson @ 2024-03-22 20:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add notBefore and notAfter to SSL cert info display

This adds the X509 attributes notBefore and notAfter to sslinfo
as well as pg_stat_ssl to allow verifying and identifying the
validity period of the current client certificate. OpenSSL has
APIs for extracting notAfter and notBefore, but they are only
supported in recent versions so we have to calculate the dates
by hand in order to make this work for the older versions of
OpenSSL that we still support.

Original patch by Cary Huang with additional hacking by Jacob
and myself.

Author: Cary Huang <cary.huang@highgo.ca>
Co-author: Jacob Champion <jacob.champion@enterprisedb.com>
Co-author: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/182b8565486.10af1a86f158715.2387262617218380588@highgo.ca

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6acb0a628eccab8764e0306582c2b7e2a1441b9b

Modified Files
--------------
contrib/sslinfo/Makefile                    |  2 +-
contrib/sslinfo/meson.build                 |  1 +
contrib/sslinfo/sslinfo--1.2--1.3.sql       | 12 ++++
contrib/sslinfo/sslinfo.c                   | 95 +++++++++++++++++++++++++++++
contrib/sslinfo/sslinfo.control             |  2 +-
doc/src/sgml/monitoring.sgml                | 20 ++++++
doc/src/sgml/sslinfo.sgml                   | 30 +++++++++
src/backend/catalog/system_views.sql        |  4 +-
src/backend/libpq/be-secure-openssl.c       | 78 +++++++++++++++++++++++
src/backend/utils/activity/backend_status.c |  2 +
src/backend/utils/adt/pgstatfuncs.c         | 46 ++++++++------
src/include/catalog/catversion.h            |  2 +-
src/include/catalog/pg_proc.dat             |  6 +-
src/include/libpq/libpq-be.h                |  2 +
src/include/utils/backend_status.h          |  3 +
src/test/regress/expected/rules.out         | 12 ++--
src/test/ssl/t/001_ssltests.pl              | 10 +--
src/test/ssl/t/003_sslinfo.pl               | 14 +++++
src/tools/pgindent/typedefs.list            |  1 +
19 files changed, 308 insertions(+), 34 deletions(-)



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

* Re: pgsql: Add notBefore and notAfter to SSL cert info display
  2024-03-22 20:30 pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <dgustafsson@postgresql.org>
@ 2024-03-22 21:17 ` Daniel Gustafsson <daniel@yesql.se>
  2024-03-22 21:46   ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Jacob Champion <jacob.champion@enterprisedb.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Daniel Gustafsson @ 2024-03-22 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org; +Cc: kolioffx+pgbf@gmail.com, Jacob Champion <jacob.champion@enterprisedb.com>

> On 22 Mar 2024, at 21:30, Daniel Gustafsson <dgustafsson@postgresql.org> wrote:
> 
> Add notBefore and notAfter to SSL cert info display

plover running OpenBSD 6.9 is unhappy since apparently LibreSSL only added ASN
time diffing in the OpenBSD 7.1 release.  Version 6.9 is out of support from
OpenBSD with 7.4 being the latest (they support 2 releases), but I guess we are
more forgiving in what we support?  (We have only defined a minimum supported
version of OpenSSL, we should do the same for LibreSSL since it's right now
unclear what we support and for how long.) Adding checks for symbol existence
in autoconf/meson seems like the only way forward for now.

--
Daniel Gustafsson






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

* Re: pgsql: Add notBefore and notAfter to SSL cert info display
  2024-03-22 20:30 pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <dgustafsson@postgresql.org>
  2024-03-22 21:17 ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <daniel@yesql.se>
@ 2024-03-22 21:46   ` Jacob Champion <jacob.champion@enterprisedb.com>
  2024-03-22 21:53     ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 1 reply; 6+ messages in thread

From: Jacob Champion @ 2024-03-22 21:46 UTC (permalink / raw)
  To: Daniel Gustafsson <daniel@yesql.se>; +Cc: pgsql-committers@lists.postgresql.org; kolioffx+pgbf@gmail.com

On Fri, Mar 22, 2024 at 2:17 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> (We have only defined a minimum supported
> version of OpenSSL, we should do the same for LibreSSL since it's right now
> unclear what we support and for how long.)

+1

> Adding checks for symbol existence
> in autoconf/meson seems like the only way forward for now.

Yeah... were you thinking we'd just return a zero timestamptz and let
those columns be NULL?

--Jacob





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

* Re: pgsql: Add notBefore and notAfter to SSL cert info display
  2024-03-22 20:30 pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <dgustafsson@postgresql.org>
  2024-03-22 21:17 ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <daniel@yesql.se>
  2024-03-22 21:46   ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Jacob Champion <jacob.champion@enterprisedb.com>
@ 2024-03-22 21:53     ` Daniel Gustafsson <daniel@yesql.se>
  0 siblings, 0 replies; 6+ messages in thread

From: Daniel Gustafsson @ 2024-03-22 21:53 UTC (permalink / raw)
  To: Jacob Champion <jacob.champion@enterprisedb.com>; +Cc: pgsql-committers@lists.postgresql.org; kolioffx+pgbf@gmail.com

> On 22 Mar 2024, at 22:46, Jacob Champion <jacob.champion@enterprisedb.com> wrote:
> 
> On Fri, Mar 22, 2024 at 2:17 PM Daniel Gustafsson <daniel@yesql.se> wrote:
>> (We have only defined a minimum supported
>> version of OpenSSL, we should do the same for LibreSSL since it's right now
>> unclear what we support and for how long.)
> 
> +1
> 
>> Adding checks for symbol existence
>> in autoconf/meson seems like the only way forward for now.
> 
> Yeah... were you thinking we'd just return a zero timestamptz and let
> those columns be NULL?

I don't think we have any other options really. 

For now I will revert this to make the buildfarm green again.

--
Daniel Gustafsson






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


end of thread, other threads:[~2024-03-22 21:53 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-04-02 17:30 pgsql: Fix SetClientEncoding() to maintain a cache of previously Tom Lane <tgl@postgresql.org>
2023-07-20 15:10 pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <dgustafsson@postgresql.org>
2024-03-22 20:30 pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <dgustafsson@postgresql.org>
2024-03-22 21:17 ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <daniel@yesql.se>
2024-03-22 21:46   ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Jacob Champion <jacob.champion@enterprisedb.com>
2024-03-22 21:53     ` Re: pgsql: Add notBefore and notAfter to SSL cert info display Daniel Gustafsson <daniel@yesql.se>

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