pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alessandro Gherardi <alessandro.gherardi@yahoo.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: scram-sha-256 authentication broken in FIPS mode
Date: Mon, 10 Sep 2018 14:52:00 +0000 (UTC)
Message-ID: <1168852455.1352488.1536591120175@mail.yahoo.com> (raw)
In-Reply-To: <1924578892.946938.1536301653576@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>
	<20180905181545.GC2726@paquier.xyz>
	<1691863835.972001.1536301001998@mail.yahoo.com>
	<1924578892.946938.1536301653576@mail.yahoo.com>

 I changed the implementation of the other SHA digests to use EVP also.
I verified that, with these changes, scram-sha-256 works when FIPS is enabled.      

Attachments: download all (2 files, .tar.gz)

sha2.h.diff (application/octet-stream, 354B) download 55d54 < #include <openssl/evp.h> 74,77c73,76 < typedef EVP_MD_CTX* pg_sha256_ctx; < typedef EVP_MD_CTX* pg_sha512_ctx; < typedef EVP_MD_CTX* pg_sha224_ctx; < typedef EVP_MD_CTX* pg_sha384_ctx; --- > typedef SHA256_CTX pg_sha256_ctx; > typedef SHA512_CTX pg_sha512_ctx; > typedef SHA256_CTX pg_sha224_ctx; > typedef SHA512_CTX pg_sha384_ctx;
sha2_openssl.c.diff (application/octet-stream, 1.6K) download 26d25 < #include <assert.h> 28,50d26 < static void < digest_init(EVP_MD_CTX **ctx, const EVP_MD* type) < { < *ctx = EVP_MD_CTX_create(); < assert(*ctx != 0); < int rc = EVP_DigestInit_ex(*ctx, type, NULL); < assert(rc == 1); < } < < static void < digest_update(EVP_MD_CTX **ctx, const uint8 *data, size_t len) < { < int rc = EVP_DigestUpdate(*ctx, data, len); < assert(rc == 1); < } < < static void < digest_final(EVP_MD_CTX **ctx, uint8 *dest) < { < int rc = EVP_DigestFinal_ex(*ctx, dest, 0); < assert(rc == 1); < EVP_MD_CTX_destroy(*ctx); < } 56c32 < digest_init(ctx, EVP_sha256()); --- > SHA256_Init((SHA256_CTX *) ctx); 62c38 < digest_update(ctx, data, len); --- > SHA256_Update((SHA256_CTX *) ctx, data, len); 68c44 < digest_final(ctx, dest); --- > SHA256_Final(dest, (SHA256_CTX *) ctx); 75c51 < digest_init(ctx, EVP_sha512()); --- > SHA512_Init((SHA512_CTX *) ctx); 81c57 < digest_update(ctx, data, len); --- > SHA512_Update((SHA512_CTX *) ctx, data, len); 87c63 < digest_final(ctx, dest); --- > SHA512_Final(dest, (SHA512_CTX *) ctx); 94c70 < digest_init(ctx, EVP_sha384()); --- > SHA384_Init((SHA512_CTX *) ctx); 100c76 < digest_update(ctx, data, len); --- > SHA384_Update((SHA512_CTX *) ctx, data, len); 106c82 < digest_final(ctx, dest); --- > SHA384_Final(dest, (SHA512_CTX *) ctx); 113c89 < digest_init(ctx, EVP_sha224()); --- > SHA224_Init((SHA256_CTX *) ctx); 119c95 < digest_update(ctx, data, len); --- > SHA224_Update((SHA256_CTX *) ctx, data, len); 125c101 < digest_final(ctx, dest); --- > SHA224_Final(dest, (SHA256_CTX *) ctx);

view thread (13+ messages)  latest in thread

Message-ID: <1168852455.1352488.1536591120175@mail.yahoo.com>
Permalink:  ../1168852455.1352488.1536591120175@mail.yahoo.com/
Also on:    postgresql.org/message-id/1168852455.1352488.1536591120175@mail.yahoo.com

 ·  · 

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: alessandro.gherardi@yahoo.com, michael@paquier.xyz
  Subject: Re: scram-sha-256 authentication broken in FIPS mode
  In-Reply-To: <1168852455.1352488.1536591120175@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> <20180905181545.GC2726@paquier.xyz> <1691863835.972001.1536301001998@mail.yahoo.com> <1924578892.946938.1536301653576@mail.yahoo.com> <1168852455.1352488.1536591120175@mail.yahoo.com>

* 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