Skip to content
Snippets Groups Projects
  1. Dec 27, 2015
  2. Oct 12, 2015
  3. Oct 05, 2015
    • Noah Misch's avatar
      pgcrypto: Detect and report too-short crypt() salts. · 1d812c8b
      Noah Misch authored
      Certain short salts crashed the backend or disclosed a few bytes of
      backend memory.  For existing salt-induced error conditions, emit a
      message saying as much.  Back-patch to 9.0 (all supported versions).
      
      Josh Kupershmidt
      
      Security: CVE-2015-5288
      1d812c8b
  4. Jan 24, 2015
    • Tom Lane's avatar
      Replace a bunch more uses of strncpy() with safer coding. · 586dd5d6
      Tom Lane authored
      strncpy() has a well-deserved reputation for being unsafe, so make an
      effort to get rid of nearly all occurrences in HEAD.
      
      A large fraction of the remaining uses were passing length less than or
      equal to the known strlen() of the source, in which case no null-padding
      can occur and the behavior is equivalent to memcpy(), though doubtless
      slower and certainly harder to reason about.  So just use memcpy() in
      these cases.
      
      In other cases, use either StrNCpy() or strlcpy() as appropriate (depending
      on whether padding to the full length of the destination buffer seems
      useful).
      
      I left a few strncpy() calls alone in the src/timezone/ code, to keep it
      in sync with upstream (the IANA tzcode distribution).  There are also a
      few such calls in ecpg that could possibly do with more analysis.
      
      AFAICT, none of these changes are more than cosmetic, except for the four
      occurrences in fe-secure-openssl.c, which are in fact buggy: an overlength
      source leads to a non-null-terminated destination buffer and ensuing
      misbehavior.  These don't seem like security issues, first because no stack
      clobber is possible and second because if your values of sslcert etc are
      coming from untrusted sources then you've got problems way worse than this.
      Still, it's undesirable to have unpredictable behavior for overlength
      inputs, so back-patch those four changes to all active branches.
      586dd5d6
  5. May 06, 2014
    • Bruce Momjian's avatar
      pgindent run for 9.4 · 0a783200
      Bruce Momjian authored
      This includes removing tabs after periods in C comments, which was
      applied to back branches, so this change should not effect backpatching.
      0a783200
  6. May 30, 2012
    • Tom Lane's avatar
      Fix incorrect password transformation in contrib/pgcrypto's DES crypt(). · 932ded2e
      Tom Lane authored
      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.
      932ded2e
  7. Apr 24, 2012
  8. Sep 11, 2011
    • Peter Eisentraut's avatar
      Remove many -Wcast-qual warnings · 1b81c2fe
      Peter Eisentraut authored
      This addresses only those cases that are easy to fix by adding or
      moving a const qualifier or removing an unnecessary cast.  There are
      many more complicated cases remaining.
      1b81c2fe
  9. Sep 01, 2011
  10. Sep 20, 2010
  11. Jul 13, 2006
    • Neil Conway's avatar
      "Annual" pgcrypto update from Marko Kreen: · 1abf76e8
      Neil Conway authored
      Few cleanups and couple of new things:
      
       - add SHA2 algorithm to older OpenSSL
       - add BIGNUM math to have public-key cryptography work on non-OpenSSL
         build.
       - gen_random_bytes() function
      
      The status of SHA2 algoritms and public-key encryption can now be
      changed to 'always available.'
      
      That makes pgcrypto functionally complete and unless there will be new
      editions of AES, SHA2 or OpenPGP standards, there is no major changes
      planned.
      1abf76e8
  12. Mar 11, 2006
  13. Oct 15, 2005
  14. Sep 24, 2005
  15. Oct 25, 2004
  16. May 14, 2003
  17. Nov 30, 2001
  18. Nov 29, 2001
    • Bruce Momjian's avatar
      * When postgres.h does not define BYTE_ENDIAN pgcrypto · 8aa538cf
      Bruce Momjian authored
        produces garbage.
      
      I learned the hard way that
      
              #if UNDEFINED_1 == UNDEFINED_2
              #error "gcc is idiot"
              #endif
      
      prints "gcc is idiot" ...
      
      Affected are MD5/SHA1 in internal library, and also HMAC-MD5/HMAC-SHA1/
      crypt-md5 which use them.  Blowfish is ok, also Rijndael on at
      least x86.
      
      Big thanks to Daniel Holtzman who send me a build log which
      contained warning:
      
              md5.c:246: warning: `X' defined but not used
      
      Yes, gcc is that helpful...
      
      Please apply this.
      
      --
      marko
      8aa538cf
  19. Nov 20, 2001
  20. Nov 05, 2001
  21. Oct 30, 2001
  22. Oct 28, 2001
  23. Oct 25, 2001
  24. Oct 15, 2001
  25. Aug 21, 2001
Loading