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

Commit932ded2

Browse files
committed
Fix incorrect password transformation in contrib/pgcrypto's DES crypt().
Overly tight coding caused the password transformation loop to stopexamining input once it had processed a byte equal to 0x80. Thus, if thegiven password string contained such a byte (which is possible though nothighly likely in UTF8, and perhaps also in other non-ASCII encodings), allsubsequent characters would not contribute to the hash, making the passwordmuch weaker than it appears on the surface.This would only affect cases where applications used DES crypt() to encodepasswords before storing them in the database. If a weak password has beencreated in this fashion, the hash will stop matching after this update hasbeen applied, so it will be easy to tell if any passwords were unexpectedlyweak. Changing to a different password would be a good idea in such a case.(Since DES has been considered inadequately secure for some time, changingto a different encryption algorithm can also be recommended.)This code, and the bug, are shared with at least PHP, FreeBSD, and OpenBSD.Since the other projects have already published their fixes, there is nopoint in trying to keep this commit private.This bug has been assignedCVE-2012-2143, and credit for its discovery goesto Rubin Xu and Joseph Bonneau.
1 parentd1996ed commit932ded2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎contrib/pgcrypto/crypt-des.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@ px_crypt_des(const char *key, const char *setting)
670670
q= (uint8*)keybuf;
671671
while (q- (uint8*)keybuf-8)
672672
{
673-
if ((*q++=*key <<1))
673+
*q++=*key <<1;
674+
if (*key!='\0')
674675
key++;
675676
}
676677
if (des_setkey((char*)keybuf))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp