From 9b584953e7bf91e342af87ef44606acd6206cd1c Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Mon, 14 Dec 2020 12:38:13 +0900 Subject: Improve some code around cryptohash functions This adjusts some code related to recent changes for cryptohash functions: - Add a variable in md5.h to track down the size of a computed result, moved from pgcrypto. Note that pg_md5_hash() assumed a result of this size already. - Call explicit_bzero() on the hashed data when freeing the context for fallback implementations. For MD5, particularly, it would be annoying to leave some non-zeroed data around. - Clean up some code related to recent changes of uuid-ossp. .gitignore still included md5.c and a comment was incorrect. Discussion: https://postgr.es/m/X9HXKTgrvJvYO7Oh@paquier.xyz --- contrib/pgcrypto/internal.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'contrib/pgcrypto/internal.c') diff --git a/contrib/pgcrypto/internal.c b/contrib/pgcrypto/internal.c index e6d90c56567..ea377bdf83a 100644 --- a/contrib/pgcrypto/internal.c +++ b/contrib/pgcrypto/internal.c @@ -41,10 +41,6 @@ #include "common/cryptohash.h" #include "common/md5.h" -#ifndef MD5_DIGEST_LENGTH -#define MD5_DIGEST_LENGTH 16 -#endif - #ifndef SHA1_DIGEST_LENGTH #ifdef SHA1_RESULTLEN #define SHA1_DIGEST_LENGTH SHA1_RESULTLEN -- cgit v1.2.3