Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2582051lqb; Tue, 28 May 2024 04:43:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVg+GF4nNwPjqDiSMD8XfdYZcuu6A9sJbl0CDUiwkZlbFDKjsWNVUi1gYlPDYgAkTvntblB19vEvSwYse0/Iiw33xPxB7J32PVq6m6fNA== X-Google-Smtp-Source: AGHT+IFcYFMVqBmB0qN5hAzNC5xQPsA8gWJeLhWESvsoEk7jF9zaOerNBCCktGpr6+QlYtyFPbL5 X-Received: by 2002:a17:906:f592:b0:a62:ddc2:8493 with SMTP id a640c23a62f3a-a62ddc28a25mr938240366b.20.1716896594140; Tue, 28 May 2024 04:43:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716896594; cv=pass; d=google.com; s=arc-20160816; b=gklBbtXSl2fvzrqEPZxo39jR5RqZV9q0gydNi8Xzp4xt4GU57wevyGVDt8chAGbAhM 7VKFdxDZ7Boh8hXHnUpbUqOYtAB1bl4gKeeuAoK62YAPNQvu5aEAxVzlnORNXgJyEczN OSnMySD1xWKTdHf+pEX2XNcU7AFjjN3K1J6cDZWr5hEJLsd8a31HHaHUWozpYCs1DLpT F/Zigf4pGg2GZbbvWEjvgfUIxz8EfcQWO6l4d2I7Wyb5dUNHoegCUOFjYVRHsmUMTTmE w1VxHAcpkygI2SeUe5H/RGwCM4OMFyvVYw8swMXtgQ8ok9++uy7vbgiKRpBLJdn8jwzJ VtsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=xxt9e4qBmjjSBgaz5wJg1yxA/w/eio5Xu8qFL8pUrWo=; fh=hfnElRynhIb0tLaat9DXi3W5kbFamqMF2d022xPaJ0w=; b=qXRBnemcD9VVYhaIe24gB4gHCczLHJak1BzIbCdgiz/FrkraLr/OrQnIC8qftKm6IT 076c9ZlX34Ai8qts1/UjEtQ7rjlaoo/htNkvgrYaG0GMmxiVV7IDlgOPA6vd0+yWIisI wVW4Ds28xB2Mbh3LGvHJuZSJYcMcaEUE0iqYFrIOda127Cqjv8LP6DZ21lxyMkwplQWa 5AJCIHKjvjfh4a8On/SJ3Ds+ENaD/7GasLc/OTZc1JDVCde7jarzQi8irZyWw2yAcjop T1tfwjp9Tnsa140WxXM7jwjSdFs0rIF/s2nxgrUf5vmquOLnDMFrsP2rgMDftKekMb1f hq/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aWuxyqRr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4442-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a633612faa2si99394766b.452.2024.05.28.04.43.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 04:43:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aWuxyqRr; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4442-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4442-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D8E761F2266D for ; Tue, 28 May 2024 11:43:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D225A16C6BA; Tue, 28 May 2024 11:43:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aWuxyqRr" 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 8CAFA16ABEA; Tue, 28 May 2024 11:43:10 +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=1716896590; cv=none; b=RMddlzr+vI1rWHcthlADrfY22H+87v2CT0DGD96yvHvKmpcgT0QdQs214UT5uY8RSaCbsxtlcx/DM/UHPxoDWEh833ymyNm2o6aRpXkXC/crMmQa4E4p1j5FuWYUu1/6/Pe3W3sPHrzlVlOHkhWe/T50QTNUgAORYKrDWExPQuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716896590; c=relaxed/simple; bh=xxt9e4qBmjjSBgaz5wJg1yxA/w/eio5Xu8qFL8pUrWo=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=CrIQMhhBt6OYbZR/trbIXg3RlOY/2zEilc9UBfpDVn9bxo5eN44dU9t1eGsuDnHjSHCpafUIdVIGBMnMMfn3CuzamZJrcw4E67CC1YR68WjRDdv/rZCdkoYYX7DkQAXwOfXK3N3sDkGCtBRP+YVC4OQorwH7XQnpEyFx8fEGsBc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aWuxyqRr; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EB1AC3277B; Tue, 28 May 2024 11:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716896590; bh=xxt9e4qBmjjSBgaz5wJg1yxA/w/eio5Xu8qFL8pUrWo=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=aWuxyqRrL7SBD0Lc056tIYnG0ozig3/K5u5GooJ9r4/xmVau/SM/ea/QdKRQoox09 lueClrfRzEM7J+7Em7MXusroTlC2otOnEGjJfRwYQEXryzupeI7fo6L+n7JNu0U9m8 gnr+cImb9NJ6gTkene1DusbWmNBcBXnc5qCauUFfrKk5EHQjDXzYfaIi0xFvMHzsix HHrRDHXcJ+mtISGSc8tArZtDPjoCuVlTaspJRWOdlzIyDHua2DBCz9iiE3UHjkGHkU 0/dm1nrKO2Fw+7OW0MEch8XZWEFR0szjMRnuDnveYDWPMUhmchPtRlVilrz/cA0o04 OoOiejMofKX3Q== 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: Tue, 28 May 2024 14:43:06 +0300 Message-Id: Subject: Re: [PATCH] crypto: ecdsa: Fix the public key format description From: "Jarkko Sakkinen" To: "Stefan Berger" , "Herbert Xu" Cc: , "David S. Miller" , X-Mailer: aerc 0.17.0 References: <20240527202840.4818-1-jarkko@kernel.org> <0e3bfc37-53d6-422d-adb0-3ee23bbb0a8a@linux.ibm.com> In-Reply-To: <0e3bfc37-53d6-422d-adb0-3ee23bbb0a8a@linux.ibm.com> On Tue May 28, 2024 at 2:18 PM EEST, Stefan Berger wrote: > > > On 5/27/24 16:28, Jarkko Sakkinen wrote: > > Public key blob is not just x and y concatenated. It follows RFC5480 > > section 2.2. Address this by re-documenting the function with the > > correct description of the format. > >=20 > > Link: https://datatracker.ietf.org/doc/html/rfc5480 > > Fixes: 4e6602916bc6 ("crypto: ecdsa - Add support for ECDSA signature v= erification") > > Signed-off-by: Jarkko Sakkinen > > Reviewed-by: Stefan Berger I think doing TPM2 ECDSA is a good test for this code, which is not *that* mature in terms of age (from 2021 if I checked correctly). I just try to complain at instant when I see badly documented code, when using something new, because after a while you become blind to it... The code quality itself is IMHO in good level and I could understand what it is doing. The EKEYREJECTED that I got is I think my own fault. Have to just test the fix and send updated version of TPM2 Asymmetric Keys. Getting that patch set to the mainline will also support quite well crypto/ecdsa.c, which my code uses for verifying the signature using the public key. Just adding these bits to underline that I don't think in any level that any of this code would suck ;-) It is all good and working so far... BR, Jarkko