pgsql: Fix and simplify some code related to cryptohashes

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix and simplify some code related to cryptohashes
Date: 2021-01-08 01:37:59
Message-ID: E1kxgj1-0005c6-Pa@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix and simplify some code related to cryptohashes

This commit addresses two issues:
- In pgcrypto, MD5 computation called pg_cryptohash_{init,update,final}
without checking for the result status.
- Simplify pg_checksum_raw_context to use only one variable for all the
SHA2 options available in checksum manifests.

Reported-by: Heikki Linnakangas
Discussion: https://postgr.es/m/f62f26bb-47a5-8411-46e5-4350823e06a5@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/15b824da97afb45f47e51b6b5b7e5eca09e5d03d

Modified Files
--------------
contrib/pgcrypto/internal.c | 9 ++++--
src/common/checksum_helper.c | 59 +++++++++++++++---------------------
src/include/common/checksum_helper.h | 5 +--
3 files changed, 32 insertions(+), 41 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-01-08 01:48:09 Re: pgsql: createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate
Previous Message Tom Lane 2021-01-08 01:36:25 pgsql: Adjust createdb TAP tests to work on recent OpenBSD.