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 1hvyCX-0007a3-M0 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2019 06:16:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hvyCW-0002cC-Es for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Aug 2019 06:16:32 +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 1hvyCV-0002XU-Vt for pgsql-hackers@lists.postgresql.org; Fri, 09 Aug 2019 06:16:32 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hvyCT-0001nc-H6 for pgsql-hackers@postgresql.org; Fri, 09 Aug 2019 06:16:31 +0000 Received: by mail-pg1-x542.google.com with SMTP id i18so45329771pgl.11 for ; Thu, 08 Aug 2019 23:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=RgxMMldTnvRzPtzUgaKCZ6vh2b82ZORXGvXZR04lUYE=; b=Upg6jW6K3/BItOn0Ed36l1RJVzI+Q2Ane4X88yt5tI98q/vFoJ6I3NRS/k//OJ7teP hVBeuhriTOJKJ+QIlPIvoxsnW3BZFr3zbhyPPg404gih+/TiNyPZ+cLyUwtAXZYTEOrO otVqSJsg3T2G+W7ujm4djkV5C2NNTOzXQ+gknyTm2TcFrMJgPuMazLHWAryoQsY2hgcL tHXzuoTSdokccNoqQXuJgEJbBNoDnC95hibVRPWeH2HNBrtM739Aa+lSMyoFkvyc60P9 bXGUVSDJ6DdHi2KQNjehTd8bWjFx7hAcMUM269iHpuwl8xZ+1ZJbxcRaA2JDFHOMCK23 3h2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=RgxMMldTnvRzPtzUgaKCZ6vh2b82ZORXGvXZR04lUYE=; b=eLRvfnCtjt1WXxU4AatbXfOjzOGSxOj4LqN+Q+utpty9Osv0h1gR1EciUqgmSbcz9x i3kkukcLZ+EABCZxIDt/AZqsXC0izUuv/zOy4OwvCDt40dVJEWG6XHVc1xeJfmkeMQUY vkoH8xzCe3IL7rZ+q8Jum6OEjED+GoJBdE8vARdM80+VJ9QbKmZ5zmOSiS80nTUT5lH6 UCsqhQellJ41cyCx7u69QcNzdx2O7imwgsiDi7TolP6pbO04Eb1D8x45pzCyZOib0HYj qwW0P6OpZuoOaZyjlHwgVrdFrlnmnD0HSgGqV5gjDEQFAThvGZr8VpRj837DQJV9hFrY QdFQ== X-Gm-Message-State: APjAAAVTzOxqJelUqqoUpsRF1M51Fa/dp8VwRO27m51OT08xmmm5VMi8 n6JRwB2Op3OHJNc2diPMY3jTmQ== X-Google-Smtp-Source: APXvYqzt9FZjhBKXDVaIaM3LSwalWDWgyFfprNMNShz1xpFuPOgHDrN48+K1mTciAKeVfkN8RV6ufg== X-Received: by 2002:a63:9e43:: with SMTP id r3mr16404116pgo.148.1565331386507; Thu, 08 Aug 2019 23:16:26 -0700 (PDT) Received: from jdavis.lan (c-71-204-186-7.hsd1.ca.comcast.net. [71.204.186.7]) by smtp.gmail.com with ESMTPSA id 131sm118231071pfx.57.2019.08.08.23.16.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Aug 2019 23:16:25 -0700 (PDT) Message-ID: <3bbf5968ea705700a2605d6db74d8510bea7940b.camel@j-davis.com> Subject: Re: Add "password_protocol" connection parameter to libpq From: Jeff Davis To: Michael Paquier Cc: pgsql-hackers@postgresql.org Date: Thu, 08 Aug 2019 23:16:24 -0700 In-Reply-To: <20190809030021.GG3194@paquier.xyz> References: <227015d8417f2b4fef03f8966dbfa5cbcc4f44da.camel@j-davis.com> <20190809030021.GG3194@paquier.xyz> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2019-08-09 at 12:00 +0900, Michael Paquier wrote: > What about auth_protocol then? It seems to me that it could be > useful > to have the restriction on AUTH_REQ_MD5 as well. auth_protocol does sound like a good name. I'm not sure what you mean regarding MD5 though. > This makes it sound like there is a linear hierarchy among all those > protocols, which is true in this case, but if the list of supported > protocols is extended in the future it may be not. We already have that concept to a lesser extent, with the md5 authentication method also permitting scram-sha-256. Also note that the server chooses what kind of authentication request to send, which imposes a hierarchy of password < md5 < sasl. Within the sasl authentication request the server can advertise multiple supported mechanisms, though, so there doesn't need to be a hierarchy among sasl mechanisms. > I think that this should have TAP tests in src/test/authentication/ > so > as we make sure of the semantics. For the channel-binding part, the > logic path for the test would be src/test/ssl. Will do. > Another thing that was discussed on the topic would be to allow a > list > of authorized protocols instead. I personally don't think that we > need to go necessarily this way, but it could make the integration of > things line scram-sha-256,scram-sha-256-plus easier to integrate in > application flows. That sounds good, but there are a lot of possibilities and I can't quite decide which way to go. We could expose it as an SASL option like: saslmode = {disable|prefer|require-scram-sha-256|require-scram-sha- 256-plus} But that doesn't allow for multiple acceptable mechanisms, which could make migration a pain. We try to use a comma-list like: saslmode = {disable|prefer|require} saslmech = all | {scram-hash-256|scram-hash-256-plus}[,...] Or we could over-engineer it to do something like: saslmode = {disable|prefer|require} saslmech = all | {scram|future_mech}[,...] scramhash = all | {sha-256|future_hash}[,...] scram_channel_binding = {disable|prefer|require} (Aside: is the channel binding only a SCRAM concept, or also a SASL concept?) Also, working with libpq I found myself wondering why everything is based on strings instead of enums or some other structure. Do you know why it's done that way? Regards, Jeff Davis