pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Support OpenSSL 1.1.0.
Date: Thu, 15 Sep 2016 11:55:11 +0000
Message-ID: <E1bkVG3-0000L8-Ln@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Support OpenSSL 1.1.0.

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>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/593d4e47db7af1a3a5dd6b6b1971f181b5566dbd

Modified Files
--------------
configure                                      |  44 ++++-----
configure.in                                   |   4 +-
contrib/pgcrypto/internal.c                    |   9 --
contrib/pgcrypto/openssl.c                     | 130 +++++++++++++++++++------
contrib/pgcrypto/pgcrypto.c                    |   2 +-
contrib/pgcrypto/pgp-s2k.c                     |   6 +-
contrib/pgcrypto/px-crypt.c                    |   2 +-
contrib/pgcrypto/px.h                          |   1 -
contrib/sslinfo/sslinfo.c                      |  14 +--
src/backend/libpq/be-secure-openssl.c          |  93 +++++++++++++++---
src/interfaces/libpq/fe-secure-openssl.c       |  94 ++++++++++++++----
src/test/ssl/Makefile                          |   5 +-
src/test/ssl/cas.config                        |   7 +-
src/test/ssl/root_ca.config                    |   4 +
src/test/ssl/server-cn-only.config             |   1 -
src/test/ssl/server-no-names.config            |   1 -
src/test/ssl/server-revoked.config             |   1 -
src/test/ssl/ssl/both-cas-1.crt                |  67 ++++++-------
src/test/ssl/ssl/both-cas-2.crt                |  67 ++++++-------
src/test/ssl/ssl/client-revoked.crt            |  16 +--
src/test/ssl/ssl/client-revoked.key            |  26 ++---
src/test/ssl/ssl/client.crl                    |  12 +--
src/test/ssl/ssl/client.crt                    |  16 +--
src/test/ssl/ssl/client.key                    |  26 ++---
src/test/ssl/ssl/client_ca.crt                 |  22 ++---
src/test/ssl/ssl/client_ca.key                 |  26 ++---
src/test/ssl/ssl/root+client.crl               |  22 ++---
src/test/ssl/ssl/root+client_ca.crt            |  45 ++++-----
src/test/ssl/ssl/root+server.crl               |  22 ++---
src/test/ssl/ssl/root+server_ca.crt            |  45 ++++-----
src/test/ssl/ssl/root.crl                      |  10 +-
src/test/ssl/ssl/root_ca.crt                   |  23 ++---
src/test/ssl/ssl/root_ca.key                   |  26 ++---
src/test/ssl/ssl/server-cn-and-alt-names.crt   |  18 ++--
src/test/ssl/ssl/server-cn-and-alt-names.key   |  26 ++---
src/test/ssl/ssl/server-cn-only.crt            |  16 +--
src/test/ssl/ssl/server-cn-only.key            |  26 ++---
src/test/ssl/ssl/server-multiple-alt-names.crt |  16 +--
src/test/ssl/ssl/server-multiple-alt-names.key |  26 ++---
src/test/ssl/ssl/server-no-names.crt           |  14 +--
src/test/ssl/ssl/server-no-names.key           |  26 ++---
src/test/ssl/ssl/server-revoked.crt            |  16 +--
src/test/ssl/ssl/server-revoked.key            |  26 ++---
src/test/ssl/ssl/server-single-alt-name.crt    |  14 +--
src/test/ssl/ssl/server-single-alt-name.key    |  26 ++---
src/test/ssl/ssl/server-ss.crt                 |  16 +--
src/test/ssl/ssl/server-ss.key                 |  26 ++---
src/test/ssl/ssl/server.crl                    |  12 +--
src/test/ssl/ssl/server_ca.crt                 |  22 ++---
src/test/ssl/ssl/server_ca.key                 |  26 ++---
50 files changed, 707 insertions(+), 534 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1bkVG3-0000L8-Ln@gemulon.postgresql.org>
Permalink:  ../E1bkVG3-0000L8-Ln@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bkVG3-0000L8-Ln@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Support OpenSSL 1.1.0.
  In-Reply-To: <E1bkVG3-0000L8-Ln@gemulon.postgresql.org>
  References: <E1bkVG3-0000L8-Ln@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox