Refactor SHA2 functions and move them to src/common/.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: 273c458a2b3a0fb73968020ea5e9e35eb6928967
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2017-03-07T12:23:49Z
Releases: 10.0
Refactor SHA2 functions and move them to src/common/.

This way both frontend and backends can use them. The functions are taken
from pgcrypto, which now fetches the source files it needs from
src/common/.

A new interface is designed for the SHA2 functions, which allow linking
to either OpenSSL or the in-core stuff taken from KAME as needed.

Michael Paquier, reviewed by Robert Haas.

Discussion: https://www.postgresql.org/message-id/CAB7nPqTGKuTM5jiZriHrNaQeVqp5e_iT3X4BFLWY_HyHxLvySQ%40mail.gmail.com

Files

PathChange+/−
contrib/pgcrypto/.gitignore modified +4 −0
contrib/pgcrypto/internal-sha2.c modified +41 −41
contrib/pgcrypto/Makefile modified +8 −1
contrib/pgcrypto/sha2.h deleted +0 −100
src/common/Makefile modified +6 −0
src/common/sha2.c (from contrib/pgcrypto/sha2.c) renamed +94 −80
src/common/sha2_openssl.c added +102 −0
src/include/common/sha2.h added +115 −0
src/tools/msvc/Mkvcbuild.pm modified +15 −5

Discussion