pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro
2+ messages / 1 participants
[nested] [flat]

* pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro
@ 2020-09-28 03:48 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2020-09-28 03:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change SHA2 implementation based on OpenSSL to use EVP digest routines

The use of low-level hash routines is not recommended by upstream
OpenSSL since 2000, and pgcrypto already switched to EVP as of 5ff4a67.
Note that this also fixes a failure with SCRAM authentication when using
FIPS in OpenSSL, but as there have been few complaints about this
problem and as this causes an ABI breakage, no backpatch is done.

Author: Michael Paquier, Alessandro Gherardi
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20200924025314.GE7405@paquier.xyz
Discussion: https://postgr.es/m/20180911030250.GA27115@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e21cbb4b893b85b5f1cf203b9a77ca0d9ee671d1

Modified Files
--------------
src/common/sha2_openssl.c | 63 ++++++++++++++++++++++++++++++++++++-----------
src/include/common/sha2.h | 10 ++++----
2 files changed, 54 insertions(+), 19 deletions(-)



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

* pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro
@ 2020-12-04 01:53 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2020-12-04 01:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Change SHA2 implementation based on OpenSSL to use EVP digest routines

The use of low-level hash routines is not recommended by upstream
OpenSSL since 2000, and pgcrypto already switched to EVP as of 5ff4a67.
This takes advantage of the refactoring done in 87ae969 that has
introduced the allocation and free routines for cryptographic hashes.

Since 1.1.0, OpenSSL does not publish the contents of the cryptohash
contexts, forcing any consumers to rely on OpenSSL for all allocations.
Hence, the resource owner callback mechanism gains a new set of routines
to track and free cryptohash contexts when using OpenSSL, preventing any
risks of leaks in the backend.  Nothing is needed in the frontend thanks
to the refactoring of 87ae969, and the resowner knowledge is isolated
into cryptohash_openssl.c.

Note that this also fixes a failure with SCRAM authentication when using
FIPS in OpenSSL, but as there have been few complaints about this
problem and as this causes an ABI breakage, no backpatch is done.

Author: Michael Paquier
Reviewed-by: Daniel Gustafsson, Heikki Linnakangas
Discussion: https://postgr.es/m/20200924025314.GE7405@paquier.xyz
Discussion: https://postgr.es/m/20180911030250.GA27115@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4f48a6fbe2b28d8281dbbfa2d334fa2ed8472734

Modified Files
--------------
src/backend/replication/basebackup.c  |   8 ++-
src/backend/utils/resowner/resowner.c |  62 ++++++++++++++++
src/common/cryptohash_openssl.c       | 128 +++++++++++++++++++++-------------
src/include/utils/resowner_private.h  |   7 ++
src/tools/pgindent/typedefs.list      |   1 +
5 files changed, 157 insertions(+), 49 deletions(-)



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


end of thread, other threads:[~2020-12-04 01:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-09-28 03:48 pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro Michael Paquier <michael@paquier.xyz>
2020-12-04 01:53 pgsql: Change SHA2 implementation based on OpenSSL to use EVP digest ro Michael Paquier <michael@paquier.xyz>

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