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 c835be3

Browse filesBrowse files
committed
pgcrypto: avoid name conflicts with OpenSSL in one more case.
I happened to notice that if compiled --with-gssapi, 9.6's contrib/pgcrypto tests report memory stomps for some SHA operations. Both MEMORY_CONTEXT_CHECKING and valgrind agree there's a problem, though nothing crashes; it appears that the buffer overrun only extends into alignment padding, at least on 64-bit hardware. Investigation found that pgcrypto's references to SHA224_Init et al were being captured by the system OpenSSL library, which of course has slightly incompatible definitions of those functions. We long ago noticed this problem with respect to the sibling functions SHA256_Init and so on, and commit 56f4478 introduced renaming macros to dodge the problem for those. However, it didn't cover the SHA224 family because we didn't use that at the time. When commit 1abf76e added those awhile later, it neglected to add a similar renaming macro. Better late than never, so do so now. This appears to affect all branches 8.2 - 9.6, so it's surprising nobody noticed before now. Maybe the effect is somehow specific to the way RHEL8 intertwines its GSS and SSL libraries? Anyway, we refactored all this stuff in v10, so newer branches don't have the problem.
1 parent ad9827a commit c835be3
Copy full SHA for c835be3

File tree

1 file changed

+3
-0
lines changed
Filter options

1 file changed

+3
-0
lines changed

‎contrib/pgcrypto/sha2.h

Copy file name to clipboardExpand all lines: contrib/pgcrypto/sha2.h
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
#define _SHA2_H
4040

4141
/* avoid conflict with OpenSSL */
42+
#define SHA224_Init pg_SHA224_Init
43+
#define SHA224_Update pg_SHA224_Update
44+
#define SHA224_Final pg_SHA224_Final
4245
#define SHA256_Init pg_SHA256_Init
4346
#define SHA256_Update pg_SHA256_Update
4447
#define SHA256_Final pg_SHA256_Final

0 commit comments

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