Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qg9FC-00EaxW-Vk for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2023 19:40:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qg9FA-00AFyp-DN for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Sep 2023 19:40:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qg9F9-00AFxx-Sz for pgsql-hackers@lists.postgresql.org; Tue, 12 Sep 2023 19:40:15 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qg9F1-004CaY-Ur for pgsql-hackers@postgresql.org; Tue, 12 Sep 2023 19:40:14 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1c3bd829b86so19981965ad.0 for ; Tue, 12 Sep 2023 12:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timescale.com; s=google; t=1694547606; x=1695152406; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Zp/C6XOwnZ5IJTdViCuJ2V0aDNhe8i3WpeSWcG85rck=; b=WzbWZ9/Q+HrKiZAGAtZhk90V24P6PQ4KYnmXg4kOhV4DleRQPjPByJPq1l+Rf/piPj KQIMFtOQ/zfW9WUjD/Bi4f1NClh8OHt+KEVjyInz30FB7RuCtUTaHMCBMY2zbWiBxuE/ 7Z3QkSFApzipyoAmAkLfP5lJD32kEMaIbaFJd+A4EIhW2w7GkY765WdM56C708pUCxrC j3YoTtby3XF6sXuCE/YQnEQruE9EYabbJZ+hHoq5Qq0OSIaZH8mkNRVD6T3PV8YyNahN KRHN+D7v7RJU1bKR5WXzbm6hFRWtIOh4r5NF1iigM+mdNO4C78n6RQyCYW0hXdyoEHfr VgJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694547606; x=1695152406; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Zp/C6XOwnZ5IJTdViCuJ2V0aDNhe8i3WpeSWcG85rck=; b=UqSXwUOe2gTozyygILMlBDAdX3PKiPijwOg3khY2kvnh4Gfr3z0B1qf9WX5c+686Ie ja+GTCz7Wy+JaPqQt9elsEl3zSOCA7sWX/If/f3wWuxtC5OdJ2OjTMqW3Wb/61M3Dtgc gGdb26t27yse7zcpTN012aQZA34eLgH86IaGyB6+okiGgY76HxA58dD/xS7UAqfHQLTF D155ulfsr3s2LtLbtVpkV+uSZrqKXWnTE0dnYB/jGVEAZkcJr82x7kvk5QjXFYHvZNp6 OvNdVlmDHrTpqPLYM3CZGg5OTfqOL3aaWwPY/Lds/sp9cz/qTh5kiNtSmy80Hv+ARZ9Z DPoQ== X-Gm-Message-State: AOJu0YxCYfDZ0kVtPOWp4jcy4imu5y75nb9M6UjKgkjCHaMRndnZw5O+ YGNqm8mmnRNs0XSBYNV3V8htcw== X-Google-Smtp-Source: AGHT+IG3LqFLQWyDvGTHmaMdp+YdtCgo0Cx3lja9/Xo3Lrt2QAGXuyN+hc+N3yscrpGofjXng5Zviw== X-Received: by 2002:a17:902:d918:b0:1c0:cb31:d66 with SMTP id c24-20020a170902d91800b001c0cb310d66mr661167plz.7.1694547606429; Tue, 12 Sep 2023 12:40:06 -0700 (PDT) Received: from [192.168.1.27] ([50.53.8.205]) by smtp.gmail.com with ESMTPSA id h4-20020a170902f54400b001c322a41188sm8782088plf.117.2023.09.12.12.40.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Sep 2023 12:40:05 -0700 (PDT) Message-ID: Date: Tue, 12 Sep 2023 12:40:04 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: sslinfo extension - add notbefore and notafter timestamps To: Daniel Gustafsson , Cary Huang Cc: PostgreSQL Hackers References: <182b8565486.10af1a86f158715.2387262617218380588@highgo.ca> <42389B9C-D0AF-43B0-9554-EE38CE4505B2@yesql.se> <188e9e114e2.1168b3bda837794.3324050820866856527@highgo.ca> <10E8A199-26FF-4486-B00F-D3725577FBE4@yesql.se> <1890d814830.fd0e0b3d74296.8256991149346794664@highgo.ca> <513DF026-E3D9-48AC-86E0-CC30071D8EC2@yesql.se> <1894211830e.ef46f9012448790.7113590129448608981@highgo.ca> <18955b4d491.b58817e1615339.2313743524378473795@highgo.ca> <3B06C5ED-ED82-4583-9A70-BFCEC32E8689@yesql.se> <189651ac531.121770805396824.7203598683046078451@highgo.ca> Content-Language: en-US From: Jacob Champion In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, On 7/25/23 07:21, Daniel Gustafsson wrote: > The attached version passes ssl tests for me on 1.0.2 through OpenSSL Git HEAD. Tests pass for me too, including LibreSSL 3.8. > + /* Calculate the diff from the epoch to the certificat timestamp */ "certificate" > + ssl_client_get_notbefore() returns text > ...> + ssl_client_get_notafter() returns text I think this should say timestamptz rather than text? Ditto for the pg_stat_ssl documentation. Speaking of which: is the use of `timestamp` rather than `timestamptz` in pg_proc.dat intentional? Will that cause problems with comparisons? -- I haven't been able to poke any holes in the ASN1_TIME_to_timestamp() implementations themselves. I went down a rabbit hole trying to find out whether leap seconds could cause problems for us when we switch to `struct tm` in the future, but it turns out OpenSSL rejects leap seconds in the Validity fields. That seems weird -- as far as I can tell, RFC 5280 defers to ASN.1 which defers to ISO 8601 which appears to allow leap seconds -- but I don't plan to worry about it anymore. (I do idly wonder whether some CA, somewhere, has ever had a really Unhappy New Year due to that.) Thanks, --Jacob