From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Make SCRAM salts and nonces longer.
Date: Fri, 05 May 2017 07:14:53 +0000
Message-ID: <E1d6XS1-0005PL-0C@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Make SCRAM salts and nonces longer.
The salt is stored base64-encoded. With the old 10 bytes raw length, it was
always padded to 16 bytes after encoding. We might as well use 12 raw bytes
for the salt, and it's still encoded into 16 bytes.
Similarly for the random nonces, use a raw length that's divisible by 3, so
that there's no padding after base64 encoding. Make the nonces longer while
we're at it. 10 bytes was probably enough to prevent replay attacks, but
there's no reason to be skimpy here.
Per suggestion from Álvaro Hernández Tortosa.
Discussion: https://www.postgresql.org/message-id/df8c6e27-4d8e-5281-96e5-131a4e638fc8@8kdata.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0557a5dc2cf845639d384801b6861ebbd35dc7ee
Modified Files
--------------
src/include/common/scram-common.h | 4 ++--
src/test/regress/expected/password.out | 4 ++--
src/test/regress/sql/password.sql | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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: Make SCRAM salts and nonces longer.
In-Reply-To: <E1d6XS1-0005PL-0C@gemulon.postgresql.org>
References: <E1d6XS1-0005PL-0C@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