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 42d74e0

Browse filesBrowse files
committed
Fix copy-paste error with SHA256 digest length in checksum_helper.c
Issue introduced by 87ae969, noticed while working on the area. While on it, fix some grammar in the surrounding static assertions.
1 parent 69273c8 commit 42d74e0
Copy full SHA for 42d74e0

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎src/common/checksum_helper.c

Copy file name to clipboardExpand all lines: src/common/checksum_helper.c
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ pg_checksum_final(pg_checksum_context *context, uint8 *output)
180180
StaticAssertStmt(sizeof(pg_crc32c) <= PG_CHECKSUM_MAX_LENGTH,
181181
"CRC-32C digest too big for PG_CHECKSUM_MAX_LENGTH");
182182
StaticAssertStmt(PG_SHA224_DIGEST_LENGTH <= PG_CHECKSUM_MAX_LENGTH,
183-
"SHA224 digest too for PG_CHECKSUM_MAX_LENGTH");
183+
"SHA224 digest too big for PG_CHECKSUM_MAX_LENGTH");
184184
StaticAssertStmt(PG_SHA256_DIGEST_LENGTH <= PG_CHECKSUM_MAX_LENGTH,
185-
"SHA256 digest too for PG_CHECKSUM_MAX_LENGTH");
185+
"SHA256 digest too big for PG_CHECKSUM_MAX_LENGTH");
186186
StaticAssertStmt(PG_SHA384_DIGEST_LENGTH <= PG_CHECKSUM_MAX_LENGTH,
187-
"SHA384 digest too for PG_CHECKSUM_MAX_LENGTH");
187+
"SHA384 digest too big for PG_CHECKSUM_MAX_LENGTH");
188188
StaticAssertStmt(PG_SHA512_DIGEST_LENGTH <= PG_CHECKSUM_MAX_LENGTH,
189-
"SHA512 digest too for PG_CHECKSUM_MAX_LENGTH");
189+
"SHA512 digest too big for PG_CHECKSUM_MAX_LENGTH");
190190

191191
switch (context->type)
192192
{
@@ -207,7 +207,7 @@ pg_checksum_final(pg_checksum_context *context, uint8 *output)
207207
if (pg_cryptohash_final(context->raw_context.c_sha2, output) < 0)
208208
return -1;
209209
pg_cryptohash_free(context->raw_context.c_sha2);
210-
retval = PG_SHA224_DIGEST_LENGTH;
210+
retval = PG_SHA256_DIGEST_LENGTH;
211211
break;
212212
case CHECKSUM_TYPE_SHA384:
213213
if (pg_cryptohash_final(context->raw_context.c_sha2, output) < 0)

0 commit comments

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