Skip to content
Snippets Groups Projects
  1. Sep 15, 2016
    • Heikki Linnakangas's avatar
      Support OpenSSL 1.1.0. · 593d4e47
      Heikki Linnakangas authored
      Changes needed to build at all:
      
      - Check for SSL_new in configure, now that SSL_library_init is a macro.
      - Do not access struct members directly. This includes some new code in
        pgcrypto, to use the resource owner mechanism to ensure that we don't
        leak OpenSSL handles, now that we can't embed them in other structs
        anymore.
      - RAND_SSLeay() -> RAND_OpenSSL()
      
      Changes that were needed to silence deprecation warnings, but were not
      strictly necessary:
      
      - RAND_pseudo_bytes() -> RAND_bytes().
      - SSL_library_init() and OpenSSL_config() -> OPENSSL_init_ssl()
      - ASN1_STRING_data() -> ASN1_STRING_get0_data()
      - DH_generate_parameters() -> DH_generate_parameters()
      - Locking callbacks are not needed with OpenSSL 1.1.0 anymore. (Good
        riddance!)
      
      Also change references to SSLEAY_VERSION_NUMBER with OPENSSL_VERSION_NUMBER,
      for the sake of consistency. OPENSSL_VERSION_NUMBER has existed since time
      immemorial.
      
      Fix SSL test suite to work with OpenSSL 1.1.0. CA certificates must have
      the "CA:true" basic constraint extension now, or OpenSSL will refuse them.
      Regenerate the test certificates with that. The "openssl" binary, used to
      generate the certificates, is also now more picky, and throws an error
      if an X509 extension is specified in "req_extensions", but that section
      is empty.
      
      Backpatch to all supported branches, per popular demand. In back-branches,
      we still support OpenSSL 0.9.7 and above. OpenSSL 0.9.6 should still work
      too, but I didn't test it. In master, we only support 0.9.8 and above.
      
      Patch by Andreas Karlsson, with additional changes by me.
      
      Discussion: <20160627151604.GD1051@msg.df7cb.de>
      593d4e47
  2. Jun 14, 2016
    • Robert Haas's avatar
      Update sslinfo extension for parallel query. · 6b7d11ff
      Robert Haas authored
      All functions provided by this extension are PARALLEL RESTRICTED,
      because they provide information about the connection state.  Parallel
      workers don't have this information and therefore these functions
      can't be executed in a worker (but they can be present in a query some
      other part of which uses parallelism).
      
      Andreas Karlsson
      6b7d11ff
    • Tom Lane's avatar
      Minor fixes in contrib installation scripts. · 5484c0a9
      Tom Lane authored
      Extension scripts should never use CREATE OR REPLACE for initial object
      creation.  If there is a collision with a pre-existing (probably
      user-created) object, we want extension installation to fail, not silently
      overwrite the user's object.  Bloom and sslinfo both violated this precept.
      
      Also fix a number of scripts that had no standard header (the file name
      comment and the \echo...\quit guard).  Probably the \echo...\quit hack
      is less important now than it was in 9.1 days, but that doesn't mean
      that individual extensions get to choose whether to use it or not.
      
      And fix a couple of evident copy-and-pasteos in file name comments.
      
      No need for back-patch: the REPLACE bugs are both new in 9.6, and the
      rest of this is pretty much cosmetic.
      
      Andreas Karlsson and Tom Lane
      5484c0a9
  3. Jun 10, 2016
  4. Sep 08, 2015
    • Alvaro Herrera's avatar
    • Alvaro Herrera's avatar
      contrib/sslinfo: add ssl_extension_info SRF · 49124613
      Alvaro Herrera authored
      This new function provides information about SSL extensions present in
      the X509 certificate used for the current connection.
      
      Extension version updated to version 1.1.
      
      Author: Дмитрий Воронин (Dmitry Voronin)
      Reviewed by: Michael Paquier, Heikki Linnakangas, Álvaro Herrera
      49124613
    • Alvaro Herrera's avatar
      Add more sanity checks in contrib/sslinfo · d94c36a4
      Alvaro Herrera authored
      We were missing a few return checks on OpenSSL calls.  Should be pretty
      harmless, since we haven't seen any user reports about problems, and
      this is not a high-traffic module anyway; still, a bug is a bug, so
      backpatch this all the way back to 9.0.
      
      Author: Michael Paquier, while reviewing another sslinfo patch
      d94c36a4
  5. Nov 25, 2014
    • Heikki Linnakangas's avatar
      Make Port->ssl_in_use available, even when built with !USE_SSL · e453cc27
      Heikki Linnakangas authored
      Code that check the flag no longer need #ifdef's, which is more convenient.
      In particular, makes it easier to write extensions that depend on it.
      
      In the passing, modify sslinfo's ssl_is_used function to check ssl_in_use
      instead of the OpenSSL specific 'ssl' pointer. It doesn't make any
      difference currently, as sslinfo is only compiled when built with OpenSSL,
      but seems cleaner anyway.
      e453cc27
  6. Aug 25, 2014
  7. Jul 14, 2014
  8. Jul 10, 2014
  9. 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
  10. Apr 18, 2014
    • Peter Eisentraut's avatar
      Create function prototype as part of PG_FUNCTION_INFO_V1 macro · e7128e8d
      Peter Eisentraut authored
      Because of gcc -Wmissing-prototypes, all functions in dynamically
      loadable modules must have a separate prototype declaration.  This is
      meant to detect global functions that are not declared in header files,
      but in cases where the function is called via dfmgr, this is redundant.
      Besides filling up space with boilerplate, this is a frequent source of
      compiler warnings in extension modules.
      
      We can fix that by creating the function prototype as part of the
      PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway.  That
      makes the code of modules cleaner, because there is one less place where
      the entry points have to be listed, and creates an additional check that
      functions have the right prototype.
      
      Remove now redundant prototypes from contrib and other modules.
      e7128e8d
  11. Feb 23, 2014
    • Tom Lane's avatar
      Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion. · 769065c1
      Tom Lane authored
      A large majority of the callers of pg_do_encoding_conversion were
      specifying the database encoding as either source or target of the
      conversion, meaning that we can use the less general functions
      pg_any_to_server/pg_server_to_any instead.
      
      The main advantage of using the latter functions is that they can make use
      of a cached conversion-function lookup in the common case that the other
      encoding is the current client_encoding.  It's notationally cleaner too in
      most cases, not least because of the historical artifact that the latter
      functions use "char *" rather than "unsigned char *" in their APIs.
      
      Note that pg_any_to_server will apply an encoding verification step in
      some cases where pg_do_encoding_conversion would have just done nothing.
      This seems to me to be a good idea at most of these call sites, though
      it partially negates the performance benefit.
      
      Per discussion of bug #9210.
      769065c1
  12. Jan 18, 2014
  13. Apr 24, 2012
  14. Oct 12, 2011
    • Tom Lane's avatar
      Throw a useful error message if an extension script file is fed to psql. · 458857cc
      Tom Lane authored
      We have seen one too many reports of people trying to use 9.1 extension
      files in the old-fashioned way of sourcing them in psql.  Not only does
      that usually not work (due to failure to substitute for MODULE_PATHNAME
      and/or @extschema@), but if it did work they'd get a collection of loose
      objects not an extension.  To prevent this, insert an \echo ... \quit
      line that prints a suitable error message into each extension script file,
      and teach commands/extension.c to ignore lines starting with \echo.
      That should not only prevent any adverse consequences of loading a script
      file the wrong way, but make it crystal clear to users that they need to
      do it differently now.
      
      Tom Lane, following an idea of Andrew Dunstan's.  Back-patch into 9.1
      ... there is not going to be much value in this if we wait till 9.2.
      458857cc
  15. Feb 14, 2011
    • Tom Lane's avatar
      de06cfe8
    • Tom Lane's avatar
      Avoid use of CREATE OR REPLACE FUNCTION in extension installation files. · 029fac22
      Tom Lane authored
      It was never terribly consistent to use OR REPLACE (because of the lack of
      comparable functionality for data types, operators, etc), and
      experimentation shows that it's now positively pernicious in the extension
      world.  We really want a failure to occur if there are any conflicts, else
      it's unclear what the extension-ownership state of the conflicted object
      ought to be.  Most of the time, CREATE EXTENSION will fail anyway because
      of conflicts on other object types, but an extension defining only
      functions can succeed, with bad results.
      029fac22
    • Tom Lane's avatar
      Convert contrib modules to use the extension facility. · 629b3af2
      Tom Lane authored
      This isn't fully tested as yet, in particular I'm not sure that the
      "foo--unpackaged--1.0.sql" scripts are OK.  But it's time to get some
      buildfarm cycles on it.
      
      sepgsql is not converted to an extension, mainly because it seems to
      require a very nonstandard installation process.
      
      Dimitri Fontaine and Tom Lane
      629b3af2
  16. Sep 22, 2010
  17. Sep 20, 2010
  18. Jul 28, 2010
  19. Nov 10, 2008
  20. 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
  21. Nov 13, 2007
  22. Nov 11, 2007
  23. Jun 27, 2007
  24. 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
  25. Feb 09, 2007
  26. Oct 04, 2006
  27. Sep 30, 2006
  28. Sep 14, 2006
  29. Sep 12, 2006
  30. Sep 06, 2006
Loading