Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxPPf-0000Fa-A1 for pgsql-general@arkaria.postgresql.org; Wed, 05 Sep 2018 04:27:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxPPc-0003o5-PI for pgsql-general@arkaria.postgresql.org; Wed, 05 Sep 2018 04:27:28 +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.89) (envelope-from ) id 1fxPPa-0003ny-Tt for pgsql-general@lists.postgresql.org; Wed, 05 Sep 2018 04:27:28 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxPPV-0007wh-VD for pgsql-general@lists.postgresql.org; Wed, 05 Sep 2018 04:27:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AEB6821C1C; Wed, 5 Sep 2018 00:27:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 05 Sep 2018 00:27:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=IjhyjkfC43I6Nk0yTAeU6P6TqnIU1+GzQsusZF2e6IY=; b=5OP70Ccl GrF6K7bNowMQo8B5FW6F30rLNqO7H2RIRuunHhcqqYY6DXJRp6zcbBv0z56FEqQY KgkvPTqw4xAWPe4sK0necAGLTmCRG2Cleg2QToTBPJpdWQiqw1oJH57Iv3KaZkkY J3HvAVHXP8nplhxrkGrCZL2vJAnbsPZ/cXHqv1Aj28yh/tQoY0tLcrv+fqdLA15T XJ5Z5cb4ffy6zuyl7AZLeae6Qg/XJTy3zSzSEFNM8XVeLbqkZoshFsehkAEm8mUD KTZDV8GVXD5qBeLbOAD6yZcchTMpFPBYBGRcf3qXaGs38zwoTEAsl2uqnE9tTWMU 58e7Nh4D6mJrkg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=IjhyjkfC43I6Nk0yTAeU6P6TqnIU1 +GzQsusZF2e6IY=; b=tgZhpsEfU/bytvzmy4mcQwsRGFoOLFOXCpVYcJKe0daPI xc+9RP8K2ozidtmh5sa9qxbpbD/fCeHOroHTr7AngZHKLOeGpLwvSGG3cbG8fs+L 4qHwN63/0UXEJf7bgNu6rCnU54EDuF197jbyED3Axn1iFH4OtN4CgzkCE7e3+gxp GbMEOLK4gNsQ7OMsFz+VKqcZGwaXwM678slop31As3HS1vUyhP9m5JMw1wedpLxn udfphjMGW7ZmmlQ4z1CY+P3peBzlMRW5ntMgB4DAXxz2IQl/Z2s5exige4LXtB3M oV4KBHh9gd3OJtl4ZA0bfo/FYpfMqgK5Xq7rvLUjw== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (unknown [66.201.48.83]) by mail.messagingengine.com (Postfix) with ESMTPA id B0EA710293; Wed, 5 Sep 2018 00:27:19 -0400 (EDT) Date: Tue, 4 Sep 2018 21:27:17 -0700 From: Michael Paquier To: Alessandro Gherardi Cc: "pgsql-general@lists.postgresql.org" Subject: Re: scram-sha-256 authentication broken in FIPS mode Message-ID: <20180905042717.GL20696@paquier.xyz> References: <898098721.1290085.1536118171911.ref@mail.yahoo.com> <898098721.1290085.1536118171911@mail.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rFUhhEVnhEf/dYhU" Content-Disposition: inline In-Reply-To: <898098721.1290085.1536118171911@mail.yahoo.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --rFUhhEVnhEf/dYhU Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 05, 2018 at 03:29:31AM +0000, Alessandro Gherardi wrote: > It looks like scram-sha-256 doesn't work when postgres is linked > against FIPS-enabled OpenSSL and FIPS mode is turned on. >=20 > Specifically, all login attempts fail with an OpenSSL error saying > something along the lines of "Low level API call to digest SHA256 > forbidden in fips mode". The error comes from libc, right? Postgres can of course be configured to work with FIPS without patching it, it just needs to be enabled system-wide, which is what RedHat does, and what you are doing I guess? > I think this issue could be solved by refactoring the code in > sha2_openssl.c to use the OpenSSL EVP interface > (see https://wiki.openssl.org/index.php/EVP_Message_Digests=A0).=20 > Any thoughts? Is this a known issue? This report is the first of this kind since Postgres 10, which is where the SHA2 interface for OpenSSL has been introduced. So likely we'd need to look into that more deeply.. This has the strong smell of a bug. If your system is new enough, you should have sha256() & co as system functions, so you would see the failure as well? The regression tests would have likely complained. -- Michael --rFUhhEVnhEf/dYhU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAluPWyUACgkQnvQgOdby QH3JGw//c/HamZzyuXlT7NgeJkriS2plgO+Fpm87//12Cm9K2Wz/j4WT1xif25lu lUj//z0nGJKnd4dqXKK7y60SZhlcBkKiMItm5ZhvcP/stSXWQk8gQml/cbJVblz/ N96j0FMJniYjdxW/Shkk9QsU0owMUrOEVY5877PQDpUH84jdQJTbPLlCpqzD03wT OhXvkUtmkMfuJY7jaXVI2ngolwJTuqeM7W+9j91I+4jmPKJXwirj77TUgsBhLvrg 09xgVewW26yuTVAFe+jK5LR9SJv9/3zZNxAo5XGm6UQktv1sTj9kV5EQzM7H/TX5 cnLHGMe+tKG4XHFEqBsAedFc59Xn/UB7yZASrArcBZEaT4AAOP5jeh0QEk1P8/o/ uHtAqGCpOs+n5MZLdKNjC51MXSUSYA1XkJNxxfkeorrdvrAgaofwZYyb0sXopSXO 6o0IEndeamM1BPmmXc8cRvwk41h7QrtTdbQa9yQ1K9jtvyEHW+5eDx6iGDJYqVw6 AjTXpyOAT05E2q/T3gCiTMZ8MW6ps96uS8Kd6C3hxyYNNrqikciRzSc9XKhSOtL3 CsJ6b478P0eCF1hZ+vJgAsVoAgfbc0P06t7oEK4NWGP2I6an5mDYo+tMVjGUASXT /zziwzsTkQfA508sxzW4KuuT+qJEbOXOxrC4FRUP3qnpawzEgcY= =iDMv -----END PGP SIGNATURE----- --rFUhhEVnhEf/dYhU--