Skip to content
Snippets Groups Projects
  1. Jan 28, 2012
  2. Sep 01, 2011
  3. Sep 20, 2010
  4. Mar 25, 2008
    • Tom Lane's avatar
      Simplify and standardize conversions between TEXT datums and ordinary C · 220db7cc
      Tom Lane authored
      strings.  This patch introduces four support functions cstring_to_text,
      cstring_to_text_with_len, text_to_cstring, and text_to_cstring_buffer, and
      two macros CStringGetTextDatum and TextDatumGetCString.  A number of
      existing macros that provided variants on these themes were removed.
      
      Most of the places that need to make such conversions now require just one
      function or macro call, in place of the multiple notational layers that used
      to be needed.  There are no longer any direct calls of textout or textin,
      and we got most of the places that were using handmade conversions via
      memcpy (there may be a few still lurking, though).
      
      This commit doesn't make any serious effort to eliminate transient memory
      leaks caused by detoasting toasted text objects before they reach
      text_to_cstring.  We changed PG_GETARG_TEXT_P to PG_GETARG_TEXT_PP in a few
      places where it was easy, but much more could be done.
      
      Brendan Jurd and Tom Lane
      220db7cc
  5. Feb 28, 2007
    • Tom Lane's avatar
      Replace direct assignments to VARATT_SIZEP(x) with SET_VARSIZE(x, len). · 234a02b2
      Tom Lane authored
      Get rid of VARATT_SIZE and VARATT_DATA, which were simply redundant with
      VARSIZE and VARDATA, and as a consequence almost no code was using the
      longer names.  Rename the length fields of struct varlena and various
      derived structures to catch anyplace that was accessing them directly;
      and clean up various places so caught.  In itself this patch doesn't
      change any behavior at all, but it is necessary infrastructure if we hope
      to play any games with the representation of varlena headers.
      Greg Stark and Tom Lane
      234a02b2
  6. Nov 10, 2006
  7. Oct 04, 2006
  8. Sep 05, 2006
  9. 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
  10. May 31, 2006
  11. Oct 15, 2005
  12. Sep 24, 2005
  13. Mar 21, 2005
    • Neil Conway's avatar
      pgcrypto update: · b160d6b9
      Neil Conway authored
      * Use error codes instead of -1
      * px_strerror for new error codes
      * calling convention change for px_gen_salt - return error code
      * use px_strerror in pgcrypto.c
      
      Marko Kreen
      b160d6b9
    • Neil Conway's avatar
      * construct "struct {} list [] = {}" confuses pgindent - split those. · fa332a06
      Neil Conway authored
        It was a bad style to begin with, and now several loops can be clearer.
      * pgcrypto.c: Fix function comments
      * crypt-gensalt.c, crypt-blowfish.c: stop messing with errno
      * openssl.c: use px_free instead pfree
      * px.h: make redefining px_alloc/px_realloc/px_free easier
      
      Marko Kreen
      fa332a06
  14. May 07, 2004
    • Tom Lane's avatar
      Solve the 'Turkish problem' with undesirable locale behavior for case · 0bd61548
      Tom Lane authored
      conversion of basic ASCII letters.  Remove all uses of strcasecmp and
      strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp;
      remove most but not all direct uses of toupper and tolower in favor of
      pg_toupper and pg_tolower.  These functions use the same notions of
      case folding already developed for identifier case conversion.  I left
      the straight locale-based folding in place for situations where we are
      just manipulating user data and not trying to match it to built-in
      strings --- for example, the SQL upper() function is still locale
      dependent.  Perhaps this will prove not to be what's wanted, but at
      the moment we can initdb and pass regression tests in Turkish locale.
      0bd61548
  15. Nov 29, 2003
    • PostgreSQL Daemon's avatar
      · 55b11325
      PostgreSQL Daemon authored
      make sure the $Id tags are converted to $PostgreSQL as well ...
      55b11325
  16. Aug 04, 2003
  17. Jul 24, 2003
  18. Dec 31, 2001
  19. Nov 20, 2001
  20. Oct 25, 2001
  21. Sep 23, 2001
    • Bruce Momjian's avatar
      Big thanks to Solar Designer who pointed out a bug in bcrypt · ab560228
      Bruce Momjian authored
      salt generation code.  He also urged using better random source
      and making possible to choose using bcrypt and xdes rounds more
      easily.  So, here's patch:
      
      * For all salt generation, use Solar Designer's own code.  This
        is mostly due fact that his code is more fit for get_random_bytes()
        style interface.
      * New function: gen_salt(type, rounds).  This lets specify iteration
        count for algorithm.
      * random.c: px_get_random_bytes() function.
        Supported randomness soure: /dev/urandom, OpenSSL PRNG, libc random()
        Default: /dev/urandom.
      * Draft description of C API for pgcrypto functions.
      
      New files: API, crypt-gensalt.c, random.c
      
      Marko Kreen
      ab560228
  22. Aug 21, 2001
    • Bruce Momjian's avatar
      /contrib/pgcrypto: · 2518e273
      Bruce Momjian authored
      * remove support for encode() as it is in main tree now
      * remove krb5.c
      * new 'PX library' architecture
      * remove BSD license from my code to let the general
        PostgreSQL one to apply
      * md5, sha1: ANSIfy, use const where appropriate
      * various other formatting and clarity changes
      * hmac()
      * UN*X-like crypt() - system or internal crypt
      * Internal crypt: DES, Extended DES, MD5, Blowfish
        crypt-des.c, crypt-md5.c from FreeBSD
        crypt-blowfish.c from Solar Designer
      * gen_salt() for crypt() -  Blowfish, MD5, DES, Extended DES
      * encrypt(), decrypt(), encrypt_iv(), decrypt_iv()
      * Cipher support in mhash.c, openssl.c
      * internal: Blowfish, Rijndael-128 ciphers
      * blf.[ch], rijndael.[ch] from OpenBSD
      * there will be generated file rijndael-tbl.inc.
      
      Marko Kreen
      2518e273
  23. Mar 22, 2001
  24. Feb 10, 2001
    • Tom Lane's avatar
      Restructure the key include files per recent pghackers discussion: there · d08741ea
      Tom Lane authored
      are now separate files "postgres.h" and "postgres_fe.h", which are meant
      to be the primary include files for backend .c files and frontend .c files
      respectively.  By default, only include files meant for frontend use are
      installed into the installation include directory.  There is a new make
      target 'make install-all-headers' that adds the whole content of the
      src/include tree to the installed fileset, for use by people who want to
      develop server-side code without keeping the complete source tree on hand.
      Cleaned up a whole lot of crufty and inconsistent header inclusions.
      d08741ea
  25. Feb 06, 2001
  26. Jan 24, 2001
    • Bruce Momjian's avatar
      I would like to do a interface change in pgcrypto. (Good · cb5427ee
      Bruce Momjian authored
      timing, I know :))  At the moment the digest() function returns
      hexadecimal coded hash, but I want it to return pure binary.  I
      have also included functions encode() and decode() which support
      'base64' and 'hex' encodings, so if anyone needs digest() in hex
      he can do encode(digest(...), 'hex').
      
      Main reason for it is "to do one thing and do it well" :)
      
      Another reason is if someone needs really lot of digesting, in
      the end he wants to store the binary not the hexadecimal result.
      It is really silly to convert it to hex then back to binary
      again.  As I said if someone needs hex he can get it.
      
      Well, and the real reason that I am doing encrypt()/decrypt()
      functions and _they_ return binary.  For testing I like to see
      it in hex occasionally, but it is really wrong to let them
      return hex.  Only now it caught my eye that hex-coding in
      digest() is wrong.  When doing digest() I thought about 'common
      case' but hacking with psql is probably _not_ the common case :)
      
      Marko Kreen
      cb5427ee
  27. Jan 09, 2001
    • Bruce Momjian's avatar
      The KAME files md5.* and sha1.* have the following changelog · e586026d
      Bruce Momjian authored
      entry:
      
      ----------------------------
      revision 1.2
      date: 2000/12/04 01:20:38;  author: tgl;  state: Exp;  lines:
      +18 -18
      Eliminate some of the more blatant platform-dependencies ... it
      builds here now, anyway ...
      ----------------------------
      
      Which basically changes u_int*_t -> uint*_t, so now it does not
      compile neither under Debian 2.2 nor under NetBSD 1.5 which
      is platform independent<B8> all right.  Also it replaces $KAME$
      with $Id$ which is Bad Thing. PostgreSQL Id should be added as a
      separate line so the file history could be seen.
      
      So here is patch:
      
      * changes uint*_t -> uint*.  I guess that was the original
        intention
      * adds uint64 type to include/c.h because its needed
        [somebody should check if I did it right]
      * adds back KAME Id, because KAME is the master repository
      * removes stupid c++ comments in pgcrypto.c
      * removes <sys/types.h> from the code, its not needed
      
      --
      marko
      
      Marko Kreen
      e586026d
  28. Nov 20, 2000
    • Tom Lane's avatar
      Revise handling of oldstyle/newstyle functions per recent discussions · 5bb2300b
      Tom Lane authored
      in pghackers list.  Support for oldstyle internal functions is gone
      (no longer needed, since conversion is complete) and pg_language entry
      'internal' now implies newstyle call convention.  pg_language entry
      'newC' is gone; both old and newstyle dynamically loaded C functions
      are now called language 'C'.  A newstyle function must be identified
      by an associated info routine.  See src/backend/utils/fmgr/README.
      5bb2300b
  29. Oct 31, 2000
Loading