Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioaJy-0004mS-Ja for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2020 21:53:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ioaJw-0005oX-P9 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2020 21:53:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ioaJw-0005oP-Fu for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2020 21:53:56 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ioaJt-000825-5E for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2020 21:53:56 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 90CB55F799; Mon, 6 Jan 2020 16:53:49 -0500 (EST) Date: Mon, 6 Jan 2020 16:53:49 -0500 From: Stephen Frost To: Alvaro Herrera Cc: Robbie Harwood , Pg Hackers Subject: Re: weird libpq GSSAPI comment Message-ID: <20200106215349.GL3195@tamriel.snowman.net> References: <20200106210322.GJ3195@tamriel.snowman.net> <20200106213817.GA29411@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lam14D/9fXh0ej1L" Content-Disposition: inline In-Reply-To: <20200106213817.GA29411@alvherre.pgsql> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --lam14D/9fXh0ej1L Content-Type: multipart/mixed; boundary="WXY7RArevp7nxfEu" Content-Disposition: inline --WXY7RArevp7nxfEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > On 2020-Jan-06, Stephen Frost wrote: >=20 > > > I wonder if part of the confusion might be due to the synonyms we're > > > using here for "in use". Things seem to be "got running", "set up", > > > "operating", "negotiated", ... - maybe that's part of the barrier to > > > understanding? > >=20 > > How about something like this? > >=20 > > * If GSSAPI Encryption is enabled, then call pg_GSS_have_cred_cache() > > * which will return true if we can acquire credentials (and give us a > > * handle to use in conn->gcred), and then send a packet to the server > > * asking for GSSAPI Encryption (and skip past SSL negotiation and > > * regular startup below). >=20 > WFM. (I'm not sure why you uppercase Encryption, though.) Ok, great, attached is an actual patch which I'll push soon if there aren't any other comments. Thanks! Stephen --WXY7RArevp7nxfEu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="gssapi_encryption_startup_comment_fix_v1.patch" Content-Transfer-Encoding: quoted-printable =46rom 49a57d5040c487c65cd9968504e978d11b4aefca Mon Sep 17 00:00:00 2001 =46rom: Stephen Frost Date: Mon, 6 Jan 2020 16:49:02 -0500 Subject: [PATCH] Improve GSSAPI Encryption startup comment in libpq The original comment was a bit confusing, pointed out by Alvaro Herrera. Thread: https://postgr.es/m/20191224151520.GA16435%40alvherre.pgsql --- src/interfaces/libpq/fe-connect.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-co= nnect.c index 3bd30482ec..89b134665b 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -2800,10 +2800,12 @@ keep_going: /* We will come back to here until= there is #ifdef ENABLE_GSS =20 /* - * If GSSAPI is enabled and we have a credential cache, try to - * set it up before sending startup messages. If it's already - * operating, don't try SSL and instead just build the startup - * packet. + * If GSSAPI encryption is enabled, then call + * pg_GSS_have_cred_cache() which will return true if we can + * acquire credentials (and give us a handle to use in + * conn->gcred), and then send a packet to the server asking + * for GSSAPI Encryption (and skip past SSL negotiation and + * regular startup below). */ if (conn->try_gss && !conn->gctx) conn->try_gss =3D pg_GSS_have_cred_cache(&conn->gcred); --=20 2.20.1 --WXY7RArevp7nxfEu-- --lam14D/9fXh0ej1L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJeE6xtAAoJEO1sijiDR2RV6qQP/1OmLWH9W1/pexg4gLfikcgR 1NkRBnE1mdQVXJLUOPy7VmOybTXBESIXAwIz1BS+EAq/7uHQsUemlxf38bOQMgxX AJP8PbjF85OVTr05Qs8igLZehl1i2YHgAAtT5JmDnvgPYdy9xaufbvNRRyRQkzp8 AOqlxotZBI8QzUDRM2nNrcQLJmxWJCDDTWrFwkpX4Lilsi4CDJbRPB3cbr5M2upE u5NCc1aep++qKCaULhyc8uBqHV1QwvfmLHZ08Mr8nOs8wHeYU18CKa1TrxOaqWsR YKdvoEK74xsPz/xZV6KHwU0CZagSkwab3TMDKba1kLYLQEhtPdhis/MPc4IM6THJ 25xVA4eV13pg71zivLvok5CxQ/bvE6GcaCPnX+iWOhAzgGLYlr7BNr2/phadYtM+ 6+BXWmS3EvWttdJrdrh3j/rA7YDRaXwxiQLYjNQxAwP1j2Qc5HCYDrwmSzIOXqy1 bfYStwJmSOvsv+pjv+0tj1S0/fLX9sjkwLMbQJ92u7CsyoHZfGejAbP6JjQuKXwq 7Mm23iWnsTAZDTSPqE2ep4pODnJU4K38MpU6Qr6QwWzXUpvjgef2WoC8aYTXtMJh ZF9S6bPkNiKXDWSa3qM4LhA/nnlzaPopwd38CSX1AqZD7Zoos8YGUUSL7SDg922l sV0pSs71kdJrtSOXeM10 =qx5M -----END PGP SIGNATURE----- --lam14D/9fXh0ej1L--