Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 03f9cd9

Browse filesBrowse files
committed
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
1 parent 42c63ab commit 03f9cd9
Copy full SHA for 03f9cd9

File tree

Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-2
lines changed

‎src/backend/replication/backup_manifest.c

Copy file name to clipboardExpand all lines: src/backend/replication/backup_manifest.c
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,17 @@ InitializeBackupManifest(backup_manifest_info *manifest,
5757
backup_manifest_option want_manifest,
5858
pg_checksum_type manifest_checksum_type)
5959
{
60+
memset(manifest, 0, sizeof(backup_manifest_info));
61+
manifest->checksum_type = manifest_checksum_type;
62+
6063
if (want_manifest == MANIFEST_OPTION_NO)
6164
manifest->buffile = NULL;
6265
else
66+
{
6367
manifest->buffile = BufFileCreateTemp(false);
64-
manifest->checksum_type = manifest_checksum_type;
65-
pg_sha256_init(&manifest->manifest_ctx);
68+
pg_sha256_init(&manifest->manifest_ctx);
69+
}
70+
6671
manifest->manifest_size = UINT64CONST(0);
6772
manifest->force_encode = (want_manifest == MANIFEST_OPTION_FORCE_ENCODE);
6873
manifest->first_file = true;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.