Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit2676040

Browse files
committed
Make fallback MD5 implementation thread-safe on big-endian systems
Replace a static scratch buffer with a local variable, because astatic buffer makes the function not thread-safe. This function isused in client-code in libpq, so it needs to be thread-safe. It wasuntil commitb67b57a, which replaced the implementation with theone from pgcrypto.Backpatch to v14, where we switched to the new implementation.Reviewed-by: Robert Haas, Michael PaquierDiscussion:https://www.postgresql.org/message-id/dfa2015d-ad21-4802-a4cc-3850fc5fff3f@iki.fi
1 parent5388216 commit2676040

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎src/common/md5.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ static const uint8 md5_paddat[MD5_BUFLEN] = {
150150
0,0,0,0,0,0,0,0,
151151
};
152152

153-
#ifdefWORDS_BIGENDIAN
154-
staticuint32X[16];
155-
#endif
156-
157153
staticvoid
158154
md5_calc(constuint8*b64,pg_md5_ctx*ctx)
159155
{
@@ -167,6 +163,7 @@ md5_calc(const uint8 *b64, pg_md5_ctx *ctx)
167163
#else
168164
/* 4 byte words */
169165
/* what a brute force but fast! */
166+
uint32X[16];
170167
uint8*y= (uint8*)X;
171168

172169
y[0]=b64[3];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp