Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2284892lqo; Mon, 13 May 2024 13:29:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX5zPwsE/WBCWFuv8cAKvUtAWuF1m8has5br9r+qX4urcd9uGEtdGp0x9cCmlGy71XSyYTfEQL83oR/v8UG8XlW5l3UkNsEVc6QaNv6qQ== X-Google-Smtp-Source: AGHT+IEbk4+vu7LqeQrpeoUHt9I1rGZbaIWtHMiYjiZj5RH0pi8WwUYEpIM5x0JqlYbvEURg6n0o X-Received: by 2002:a05:620a:2205:b0:792:c14e:d1cd with SMTP id af79cd13be357-792c75775cemr1129604085a.15.1715632176933; Mon, 13 May 2024 13:29:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715632176; cv=pass; d=google.com; s=arc-20160816; b=eJ/z+XhOgLJDmQGBWEmAmxJdVpyHbNu7M+/MNwC3UiB4SvHON7dSjmI6oUz/9cFZ6q iewj5kadEDBDb0TKZq9TnmT+dv01W1K5xvKR9W1cMxxBRdl6kwbTZ7Btdx5jVYeKIasp A9h2Kms192zTwZwf2054iep0BXVj8CtRl6XWl/pEGZkPNLMkfLM3PshCvvJlA0xwDELD ppCi595rwI4wJdjpcr0NOYOzfXnscPG8GqRCsfGniufDo/mA9AlGyQ5h0X7xBT1dJOWU mPSyUfazrq7Xvk5z8euL9B3PORaE739pD5dOunbUX8aXWrj4D8NIKEEARJbqxFTyP5iZ 7uxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=tJr1x3drsvVI/amU0d8Vg7GM70Kp7rHygXZ6vBa3uzE=; fh=Eqw0WG3YABc5eBQJ5tk2EeKzgqvvpneIxHpRHCurzDU=; b=OVaWcybjLedFhCBESVZmbgPvRz9rG0bZ/OYPNn7Od5vTlxHwfqgnXg4ANfVMt/ILWq PJ/69CAlPcbmvzzIqu42X3z6dS5gp4P2Jf8IJy7d7N6HoPTBGwMLwKGbnCeCWL/0BaRO BPMM1lXkZRsarfpKySHhWgr+70naeBaE83VGe/mx2BObsaTwwqWaJ7TO2aHJNH/G/STu JAJZIxu6u7vMjR6IIEiLwu/HDdCOm1JlU00FXTBiptgrUBujcglWQGw0WaV5uucYn5+V K3ZT8ag9jb3XTfRcZGawYriVqeep74gDWV3vTWnYz4Rj5ENcu19j4/jLuQe5vmtQ45Bt jukg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jXNWKoCk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e101ae12fsi48624481cf.580.2024.05.13.13.29.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 13:29:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jXNWKoCk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4149-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A35FD1C20972 for ; Mon, 13 May 2024 20:29:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EDB717E586; Mon, 13 May 2024 20:29:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jXNWKoCk" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABF717E575 for ; Mon, 13 May 2024 20:29:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715632173; cv=none; b=nSP6Bdz/7yL9ttvQgCMYimAqID3k3jL3PjYGck5Q9BAIMSH+YDl4gyTyUIREvDcTUFh1+95vdJCkhr317/R54YLts0ZMr3VttkFt3Gj4mC7vhUuw0nePixyWjIkvwTnLUqajg0ZlBrUZWSTKw/pkbHzybTyooMFuCqG7kee9qOc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715632173; c=relaxed/simple; bh=tJr1x3drsvVI/amU0d8Vg7GM70Kp7rHygXZ6vBa3uzE=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=b5MGJK2hiziBqHMEmhxmunuvJPrV/gMpkS6ma4jpdLuakS06VsN2Hemcqp79FuvA4LEZtasex6+84/CY9adCvZv/HwB864raKiqJ+RKoXW08oiUHfCdcDsK39zxyUXUiunciQwbZ9pdrvC9pkDvcdHkua/nKBSOb3DiK4NSYsGM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jXNWKoCk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0F20C113CC; Mon, 13 May 2024 20:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715632173; bh=tJr1x3drsvVI/amU0d8Vg7GM70Kp7rHygXZ6vBa3uzE=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=jXNWKoCkXvj1RoTsMllyB1/R5Gs0eR/JAgI1/GKEWrnXGUH4ohzXE45/gx8juGlZa 59EG5KHL7k/vL8FSiEOc8eShQ4G2yjT7GOBP5atQNGrgLaP+BKAVVygMtp45SLwvv5 b9PW8j72Ij8GhiCDXHYp/x3HDbzi36vm+LDVWIb9b9DdJTRRPnrGaYMJhLAGg2kN9E v19cAVVL4y3c5rEvo1FHXfngVS/PlrIDnhweEsvIpCmjAX2vtRVuK70HgojrsYcotD LLyucxWGU5zVRb2pmJrf7/1pO1g6gLRHB/X/nORU9Pt1zSUGbQ/TeQ3Xaac15S+N5K oIgmbwWUsy+LQ== Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 13 May 2024 23:29:30 +0300 Message-Id: Cc: "David Howells" , "Simo Sorce" , "Stephan Mueller" Subject: Re: [PATCH v5 2/2] certs: Add ECDSA signature verification self-test From: "Jarkko Sakkinen" To: "Joachim Vandersmissen" , , "Herbert Xu" X-Mailer: aerc 0.17.0 References: <20240513045507.25615-1-git@jvdsn.com> <20240513045507.25615-2-git@jvdsn.com> In-Reply-To: <20240513045507.25615-2-git@jvdsn.com> On Mon May 13, 2024 at 7:55 AM EEST, Joachim Vandersmissen wrote: > Commit c27b2d2012e1 ("crypto: testmgr - allow ecdsa-nist-p256 and -p384 > in FIPS mode") enabled support for ECDSA in crypto/testmgr.c. The > PKCS#7 signature verification API builds upon the KCAPI primitives to > perform its high-level operations. Therefore, this change in testmgr.c > also allows ECDSA to be used by the PKCS#7 signature verification API > (in FIPS mode). > > However, from a FIPS perspective, the PKCS#7 signature verification API > is a distinct "service" from the KCAPI primitives. This is because the > PKCS#7 API performs a "full" signature verification, which consists of > both hashing the data to be verified, and the public key operation. > On the other hand, the KCAPI primitive does not perform this hashing > step - it accepts pre-hashed data from the caller and only performs the > public key operation. > > For this reason, the ECDSA self-tests in crypto/testmgr.c are not > sufficient to cover ECDSA signature verification offered by the PKCS#7 > API. This is reflected by the self-test already present in this file > for RSA PKCS#1 v1.5 signature verification. > > The solution is simply to add a second self-test here for ECDSA. P-256 > with SHA-256 hashing was chosen as those parameters should remain > FIPS-approved for the foreseeable future, while keeping the performance > impact to a minimum. The ECDSA certificate and PKCS#7 signed data was > generated using OpenSSL. The input data is identical to the input data > for the existing RSA self-test. > > Signed-off-by: Joachim Vandersmissen Unfortunately I don't have anything to complain about so: Reviewed-by: Jarkko Sakkinen Linus pulled 3/4 of my previous pull requests (TPM, trusted keys and keyring) so the road is clear for asymmetric keys pull request. BR, Jarkko