From patchwork Wed Dec 13 14:33:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lichtenheld X-Patchwork-Id: 3526 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:8d12:b0:fc:24ac:f0cb with SMTP id i18csp6547112dys; Wed, 13 Dec 2023 06:34:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IF58QrIT9tfEjyT4xrpf/x3Ao9rmOaupTdUnd6GQqXlpCB9npWHRMDfZHpHl4oHr4m0XS1H X-Received: by 2002:a05:6a00:2d9e:b0:68e:2fd4:288a with SMTP id fb30-20020a056a002d9e00b0068e2fd4288amr17042514pfb.3.1702478083312; Wed, 13 Dec 2023 06:34:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702478083; cv=none; d=google.com; s=arc-20160816; b=Un6NrznvY6U30SM+FfSAMPEqEJoMJMQGHmW9ZOmlgn2P/ES5rHio8XLZ+VUUPb01rA hJrWUikKgjep6zP4W7c7lxdpPTLP5w8S4cRyPKzwVp0i4+1FtIuxxKWVK3fNIKCI/3OR wo6xhmFEWHqf3ml3zWNFIHTx1iJ2BZIPHgqNY2CqRLf1wQ2Eq7EXZt0x5M8aLB3STI4S OC+5yUvaSYVUyr2adnWVG9PZ4YgO/FEF5TLcyjh8KesvvXEqP+EZaSkSeXWAKsYkRDCn lo5AummpMX9SihxfPUkZ1T03Nmv/RMbcGlZPMCt3ssGD8jweQBmNWHNP/9sNgh0YjERV T9Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:dkim-signature :dkim-signature; bh=S6r4BblLe27tGkgQMN3YyVAs4pz2S9eO23f6xSX65SM=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=tP1eZGYctnFeH6SEDTSQ+jlQDXNnFwNVc/5a8UaWx/q3xpX8JnQ/rojy8rYQ0wZBuD Ckdda8LuO4H8o86yJutKHvy3/hIvXggPHetRUKcjIZqQhsQckFeGK5A2HiHjCsHrweSR CvCAg6ZbHDCwG84MarBu99nunCui3fy3P6sEDR6uxHoA+QYoyDcdr3uHKrvO152Sst8w IjiU8ekrjGxFxq5y4KlzHsyBRbHzyquV6rzipmt9x5XS+ypsgKH6/0cjEHs303JDIs/Q WwcdhnLtncmwwj/uqOUvixl7mPuIaO3aI1cwxRELTmuhN90QHuvvzz80Asfiiqpy42zz rFIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EER9UbdZ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=b8Qgh30V; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=T6Tr7fft; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id b13-20020a630c0d000000b005bd66bfc253si9434669pgl.148.2023.12.13.06.34.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2023 06:34:43 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=EER9UbdZ; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=b8Qgh30V; dkim=neutral (body hash did not verify) header.i=@lichtenheld.com header.s=MBO0001 header.b=T6Tr7fft; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rDQJ4-0006S6-BU; Wed, 13 Dec 2023 14:33:53 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rDQJ0-0006Ru-Pv for openvpn-devel@lists.sourceforge.net; Wed, 13 Dec 2023 14:33:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4BQA9aOXqQbaG0CHklcN9k+n/4nSTdHMCeP18sQbodo=; b=EER9UbdZFRpA5WMQ4hAlVoyij2 AvGYkRU6V/ulnP9+PSRhRCtsKCJEI36TPt7LPaFCZzgjj6SLhgoq2BUedjkLMSyORPquc4BwPnqpA 7sT/0EOtezdLNukogyjySHsstMlQ2rnQZo9r0Sh/Bz9v/aaUNNOaLybb6urJrUX8dUkc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=4BQA9aOXqQbaG0CHklcN9k+n/4nSTdHMCeP18sQbodo=; b=b 8Qgh30V6oRYj2oRfEda4uA3T2h78iz/qoJTtcAF6tVoDJSUoPTXpWKBRcqC7HIt2YENlkoPLWjBxd vQwWBpmAZN0HacHb75OlQAv34MRtk4f8zo4ZkVjE/2v3gD2H0yrj6RlZODsjGb6t+hKSMgG6IDqb5 9pJkwPQk3KCQLJlc=; Received: from mout-p-202.mailbox.org ([80.241.56.172]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rDQIw-0004DC-3d for openvpn-devel@lists.sourceforge.net; Wed, 13 Dec 2023 14:33:47 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Sqydd4YdYz9srX for ; Wed, 13 Dec 2023 15:33:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lichtenheld.com; s=MBO0001; t=1702478005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4BQA9aOXqQbaG0CHklcN9k+n/4nSTdHMCeP18sQbodo=; b=T6Tr7fftMMi6UIyC7AFSeszCWZBu7UrBHfQ6zm6z0yLDLZifCkq0bWcDf23Yb9HLqTC/IP B+aowB4D1ljpaJK8oskysh8pqQdDglEQdwRkwcSXtn5qV5Cc2MAD3Cbgum6N70SZ/ufVbG RIQM9csjmEb/rDNj/WIw1epMeU9mBfcqrTtnegTWs2eY8YrrUAHcFYNbxG+JN5PeGvjvFJ gqtJLPg/o2AsCOYgh67NUSadDQyV71mixu0HoWgabg1EE96W7DgzfxDSd9r0vBkZ9R4nr8 097jlJrBpfQAbiz28YQAGt170MK1+gTK6iEO04kQsAvHpwiz3uQvJKI556XkLg== From: Frank Lichtenheld To: openvpn-devel@lists.sourceforge.net Date: Wed, 13 Dec 2023 15:33:24 +0100 Message-Id: <20231213143324.226443-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Sqydd4YdYz9srX X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: In the current state it was completely unclear to me how you would use this. Extended the description based on reading the code and experimentation. Change-Id: Ibf728f9d624e64ecda094d66fa562bd3916829d2 Signed-off-by: Frank Lichtenheld --- doc/man-sections/script-options.rst | 3 +++ doc/man-sections/tls-options.rst | 23 ++++ [...] Content analysis details: (-0.9 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [80.241.56.172 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.172 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Headers-End: 1rDQIw-0004DC-3d Subject: [Openvpn-devel] [PATCH] documentation: improve documentation of --x509-track X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1785177658816400402?= X-GMAIL-MSGID: =?utf-8?q?1785177658816400402?= In the current state it was completely unclear to me how you would use this. Extended the description based on reading the code and experimentation. Change-Id: Ibf728f9d624e64ecda094d66fa562bd3916829d2 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering --- doc/man-sections/script-options.rst | 3 +++ doc/man-sections/tls-options.rst | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/man-sections/script-options.rst b/doc/man-sections/script-options.rst index ba700a04..0e60ab5a 100644 --- a/doc/man-sections/script-options.rst +++ b/doc/man-sections/script-options.rst @@ -934,6 +934,9 @@ instances. verification level is 0 for the client certificate and 1 for the CA certificate. + You can use the ``--x509-track`` option to export more or less information + from the certificates. + :: X509_0_emailAddress=me@myhost.mydomain diff --git a/doc/man-sections/tls-options.rst b/doc/man-sections/tls-options.rst index 266167f2..4c45b10f 100644 --- a/doc/man-sections/tls-options.rst +++ b/doc/man-sections/tls-options.rst @@ -695,10 +695,29 @@ If the option is inlined, ``algo`` is always :code:`SHA256`. --x509-track attribute Save peer X509 **attribute** value in environment for use by plugins and management interface. Prepend a :code:`+` to ``attribute`` to save values - from full cert chain. Values will be encoded as - :code:`X509__=`. Multiple ``--x509-track`` + from full cert chain. Otherwise the attribute will only be exported for + the leaf cert (i.e. depth :code:`0` of the cert chain). Values will be + encoded as :code:`X509__=`. Multiple ``--x509-track`` options can be defined to track multiple attributes. + ``attribute`` can be any part of the X509 Subject field or any X509v3 + extension (RFC 3280). X509v3 extensions might not be supported when + not using the default TLS backend library (OpenSSL). You can also + request the ``SHA1`` and ``SHA256`` fingerprints of the cert, + but that is always exported as :code:`tls_digest_{n}` and + :code:`tls_digest_sha256_{n}` anyway. + + Note that by default **all** parts of the X509 Subject field are exported in + the environment for the whole cert chain. If you use ``--x509-track`` at least + once **only** the attributes specified by these options are exported. + + Examples:: + + x509-track CN # exports only X509_0_CN + x509-track +CN # exports X509_{n}_CN for chain + x509-track basicConstraints # exports value of "X509v3 Basic Constraints" + x509-track SHA256 # exports SHA256 fingerprint + --x509-username-field args Fields in the X.509 certificate subject to be used as the username (default :code:`CN`). If multiple fields are specified their values