Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4M9q-0001lq-Bt for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Nov 2016 06:14:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c4M9p-000719-Uv for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Nov 2016 06:14:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c4M8R-0005SM-No for pgsql-hackers@postgresql.org; Wed, 09 Nov 2016 06:13:23 +0000 Received: from mx.wagner.pp.ru ([78.46.190.96]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4M8N-0004ii-Sd for pgsql-hackers@postgresql.org; Wed, 09 Nov 2016 06:13:21 +0000 Received: from mail.wagner.pp.ru (unknown [192.168.217.131]) by mx.wagner.pp.ru (Postfix) with ESMTP id 885F6E086D for ; Wed, 9 Nov 2016 09:13:10 +0300 (MSK) Received: from fafnir.local.vm (mail.postgrespro.ru [93.174.131.138]) by mail.wagner.pp.ru (Postfix) with ESMTPSA id E4893207E6 for ; Wed, 9 Nov 2016 09:13:09 +0300 (MSK) Date: Wed, 9 Nov 2016 09:13:09 +0300 From: Victor Wagner To: pgsql-hackers@postgresql.org Subject: Re: Password identifiers, protocol aging and SCRAM protocol Message-ID: <20161109091309.6437a8b3@fafnir.local.vm> In-Reply-To: References: <79774ac1-df34-6b20-1659-c020c3842ce1@iki.fi> <4f3a9e71-cb1b-ca44-a780-36d503671e45@iki.fi> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Tue, 18 Oct 2016 16:35:27 +0900 Michael Paquier wrote: Hi > Attached is a rebased patch set for SCRAM, with the following things: > - 0001, moving all the SHA2 functions to src/common/ and introducing a > PG-like interface. No actual changes here. It seems, that client nonce generation in this patch is not RFC-compliant. RFC 5802 states that SCRAM nonce should be a sequence of random printable ASCII characters excluding ',' while this patch uses sequence of random bytes from pg_strong_random function with zero byte appended. It could cause following problems 1. If zero byte happens inside random sequence, nonce would be shorter than expected, or even empty. 2. If one of bytes happens to be ASCII Code of comma, than server to the client-first message, which includes copy of client nonce, appended by server nonce, as one of unquoted comman-separated field, would be parsed incorrectly. Regards, Victor -- -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers