Remove useless SHA256 initialization when not using backup manifests
authorMichael Paquier <michael@paquier.xyz>
Thu, 12 Nov 2020 01:56:33 +0000 (10:56 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 12 Nov 2020 01:56:33 +0000 (10:56 +0900)
commit03f9cd93eaa5e3385b075bb1a17d2adde3e23edd
tree80ef70bd583dafd310e2b08e973c77b8a05bae9c
parent42c63ab6e2c39c2fbfc70fa659b0cf5692178b77
Remove useless SHA256 initialization when not using backup manifests

Attempting to take a base backup with Postgres linking to a build of
OpenSSL with FIPS enabled currently fails with or even without a backup
manifest requested because of this mandatory SHA256 initialization used
for the manifest file itself.  However, there is no need to do this
initialization at all if backup manifests are not needed because there
is no data to append to the manifest.

Note that being able to use backup manifests with OpenSSL+FIPS requires
a switch of the SHA2 implementation to use EVP, which would cause an ABI
breakage so this cannot be backpatched to 13 as it has been already
released, but at least avoiding this SHA256 initialization gives users
the possibility to take a base backup even when specifying --no-manifest
with pg_basebackup.

Author: Michael Paquier
Discussion: https://postgr.es/m/20201110020014.GE1887@paquier.xyz
Backpatch-through: 13
src/backend/replication/backup_manifest.c