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 1n7C2B-0000I3-0I for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jan 2022 07:57:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7C29-0006Gs-CS for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jan 2022 07:57:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7C29-0006Gj-1H for pgsql-hackers@lists.postgresql.org; Tue, 11 Jan 2022 07:57:33 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n7C22-0004nM-FB for pgsql-hackers@lists.postgresql.org; Tue, 11 Jan 2022 07:57:31 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id BA80932003C0; Tue, 11 Jan 2022 02:57:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 11 Jan 2022 02:57:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=35JFImq7RyjenoCJZqgz3HN5kdr 7Ps4wtqLmpjS459I=; b=E9+u1YQCin5StiY0pFj7pxkozU8+W6ft6Cz89WapQJk I9CtV1r0ieWbtfaOiwDJz8RLAHgp7h5OfRReK8AxVo2VlgaNwgi9YI1cH/gnmDLm 02kujd08CmBbESf3m9YLxVXxwA/TElvVo6i59IyhgS278uYDEwO89SBHB6ukUklV ovg/VTm++OrT0J+BZalTE/U2EYv0iwBrnjQ6SRN6pnMk4FYk+6zQzwkZLWlFoGlV jZKbkHmFmgr45xU1WYrhUoyJVzl87T5eU6ShE3dQC5nzDN6Z22XO2Usf1uYZU8+z uvqnEBYLZjx//RQiEXhoDQ5pwTWYXCGkGNMzE21mYAg== 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-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=35JFIm q7RyjenoCJZqgz3HN5kdr7Ps4wtqLmpjS459I=; b=k0bu33HxeQt+U40fffsv91 WSmloVCrEzdairUHfNSGFkO0UgoMg6xWErCwNY1G9ezTAAjhAhWNZbTWVnMI9X8x sEtw9EWEHKH329Q72JBauXYn55bWaswDeRJ9l3/FL4SRToyCn05lc9oUaOesxR8e 4FtGlHVOO8riGryzV6NOY8G7Pao3vcjcQE/DD+MQRPq0uS1d5vbRlpuDMZTIYS0F CRyxw76HhOrEkEpSDspKQSPGEKJdAdq25lV5zEcg9Ary7ljcrOou0YfuJQEBTVmO jVvp5FS1qGH3pvuzLlqod+1MVMaZXCC1UPrX3FneSU5ATA6G8+4gjDHK1uc+ltkQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudehvddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveej heehieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Jan 2022 02:57:22 -0500 (EST) Date: Tue, 11 Jan 2022 16:57:19 +0900 From: Michael Paquier To: Sergey Shinderuk Cc: Postgres hackers Subject: Re: Improve error handling of HMAC computations and SCRAM Message-ID: References: <066c0624-fbb7-a025-afd6-d54683a96947@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="I7wdeyvqBxbYrPXa" Content-Disposition: inline In-Reply-To: <066c0624-fbb7-a025-afd6-d54683a96947@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --I7wdeyvqBxbYrPXa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 11, 2022 at 10:50:50AM +0300, Sergey Shinderuk wrote: > A few comments after a quick glance... Thanks! > + * Returns a static string providing errors about an error that happened >=20 > "errors about an error" looks odd. Sure, that could be reworded. What about "providing details about an error"? > We already have SSLerrmessage elsewhere and it's documented to never retu= rn > NULL. I find that confusing. This name is chosen on purpose. There could be some refactoring done with those things. > If I have two distinct pg_hmac_ctx's, are their errreason's idependent fr= om > one another or do they really point to the same static buffer? Each errreason could be different, as each computation could fail for a different reason. If they fail for the same reason, they would point to the same error context strings. -- Michael --I7wdeyvqBxbYrPXa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmHdOF8ACgkQnvQgOdby QH0ctRAAp89WN0m1D2AN75zxXxdSxYdfw6JhI9d/bhq/o9slCNC/nrCh+VvFwbPC n81f+LrprzTBbZeRQwz0Pq3xCEN6FbQ4BsgGk3ynAdwTU5cEDHbzGnHhxkdE+fXs nk8EP0U/6tRliuCDL20wZ41XrGnfOTfQny8AcQZYk5AV+aDu+rovJgoyms4SW6E1 U0gULUV28fVZ162xZsqqUF91qqHKkg6FnZVl8BEhSEGCNJYNFAPWz373aayla+Ji GHWJ5y9DpAF2RIkoE+MIvQLvpf8jqaTUY45RefC/nN3N0Y04Hsk8QY1tyLEKyds/ fSauhtodyADFBTwgxcT7OlvZDa6NJzN6IUnAYdYblTy8C1zejwXaXpo2OysXCe4d 2WJ5uNUAv+KnAFbdgbRz0G5IPi33JXsFwUadTvt0ZxXPwmEVxrfl3/iHKSfJRZfl KGZS0i0T2FPnajTPXCgHV65wk/caKg1jPPDb/tJjsIKevp5S+NQhwwFFsq6ZZ7hs OxtiMfz05faD1L2IZKh95o/RLGoDPITvdFFeRxsOjB6xTnprahiRuhR8/blVg9Fu Su3KLfxOngvqwcGIcl4raiNnV36484tZnTOxR1tORDuTF87CksUmBTQQGs0FXYbX KeYmCEpFrSJJdiSox5hPCAYUGYWVFcmPaDpRtwsyUseHJGBaKD8= =KGty -----END PGP SIGNATURE----- --I7wdeyvqBxbYrPXa--