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 1n7uTV-00014E-5w for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jan 2022 07:24:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7uTT-0001Ka-Ix for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Jan 2022 07:24:43 +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 1n7uTS-0001KQ-14 for pgsql-hackers@lists.postgresql.org; Thu, 13 Jan 2022 07:24:43 +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 1n7uTP-0001On-7B for pgsql-hackers@lists.postgresql.org; Thu, 13 Jan 2022 07:24:40 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id D9D40320070D; Thu, 13 Jan 2022 02:24:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 13 Jan 2022 02:24:37 -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=ouRhUtF+IEAE3iUhC0zvttD74a3 x3W8b1PHdBO6kUmA=; b=YVEbosTcvAvOu1KSqk3kJUvdVKE1vWZWsMUwydZE0SL Qbg3f+Wd1sPQgKO8qFIUeb4NrF6EU6FnmCmzLnvF3byCd6Oo7AAEwZcLnuskgHfH 0Wz0ggqzdM2sAmHsrYlvj1kZRpYSGgs0lVibFRv1O89TJ/E1I+tuUkznsHFDM2gl 6wefvKEQb61FHT46+LaWatxGkcF0Rrp56WB/omfPilSoTIpzN/AgNcv99dvOPe6p Jp3AxYjSYBzYtkBKzvzV4xaC5Wb/+4/07KNtnZ2uxu8pS9rZ1ZFxwyaislrRwBhi LAJWE7FOZG/4ISHnw5mQCRhPA2rwPYc0nQ8KxwuAlww== 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=ouRhUt F+IEAE3iUhC0zvttD74a3x3W8b1PHdBO6kUmA=; b=C1h45g1ntAm0lbBEV5JT+X LNVOqz+DjHi1duY0UMsUcInDiR7I3vSyZlqkPulkKAjRLa9Q5NDmjiYrk9ZQCiYt O9Pw9x4P2fNvvnwc0F4Knk34rDDzmkUUs8e4mitt49FYAT2MbrJQwzxODif+XUDK 6aOnqSDkowfzCgQ26THGhCs6/81+81WU+ESQdNN6Q23kLfrKnNSVVsizRtS5gCzR +4MGRhCRfBqKGQ9bT0xd7rLsF7cf2j6hBEoQgb+m1Uye+z396qVtMfN6skp2h+R3 s35zeCMA0nCPAy9oMMfGlCf+8vgNDlEUmiOTs00MSsGckVbkKdNtQcOtaGlOf/eQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrtddvgddutdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpedvgeduuefhtdeuleettdevjeeh heeiveeuieegleetgeeljeelieeuieehgeevhfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 Jan 2022 02:24:35 -0500 (EST) Date: Thu, 13 Jan 2022 16:24:31 +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> <71b9a5d2-a3bf-83bc-a243-93dcf0bcfb3b@postgrespro.ru> <8cbb56dd-63d6-a581-7a65-25a97ac4be03@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hPBfBTMaQaRxz81E" Content-Disposition: inline In-Reply-To: <8cbb56dd-63d6-a581-7a65-25a97ac4be03@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --hPBfBTMaQaRxz81E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 13, 2022 at 02:01:24AM +0300, Sergey Shinderuk wrote: > Gave it a thorough read. Looks good, except for errstr not set in a couple > of places (see the diff attached). Thanks for the review. The comments about pg_hmac_ctx->data were wrong from the beginning, coming, I guess, from one of the earlier patch versions where this was discussed. So I have applied that independently. I have also spent a good amount of time on that to close the loop and make sure that no code paths are missing an error context, adjusted a couple of comments to explain more the role of *errstr in all the SCRAM routines, and finally applied it on HEAD. -- Michael --hPBfBTMaQaRxz81E Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmHf068ACgkQnvQgOdby QH2zhhAAmtR028EoBkna4sP5Gp+gBmDuUhEHlvgTnr8MqlxbAL+RKYdD+7glWGhd Ksk8NpmgPaww6sEUAVvww8JXc58f5E/7GpNB0aems9hZXOSJ9fLkWwaGjI8ir7Yu t9yO0GG54P++FVIbRwW7u6cUY3G/1ykNYhg2B9px2vBY9A0PIzXlfLOxuoYT82wO 8cKCFSMeJF6ni4M+J7tK+drwkzTwjQYkv8GT2Sl2OxdICfmhoHUjRMS5rMD+KUWC hQvtyDfOlUTklKPjxdqbGTuxSDl8uR6KhKALCLsD8hi0hJmgl5GhbPkI3DiMTBxg VzSVP8ZWlcoUPbQrVW7JrX5FxbLfQ3yz8M0Er9pczp14jHGS/uI6rLjdeOVOQQq5 kVYx6qZLfuoP4i6UeF7zJvCGkim0K8nnWZUxNH3vX6cu1wNIXKVt7UNNjJ9wZsR2 xcJdZbCCZnalVm7MTjKew703naC71OdzilsQ6IJREcRYPvPIdVomtC9+37SbHjHf 6NkcLLcZF9q4pQ4vgcOjSYkn+IOwt53mm00F8SYmFgGvXBLRMh5Rn4K4G0taFs5u r5o2M86REy6/ycrK2rPrQ9ASKW9lW8pLTpcm1elR6L6nQDNntF7cN7QOdqAj6jQ4 ENSXTekodDd/leZnR0BLALib6NuRPljRsPq4THYNO5U3eoBLO+4= =B/5X -----END PGP SIGNATURE----- --hPBfBTMaQaRxz81E--