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 1o9O9M-0000rD-Nn for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jul 2022 09:50:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o9O9L-0001Du-9f for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Jul 2022 09:50:19 +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 1o9O9K-0001CB-9p for pgsql-hackers@lists.postgresql.org; Thu, 07 Jul 2022 09:50:19 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9O9G-00039E-Ck for pgsql-hackers@postgresql.org; Thu, 07 Jul 2022 09:50:17 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A6A2E32006F2; Thu, 7 Jul 2022 05:50:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 07 Jul 2022 05:50:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1657187411; x= 1657273811; bh=cxNfCQ5zaELteanYB+d9IxWofE2FAs1EI1pn5Aoizs4=; b=q 8zlyuEu80zBMjvmtOyMY2A2ZW2pEQp3Nr+feHq27Qu/+q5EPGW2Xj4ttrCve1mu6 W7RcTK41de7vGvkVm7OfaxM31ovL1TLL6onDtzpX3SRX/QuK6O9mxVczehIK3Q5c W+o7XDoZxuiE4sRJP/PGxH/YtDBJxrTNEDewqeaBLVpXqKBU9G1VrrwW5sOSB2Ls 3y/1F1b3tPgSy5hqXrsBmi2SIILjjbUAIiVMySVMOrMGV7YmlLBL7lhV2zgdE9qB mXw9+QCZBFF+olzfcMQewZKYqKlVQnW/AafsYXGQfYRGsUfwbFmMwBqZxrAzk/NW UZYRWg48FZB0EBPQp/vnA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeihedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeehleffgeegudejteei hfelteduvdeifffhffdvjedvffegjeekudeludehudeifeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Jul 2022 05:50:10 -0400 (EDT) Message-ID: <61aa4b6c-9de2-d61b-821a-a34ab1e515e2@enterprisedb.com> Date: Thu, 7 Jul 2022 11:50:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] Log details for client certificate failures Content-Language: en-US To: Jacob Champion Cc: "pgsql-hackers@postgresql.org" References: <290871e5-f1d9-54a8-5df4-dbd9e604c08d@enterprisedb.com> <7c0468dcadbc0d0c987daf9ca08c8d111948eae6.camel@vmware.com> <9b8338210b865d79239ec35ca523792ce331c0a3.camel@vmware.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 05.07.22 18:34, Jacob Champion wrote: > On Fri, Jul 1, 2022 at 1:51 PM Jacob Champion wrote: >> Sorry for the misunderstanding! v3 adds the Issuer to the logs as well. > > Resending v3; I messed up the certificate diff with my gitconfig. This patch looks pretty good to me. Some minor details: I looked into how you decode the serial number. I have found some code elsewhere that passed the result of X509_get_serialNumber() directly to ASN1_INTEGER_set(). But I guess a serial number of maximum length 20 octets wouldn't fit into a 32-bit long. (There is ASN1_INTEGER_set_int64(), but that requires OpenSSL 1.1.0.) Does that match your understanding? For the detail string, I think we could do something like: DETAIL: Failed certificate data (unverified): subject '%s', serial number %s, issuer '%s'