1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Michael Paquier
2021-01-23 11:33:04 +09:00
parent 3fc81ce459
commit a8ed6bb8f4
18 changed files with 479 additions and 424 deletions

19
configure vendored
View File

@ -705,7 +705,6 @@ XML2_LIBS
XML2_CFLAGS
XML2_CONFIG
with_libxml
UUID_EXTRA_OBJS
with_uuid
with_readline
with_systemd
@ -8303,30 +8302,26 @@ if test "$with_ossp_uuid" = yes ; then
with_uuid=ossp
fi
if test "$with_uuid" = bsd ; then
if test "$with_uuid" != no ; then
if test "$with_uuid" = bsd ; then
$as_echo "#define HAVE_UUID_BSD 1" >>confdefs.h
UUID_EXTRA_OBJS="sha1.o"
elif test "$with_uuid" = e2fs ; then
elif test "$with_uuid" = e2fs ; then
$as_echo "#define HAVE_UUID_E2FS 1" >>confdefs.h
UUID_EXTRA_OBJS="sha1.o"
elif test "$with_uuid" = ossp ; then
elif test "$with_uuid" = ossp ; then
$as_echo "#define HAVE_UUID_OSSP 1" >>confdefs.h
UUID_EXTRA_OBJS=""
elif test "$with_uuid" = no ; then
UUID_EXTRA_OBJS=""
else
as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
else
as_fn_error $? "--with-uuid must specify one of bsd, e2fs, or ossp" "$LINENO" 5
fi
fi
#
# XML
#