]> granicus.if.org Git - postgresql/commit
Apply upstream fix for blowfish signed-character bug (CVE-2011-2483).
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Jun 2011 18:41:05 +0000 (14:41 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Jun 2011 18:42:11 +0000 (14:42 -0400)
commit4b09299e4723276c70c5b25de38578d642490179
tree5aae16f440f597bc43633b700eaa1357e80a1ce6
parent62c8350c5c1ae99594a15455c2a531ba3ae2dde8
Apply upstream fix for blowfish signed-character bug (CVE-2011-2483).

A password containing a character with the high bit set was misprocessed
on machines where char is signed (which is most).  This could cause the
preceding one to three characters to fail to affect the hashed result,
thus weakening the password.  The result was also unportable, and failed
to match some other blowfish implementations such as OpenBSD's.

Since the fix changes the output for such passwords, upstream chose
to provide a compatibility hack: password salts beginning with $2x$
(instead of the usual $2a$ for blowfish) are intentionally processed
"wrong" to give the same hash as before.  Stored password hashes can
thus be modified if necessary to still match, though it'd be better
to change any affected passwords.

In passing, sync a couple other upstream changes that marginally improve
performance and/or tighten error checking.

Back-patch to all supported branches.  Since this issue is already
public, no reason not to commit the fix ASAP.
contrib/pgcrypto/crypt-blowfish.c
contrib/pgcrypto/px-crypt.c