pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Introduce SHA1 implementations in the cryptohash infrastructure
Date: Sat, 23 Jan 2021 02:35:00 +0000
Message-ID: <E1l38lQ-0007j7-GD@gemulon.postgresql.org> (raw)

Introduce SHA1 implementations in the cryptohash infrastructure

With this commit, SHA1 goes through the implementation provided by
OpenSSL via EVP when building the backend with it, and uses as fallback
implementation KAME which was located in pgcrypto and already shaped for
an integration with a set of init, update and final routines.
Structures and routines have been renamed to make things consistent with
the fallback implementations of MD5 and SHA2.

uuid-ossp has used for ages a shortcut with pgcrypto to fetch a copy of
SHA1 if needed.  This was built depending on the build options within
./configure, so this cleans up some code and removes the build
dependency between pgcrypto and uuid-ossp.

Note that this will help with the refactoring of HMAC, as pgcrypto
offers the option to use MD5, SHA1 or SHA2, so only the second option
was missing to make that possible.

Author: Michael Paquier
Reviewed-by: Heikki Linnakangas
Discussion: https://postgr.es/m/X9HXKTgrvJvYO7Oh@paquier.xyz

Branch
------
master

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

Modified Files
--------------
configure                                        |  19 +-
configure.ac                                     |  24 +-
contrib/pgcrypto/Makefile                        |   2 +-
contrib/pgcrypto/internal.c                      |  34 +--
contrib/pgcrypto/sha1.c                          | 331 --------------------
contrib/uuid-ossp/.gitignore                     |   1 -
contrib/uuid-ossp/Makefile                       |   6 -
contrib/uuid-ossp/uuid-ossp.c                    |  27 +-
src/Makefile.global.in                           |   1 -
src/common/Makefile                              |   1 +
src/common/cryptohash.c                          |  11 +
src/common/cryptohash_openssl.c                  |   3 +
src/common/sha1.c                                | 369 +++++++++++++++++++++++
contrib/pgcrypto/sha1.h => src/common/sha1_int.h |  44 +--
src/include/common/cryptohash.h                  |   1 +
src/include/common/sha1.h                        |  19 ++
src/tools/msvc/Mkvcbuild.pm                      |   9 +-
src/tools/pgindent/typedefs.list                 |   1 +
18 files changed, 479 insertions(+), 424 deletions(-)



Message-ID: <E1l38lQ-0007j7-GD@gemulon.postgresql.org>
Permalink:  ../E1l38lQ-0007j7-GD@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l38lQ-0007j7-GD@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Introduce SHA1 implementations in the cryptohash infrastructure
  In-Reply-To: <E1l38lQ-0007j7-GD@gemulon.postgresql.org>
  References: <E1l38lQ-0007j7-GD@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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