pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Alessandro Gherardi <alessandro.gherardi@yahoo.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: scram-sha-256 authentication broken in FIPS mode
Date: Wed, 5 Sep 2018 11:15:45 -0700
Message-ID: <20180905181545.GC2726@paquier.xyz> (raw)
In-Reply-To: <767499000.1481233.1536153579656@mail.yahoo.com>
References: <898098721.1290085.1536118171911.ref@mail.yahoo.com>
	<898098721.1290085.1536118171911@mail.yahoo.com>
	<20180905042717.GL20696@paquier.xyz>
	<767499000.1481233.1536153579656@mail.yahoo.com>

On Wed, Sep 05, 2018 at 01:19:39PM +0000, Alessandro Gherardi wrote:
> Hi Michael,I'm actually running postgres on Windows.

First you may want to avoid top-posting.  This is not the style of the
community lists and this breaks the logic of a thread.

> I added code to fe-secure-openssl.c and be-secure-openssl.c that reads
> the Windows "standard" FIPS registry entry, and if FIPS is enabled
> calls FIPS_mode_set(1). This is to mimic to behavior of the .NET
> framework.

That's rather uncharted territory, as you are patching both the backend
*and* the client.  If we could prove that sha2-openssl.c is actually
unreliable even if FIPS is enabled system-wide with either SCRAM
authentication or any of the other hashing functions, then I would be
ready to accept a patch.  Now, as far as I can see and heard from other
folks for at least Linux, if FIPS is enabled at the OS level, then
Postgres would use it automatically and SCRAM is able to work.  I have
yet to hear that this part is broken.  As far as I know from companies
within the community which worked on STIG requirements, the thing
works.

> Below is the code I added to fe-secure-openssl.c, the code in
> be-secure-openssl.c is similar: 
> Thoughts? I can try to fix the scram-sha-256 issue by using EVP and
> send you a merge request for the patch and the code below if you think
> my approach is correct.

That's a bit unreadable I am afraid :)
You may want to attach a patch after producing it with for example "git
format-patch -1".
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (13+ messages)  latest in thread

Message-ID: <20180905181545.GC2726@paquier.xyz>
Permalink:  ../20180905181545.GC2726@paquier.xyz/
Also on:    postgresql.org/message-id/20180905181545.GC2726@paquier.xyz

 · 

reply

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-general@postgresql.org
  Cc: michael@paquier.xyz, alessandro.gherardi@yahoo.com
  Subject: Re: scram-sha-256 authentication broken in FIPS mode
  In-Reply-To: <20180905181545.GC2726@paquier.xyz>
  References: <898098721.1290085.1536118171911.ref@mail.yahoo.com> <898098721.1290085.1536118171911@mail.yahoo.com> <20180905042717.GL20696@paquier.xyz> <767499000.1481233.1536153579656@mail.yahoo.com> <20180905181545.GC2726@paquier.xyz>

* 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