Introduce SHA1 implementations in the cryptohash infrastructure
authorMichael Paquier
Sat, 23 Jan 2021 02:33:04 +0000 (11:33 +0900)
committerMichael Paquier
Sat, 23 Jan 2021 02:33:04 +0000 (11:33 +0900)
commita8ed6bb8f4cf259b95c1bff5da09a8f4c79dca46
treed8a97d8a0a0dae12bb6b96caf6ce3b4d625229a4
parent3fc81ce459e1696f7e5e5b3b8229409413bf64b4
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/[email protected]
18 files changed:
configure
configure.ac
contrib/pgcrypto/Makefile
contrib/pgcrypto/internal.c
contrib/pgcrypto/sha1.c [deleted file]
contrib/uuid-ossp/.gitignore
contrib/uuid-ossp/Makefile
contrib/uuid-ossp/uuid-ossp.c
src/Makefile.global.in
src/common/Makefile
src/common/cryptohash.c
src/common/cryptohash_openssl.c
src/common/sha1.c [new file with mode: 0644]
src/common/sha1_int.h [moved from contrib/pgcrypto/sha1.h with 71% similarity]
src/include/common/cryptohash.h
src/include/common/sha1.h [new file with mode: 0644]
src/tools/msvc/Mkvcbuild.pm
src/tools/pgindent/typedefs.list