pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add user-callable SHA-2 functions
Date: Thu, 22 Feb 2018 16:40:26 +0000
Message-ID: <E1eotv0-00069Q-PT@gemulon.postgresql.org> (raw)

Add user-callable SHA-2 functions

Add the user-callable functions sha224, sha256, sha384, sha512.  We
already had these in the C code to support SCRAM, but there was no test
coverage outside of the SCRAM tests.  Adding these as user-callable
functions allows writing some tests.  Also, we have a user-callable md5
function but no more modern alternative, which led to wide use of md5 as
a general-purpose hash function, which leads to occasional complaints
about using md5.

Also mark the existing md5 functions as leak-proof.

Reviewed-by: Michael Paquier <michael@paquier.xyz>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/10cfce34c0fe20d2caed5750bbc5c315c0e4cc63

Modified Files
--------------
doc/src/sgml/func.sgml                   |  71 ++++++++++++-
src/backend/utils/adt/Makefile           |   3 +-
src/backend/utils/adt/cryptohashes.c     | 169 +++++++++++++++++++++++++++++++
src/backend/utils/adt/varlena.c          |  48 ---------
src/include/catalog/pg_proc.h            |  12 ++-
src/test/regress/expected/opr_sanity.out |   6 ++
src/test/regress/expected/strings.out    |  53 ++++++++++
src/test/regress/sql/strings.sql         |  18 ++++
8 files changed, 328 insertions(+), 52 deletions(-)



Message-ID: <E1eotv0-00069Q-PT@gemulon.postgresql.org>
Permalink:  ../E1eotv0-00069Q-PT@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eotv0-00069Q-PT@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: peter_e@gmx.net
  Subject: Re: pgsql: Add user-callable SHA-2 functions
  In-Reply-To: <E1eotv0-00069Q-PT@gemulon.postgresql.org>
  References: <E1eotv0-00069Q-PT@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