postgresql/contrib/pgcrypto
Tom Lane dd957a5bb9 Fix incorrect password transformation in contrib/pgcrypto's DES crypt().
Overly tight coding caused the password transformation loop to stop
examining input once it had processed a byte equal to 0x80.  Thus, if the
given password string contained such a byte (which is possible though not
highly likely in UTF8, and perhaps also in other non-ASCII encodings), all
subsequent characters would not contribute to the hash, making the password
much weaker than it appears on the surface.

This would only affect cases where applications used DES crypt() to encode
passwords before storing them in the database.  If a weak password has been
created in this fashion, the hash will stop matching after this update has
been applied, so it will be easy to tell if any passwords were unexpectedly
weak.  Changing to a different password would be a good idea in such a case.
(Since DES has been considered inadequately secure for some time, changing
to 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 no
point in trying to keep this commit private.

This bug has been assigned CVE-2012-2143, and credit for its discovery goes
to Rubin Xu and Joseph Bonneau.
2012-05-30 10:53:48 -04:00
..
expected Fix a few contrib regression test scripts that hadn't gotten the word 2007-11-13 06:29:04 +00:00
sql Fix a few contrib regression test scripts that hadn't gotten the word 2007-11-13 06:29:04 +00:00
.gitignore Some more gitignore cleanups: cover contrib and PL regression test outputs. 2010-09-22 17:23:05 -04:00
blf.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
blf.h pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
crypt-blowfish.c Apply upstream fix for blowfish signed-character bug (CVE-2011-2483). 2011-06-21 14:42:26 -04:00
crypt-des.c Fix incorrect password transformation in contrib/pgcrypto's DES crypt(). 2012-05-30 10:53:48 -04:00
crypt-gensalt.c pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
crypt-md5.c Remove beer-ware license from crypt-md5.c, per 2009-04-15 18:58:34 +00:00
fortuna.c pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
fortuna.h Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
imath.c Silence Solaris compiler warning, per buildfarm. 2007-07-15 22:43:40 +00:00
imath.h pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
internal-sha2.c pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
internal.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
Makefile Remove references to READMEs from /contrib Makefiles. 2007-11-10 23:59:52 +00:00
mbuf.c Get rid of overly cute, unportable, probably not very efficient substitute 2007-07-15 23:57:13 +00:00
mbuf.h Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
md5.c Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be 2007-04-06 05:36:51 +00:00
md5.h Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
openssl.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
pgcrypto.c Fix error detection in contrib/pgcrypto's encrypt_iv() and decrypt_iv(). 2012-01-27 23:10:02 -05:00
pgcrypto.h Remove pgcrypto functions that were deprecated and slated for removal. 2006-09-05 21:26:48 +00:00
pgcrypto.sql.in Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00
pgp-armor.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-cfb.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-compress.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
pgp-decrypt.c Re-run pgindent, fixing a problem where comment lines after a blank 2005-11-22 18:17:34 +00:00
pgp-encrypt.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-info.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-mpi-internal.c pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
pgp-mpi-openssl.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-mpi.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-pgsql.c Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). 2007-02-27 23:48:10 +00:00
pgp-pubdec.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-pubenc.c If pk is NULL, the backend would segfault when accessing ->algo and the 2010-10-20 22:25:12 +03:00
pgp-pubkey.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp-s2k.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp.c Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
pgp.h Fix old thinko in pgp.h: the idea is to declare some named enum types, 2009-03-25 15:03:19 +00:00
px-crypt.c Apply upstream fix for blowfish signed-character bug (CVE-2011-2483). 2011-06-21 14:42:26 -04:00
px-crypt.h "Annual" pgcrypto update from Marko Kreen: 2006-07-13 04:15:25 +00:00
px-hmac.c More pgcrypto fixes: avoid bogus alignment assumptions in sha2, 2005-07-11 15:07:59 +00:00
px.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
px.h Fix combo_decrypt() to throw an error for zero-length input when using a 2007-08-23 16:15:51 +00:00
random.c Add missing 3rd argument to open(). 2006-06-08 03:29:30 +00:00
rijndael.c Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be 2007-04-06 05:36:51 +00:00
rijndael.h
rijndael.tbl
sha1.c Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be 2007-04-06 05:36:51 +00:00
sha1.h
sha2.c pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
sha2.h "Annual" pgcrypto update from Marko Kreen: 2006-07-13 04:15:25 +00:00
uninstall_pgcrypto.sql Add CVS version labels to all install/uninstall scripts. 2007-11-13 04:24:29 +00:00