Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n5xuJ-0000JP-O1 for pgsql-general@arkaria.postgresql.org; Fri, 07 Jan 2022 22:40:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n5xuI-0003kQ-Bw for pgsql-general@arkaria.postgresql.org; Fri, 07 Jan 2022 22:40:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n5xuI-0003kH-1D for pgsql-general@lists.postgresql.org; Fri, 07 Jan 2022 22:40:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n5xuF-0003k1-Pl for pgsql-general@lists.postgresql.org; Fri, 07 Jan 2022 22:40:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 207Me9xF1387392; Fri, 7 Jan 2022 17:40:09 -0500 From: Tom Lane To: Michael Paquier cc: Christoph Moench-Tegeder , Michael =?iso-8859-1?Q?M=FChlbeyer?= , "pgsql-general@lists.postgresql.org" Subject: Re: md5 issues Postgres14 on OL7 In-reply-to: References: <89B7F072-5BBE-4C92-903E-D83E865D9367@trivadis.com> <4038656.1641318875@sss.pgh.pa.us> <4190764.1641362933@sss.pgh.pa.us> <1084379.1641487204@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Fri, 07 Jan 2022 11:14:29 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1387390.1641595209.1@sss.pgh.pa.us> Date: Fri, 07 Jan 2022 17:40:09 -0500 Message-ID: <1387391.1641595209@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Thu, Jan 06, 2022 at 11:40:04AM -0500, Tom Lane wrote: >> Also, I wonder if this shouldn't be unified with the SSLerrmessage() >> support found in be-secure-openssl.c and fe-secure-openssl.c. > Guess so. HEAD could be poked at for this part. I recall looking at > that once by that did not seem worth the complications. Yeah, I suppose there's only a couple lines of code to be saved, and the complexity of dealing with multiple memory allocation conventions would outweigh that. > What do you think? Hm, you still have cast-away-const in md5_crypt_verify and plain_crypt_verify. Can we adjust their APIs to make them return const char * as well (and then their API spec is that the caller must never free the string, rather than being vague about it)? The other thing that bothers me slightly is that it looks like some code paths could end up passing a NULL string pointer to ereport or sprintf, since you don't positively guarantee that an error will return a string there. I suppose this is safe since 3779ac62d, but I don't really want to start making API specs depend on it. regards, tom lane