From patchwork Wed Sep 22 11:12:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 1963 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id gIUZJ6WcS2FWCQAAIUCqbw (envelope-from ) for ; Wed, 22 Sep 2021 17:14:13 -0400 Received: from proxy17.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id 4FrfJqWcS2HwZgAAalYnBA (envelope-from ) for ; Wed, 22 Sep 2021 17:14:13 -0400 Received: from smtp4.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy17.mail.ord1d.rsapps.net with LMTPS id +J++JqWcS2EMXAAAWC7mWg (envelope-from ) for ; Wed, 22 Sep 2021 17:14:13 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp4.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: 08acc726-1bea-11ec-ba3a-525400760ffc-1-1 Received: from [216.105.38.7] ([216.105.38.7:49676] helo=lists.sourceforge.net) by smtp4.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id DE/16-02363-4AC9B416; Wed, 22 Sep 2021 17:14:12 -0400 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.92.3) (envelope-from ) id 1mT9YO-0006sv-VE; Wed, 22 Sep 2021 21:13:20 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1mT9YM-0006sa-3j for openvpn-devel@lists.sourceforge.net; Wed, 22 Sep 2021 21:13:18 +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:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ibPa2j6ry9g81+KhxcLWlE3vrkDn44EKybkN3H36O3w=; b=Te5DG0sf1z9bkGWLZSX9zEcYbV tUVdQ8TUVMV4zuD664ADqb89+XklvSP/ZRjvDT3eq2Tj/t4DyCbgXGvGsNfzdIxqaKv6uOiD1bOGS i75kSKLF/toXNFi2JS/9dFNKsYOw4v4NIe/xOEJnHZur5N1ByRWu+9lmv+DZg+Ggg6Jc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ibPa2j6ry9g81+KhxcLWlE3vrkDn44EKybkN3H36O3w=; b=HAKEEX/3fWskMmhOYu+tu/Zfeo 84Lr1UZ6PudlOtRsgS64yBePkyh9f4V7sejN4JuKWb6BOklJy5F1YXWpC7CbvcQ2ltmtv1R/uNp3I mceBoy+2v2l80i8PNSkfhUazwBUKAIHcn7Ct+n6aaZ8bbQLYDc/QWqXRdJp7Z1W7JtSg=; Received: from mail-qk1-f170.google.com ([209.85.222.170]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) id 1mT9YL-0022zC-Ft for openvpn-devel@lists.sourceforge.net; Wed, 22 Sep 2021 21:13:18 +0000 Received: by mail-qk1-f170.google.com with SMTP id 72so14567267qkk.7 for ; Wed, 22 Sep 2021 14:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ibPa2j6ry9g81+KhxcLWlE3vrkDn44EKybkN3H36O3w=; b=E51Zzq1bywNQ6DzDIuTPwK4MdUpwtNIkASt1cYF6JlAIEK41dshZHoeVgqYB9R4PSS A07cTNGLbQ95+kjDwH7WzVhu/P2DhikKOtAiW3sWxp3gdA3Jhb1gCcaDVA7LMv28dMXV Lxz1SXBQzaMQfe4d5/9yyqeTRWuDSFWUYYQnVgkn40IP14kdJqSs14Ef1dX6lyuVyXcD /g8sMWXvfyfwuxJnh22V9IO7v3xMnLdfdE5dFPBV3cNFuD5Me9kco/IO8yBpGMfkBaH5 c7Pp4IMKHoOK+t7fgiFvwOJGo94g/JT2mUMnpOByS2pn1X8r1rNV6tbaImGgPuC0S5MI bS2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ibPa2j6ry9g81+KhxcLWlE3vrkDn44EKybkN3H36O3w=; b=AfH8cJMm88D+xWk0oQcvZScBfIfnK9ICjVXmb+tvqLP6oILMUglyt39jxVlDySRhUG 0Xp5dmF6AYHqt9HtFzIYMHx3LpJrD/k6FGCxhg+1RtdEjWRUbtVwn1QB+E8rXsqhTAwp m7Ug5rqfgv/9KRSq9VklasF9J7cgy1x09eEFcLcwERxeMc4oRLJNmj0Vr0GDkHuo1d3q y+Ufa/Je7iRiP55bWDHiHscIpCU8jQFlLhR3d3UtErv3LH7NkctqYD70e062nB/Rjf0t 48DMK2uldHUDYPbz9LnB0I0vDSumTC2JJUu+OcafCt52SWEBuX26gHpu3dJYBPuFaCZk Axgg== X-Gm-Message-State: AOAM531nrnRPpV0VcD/JSbe6SBehKK5Y58hQGnuHbYZRTzG5QKGJ8D6C stzEqXFs9kL7kVKbpDJwLlQn66l1rw0= X-Google-Smtp-Source: ABdhPJwNc3IpwwwgSYXeRJD5xog3ubiBK1aX2SvwcAeS3+lTRYFulb/tYmbSx7VYoPV76LG1OWD47w== X-Received: by 2002:a37:b805:: with SMTP id i5mr1519685qkf.167.1632345191591; Wed, 22 Sep 2021 14:13:11 -0700 (PDT) Received: from uranus.home.sansel.ca (bras-vprn-tnhlon4053w-lp130-02-70-51-223-227.dsl.bell.ca. [70.51.223.227]) by smtp.gmail.com with ESMTPSA id l7sm2185243qth.19.2021.09.22.14.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 14:13:11 -0700 (PDT) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Wed, 22 Sep 2021 17:12:54 -0400 Message-Id: <20210922211254.7570-10-selva.nair@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210922211254.7570-1-selva.nair@gmail.com> References: <20210922211254.7570-1-selva.nair@gmail.com> MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-1.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: From: Selva Nair pk-sig request from management can currently indicate support for 'nopadding' or 'pkcs1i' signatures. Add 'pss' as an option to indicate that PSS signing requests are accepted. To match, extend the algorithm string in PK_SIGN request to include the following format: Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [selva.nair[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.222.170 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.222.170 listed in list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1mT9YL-0022zC-Ft Subject: [Openvpn-devel] [PATCH 9/9] Allow management client to announce pss padding support 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 From: Selva Nair pk-sig request from management can currently indicate support for 'nopadding' or 'pkcs1i' signatures. Add 'pss' as an option to indicate that PSS signing requests are accepted. To match, extend the algorithm string in PK_SIGN request to include the following format: - RSA_PKCS1_PSS_PADDING,hashlag=name,saltlen=[max|digest|auto] Here 'name' is the short common name of the hash algorithm. E.g., SHA1, SHA256 etc. Signed-off-by: Selva Nair --- doc/man-sections/management-options.rst | 8 +++++++- doc/management-notes.txt | 15 +++++++++++---- src/openvpn/manage.h | 1 + src/openvpn/options.c | 7 ++++++- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/doc/man-sections/management-options.rst b/doc/man-sections/management-options.rst index de0d47e7..b173a1ea 100644 --- a/doc/man-sections/management-options.rst +++ b/doc/man-sections/management-options.rst @@ -90,9 +90,15 @@ server and client mode operations. management-external-key management-external-key nopadding management-external-key pkcs1 + management-external-key pss + + or any combination like: + :: + management-external-key nopadding pkcs1 + management-external-key pkcs1 pss - The optional parameters :code:`nopadding` and :code:`pkcs1` signal + The optional parameters :code:`nopadding` :code:`pkcs1` and :code:`pss` signal support for different padding algorithms. See :code:`doc/mangement-notes.txt` for a complete description of this feature. diff --git a/doc/management-notes.txt b/doc/management-notes.txt index 84e3d04b..27163239 100644 --- a/doc/management-notes.txt +++ b/doc/management-notes.txt @@ -1019,10 +1019,17 @@ can be indicated in the signing request only if the client version is > 2" The currently defined padding algorithms are: - - RSA_PKCS1_PADDING - PKCS1 padding and RSA signature - - RSA_NO_PADDING - No padding may be added for the signature - - ECDSA - EC signature. - + - RSA_PKCS1_PADDING - PKCS1 padding and RSA signature + - RSA_NO_PADDING - No padding may be added for the signature + - ECDSA - EC signature. + - RSA_PKCS1_PSS_PADDING,params - RSA signature with PSS padding + + params for PSS are specified as 'digest=name,saltlen=[max|digest|auto]'. + The digest names are short common names such as SHA256, SHA224, etc. + In the case of PKCS1, when the hash algorithm is not the legacy MD5-SHA1, + the digest is encoded with DigestInfo header before presening to the + management. This is identical to CKM_RSA_PKCS in cryptoki as well as + what RSA_sign() provides. COMMAND -- certificate (OpenVPN 2.4 or higher) ---------------------------------------------- diff --git a/src/openvpn/manage.h b/src/openvpn/manage.h index 04dc98d1..5ed27c0c 100644 --- a/src/openvpn/manage.h +++ b/src/openvpn/manage.h @@ -339,6 +339,7 @@ struct management *management_init(void); #define MF_QUERY_REMOTE (1<<13) #define MF_QUERY_PROXY (1<<14) #define MF_EXTERNAL_CERT (1<<15) +#define MF_EXTERNAL_KEY_PSSPAD (1<<16) bool management_open(struct management *man, const char *addr, diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 26305a90..6e71563f 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -2213,7 +2213,8 @@ options_postprocess_verify_ce(const struct options *options, #if defined(ENABLE_MANAGEMENT) if ((tls_version_max() >= TLS_VER_1_3) && (options->management_flags & MF_EXTERNAL_KEY) - && !(options->management_flags & (MF_EXTERNAL_KEY_NOPADDING)) + && !(options->management_flags & (MF_EXTERNAL_KEY_NOPADDING) + || options->management_flags & (MF_EXTERNAL_KEY_PSSPAD)) ) { msg(M_ERR, "management-external-key with OpenSSL 1.1.1 requires " @@ -5511,6 +5512,10 @@ add_option(struct options *options, { options->management_flags |= MF_EXTERNAL_KEY_PKCS1PAD; } + else if (streq(p[j], "pss")) + { + options->management_flags |= MF_EXTERNAL_KEY_PSSPAD; + } else { msg(msglevel, "Unknown management-external-key flag: %s", p[j]);