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 1hBMTa-0004cR-9v for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 16:41:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBMTY-0003ka-Vd for pgsql-hackers@arkaria.postgresql.org; Tue, 02 Apr 2019 16:41:28 +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 1hBMTY-0003kO-N5 for pgsql-hackers@lists.postgresql.org; Tue, 02 Apr 2019 16:41:28 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBMTV-0002EL-W2 for pgsql-hackers@postgresql.org; Tue, 02 Apr 2019 16:41:28 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0A5EA5F7A5; Tue, 2 Apr 2019 12:41:24 -0400 (EDT) Date: Tue, 2 Apr 2019 12:41:24 -0400 From: Stephen Frost To: Robbie Harwood Cc: Peter Eisentraut , pgsql-hackers@postgresql.org, Nico Williams , Michael Paquier , Alvaro Herrera , David Steele Subject: Re: [PATCH v22] GSSAPI encryption support Message-ID: <20190402164124.GZ6197@tamriel.snowman.net> References: <5ec3f734-810e-36e0-030f-af92efe135da@2ndquadrant.com> <20190223162751.GO6197@tamriel.snowman.net> <20190316102110.GU6197@tamriel.snowman.net> <20190330142404.GO6197@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bPbpEglh0dw8VbL0" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --bPbpEglh0dw8VbL0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Robbie Harwood (rharwood@redhat.com) wrote: > Stephen Frost writes: > > * Robbie Harwood (rharwood@redhat.com) wrote: > >> Stephen Frost writes: > >>=20 > >> I wanted to note a couple things about this approach. It now uses > >> one more buffer than before (in contrast to the previous approach, > >> which reused a buffer for received data that was encrypted and > >> decrypted). > > > > Yeah, I don't see that as too much of an issue and it certainly seems > > cleaner and simpler to reason about to me, which seems worth the > > modest additional buffer cost. That's certainly something we could > > change if others feel differently. > > > >> Since these are static fixed size buffers, this increases the total > >> steady-state memory usage by 16k as opposed to re-using the buffer. > >> This may be fine; I don't know how tight RAM is here. > > > > It seems unlikely to be an issue to me- and I would contend that the > > prior implementation didn't actually take any steps to prevent the > > other side from sending packets of nearly arbitrary size (up to 1G), > > so while the steady-state memory usage of the prior implementation was > > less when everyone was playing nicely, it could have certainly been > > abused. I'm a lot happier having an explicit cap on how much memory > > will be used, even if that cap is a bit higher. >=20 > Yeah, that's definitely a fair point. We could combine the two > approaches, but I don't really see a reason to if it's unlikely to be an > issue - as you say, this is more readable. It can always be a follow-on > if needed. Agreed, we could do that later if it seems like it would be helpful. > > I did add in a simple pg_stat_gssapi view, modeled on pg_stat_ssl, so > > that you can check server-side if GSSAPI was used for authentication > > and/or encryption, and what principal was used if GSSAPI was used for > > authentication. >=20 > Good idea. Thanks. :) I definitely like being able to see from the backend side of things when a connection is encrypted or not, and being able to see the principal used for authentication is really nice too. > >> Again, these are nits, and I think I'm okay with the changes. > > > > Great, thanks again for reviewing! > > > > Updated patch attached, if you could take another look through it, > > that'd be great. >=20 > I'm happy with this! Appreciate you exploring my concerns. Fantastic, thanks so much for working on this over the years! Unless there's any further comments, I'm going to push this tomorrow. Thanks again! Stephen --bPbpEglh0dw8VbL0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJco5C0AAoJEO1sijiDR2RVvk4P/01+fm5JI+j00Raugqi0z607 eo/bl+3Ekdm4jPbPdHm1e5vfewpZ5VClvwfV7guTBjXGdu0zpVc6sQkxivbj3Cqy spcef+ODeEUhrqmJ0cO+u8KYY2eN5PrxFhNL24lLv00JUW3fh/stIO47vnsSU5Tl Jk8sCOqUERreSqFeG1Ak5sin4/qR4GPjxa7L0lEETtYK6unlmi/i4LPkq1CPNYQV RRcPlmQlH2ItVGobxK76gZshUjNaZsojAw0oHrg/yyTRSvYH7dZQAuDHXuxRWJ0B 4Jp0+qUJ/p81vHiQhXYtePrc7D5e/G4AOxWhsp4LITpGVe5lPfcgx1d5A43Ai5ST 6r2OEn239ADgjqbMxbBgL5jfuLsHzRlxdx7aiGbf3jF1VCDqfICLACtjkThNQ7QN Y+aKo2GoffyttNzz1+l++E85zGnEwmoGDDDtQBK/Qz6OlzFWeItcoREJ1DEsW9mf GIshatTb9KH0/3+uXNCet2Q0iJD3aKjebzPXsQuF2/5rlmJJMQkH1GnvifFYYq/+ 2nh+gIz+Tb4c/e+7qQ9bZRlLVfSkZSK5CHRmWZacBelBhFvq5bvEpVuvWfx/NWQd GBuIR8eeQLg2/tXuip88SmrS4k9r3vde2X1tK7A9fBd8LhpGy9fJQ7QKF/U9bg5O c9fwr2zXaEi5j3SWH7rt =cxGr -----END PGP SIGNATURE----- --bPbpEglh0dw8VbL0--