Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2187997lqb; Mon, 27 May 2024 10:34:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXh30zhYb/Ork0qzdvgRwUyAEp9Fh5WOeq8ONPXo4k24OPBB65pS9WNxdnvxegLoGwo5lKJa3xSphLhc1rGYOcosSVuUQ9ytu7ZSarN+A== X-Google-Smtp-Source: AGHT+IFYJo5yQ5y+DnsBcqX/f/7SbJHDNn4nvECQzSRdwPIdqCsP1l007Prma4GgY6fq2PPciWGV X-Received: by 2002:a05:6a00:e0c:b0:6f4:3b76:ebf7 with SMTP id d2e1a72fcca58-6f8f37060e6mr10274529b3a.20.1716831257369; Mon, 27 May 2024 10:34:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716831257; cv=pass; d=google.com; s=arc-20160816; b=tFrUe2koF2KVId53XMaPwq3d5dK6AhTPkF65ervhDzrOIAZOKWUf5TbWs19L9pjR3B YT6Aq35FM1T4HHzR6CWXBOMytKg/u6Hw/jqejeaD4sswkhsM/My2x8e2uIcLbdhGNe72 h5WBIdhL5zNMEHPD2h4sSmINoJVIXm4Y4XrAwu58FxNNPmOX8mlpFYGhlRbZJjvhqt07 Ttnl4iKRTXVA3K5YxpJnQ85oNEkR71/lI8ZNrsz9P4udWgWPbFnKeBsuOwEGcIfBEi8O WWa6+dRwTSgqMVirPrDx64NMAy62hEPdHmm7sZMD062Pfr5wijxud6KMuAjh5De3m8L4 m7Iw== 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=kUL4JEO5uP09fzc2s1EDbpa1JfFIn7hki3MXQClZ3ls=; fh=0wJU5NhRFZ/BZRuc3LkuJ4//tEO6JdUONtlfUtoL5JA=; b=r/LFkn8Q6nq3A6kbSTpU2PG5WCGA9HxJwO/+r2PGTcQZ42W4OcKuj1VTBuJBnJzNOI MXg1/pGmUOAVNGsz8BH3/+5hZz7gjAtFdmZzQZ63jCb3QhHHyDDKLons+i/74aK8l+mO es4Y9NiNHv0JXfETeE6HZcCKkVctZiMSsXJecp+pCAhuMxG5jDwbwr4NZdW1pUNT211N aHJEIyIZeM4mXTOOwrxoX4XvzjdLFvyVhlyPaydl2I8saotnuuxVro9Ou3zXwsKBXRrB pC+ZCa6lbwrJlqSJBGwTJ+/NbPaJmj0RS8BJ28XItu5ULy93F1thfnwBcO0ygyI4oawb npJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PU3FnkV0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4424-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fcfd7d39si6640768b3a.208.2024.05.27.10.34.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 10:34:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PU3FnkV0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4424-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4424-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8016F281EFD for ; Mon, 27 May 2024 17:34:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC1AA44C9B; Mon, 27 May 2024 17:34:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PU3FnkV0" 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 89CCB2628B; Mon, 27 May 2024 17:34:12 +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=1716831252; cv=none; b=uY/ILbu6l3ws5PHEreLoaKjvFEptjoc/uqxcEoTjBdccm4Eh5FfjgxGhY7n+4xl9P6kDrr9j5dJqPxBIRIWh71h42l5EjMRDAWQxo3kFI/gbyxmndBWawxuHNOua/zjMbs+02im/XbTcRsJ+FVf7qIFFPjjzfeas6GDb39OLrBY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716831252; c=relaxed/simple; bh=EkCcuQoEu2X7I/06oyPu6iBduaFvnvA2bE1UUNI0O3A=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=tJIQD8pfTvRuIfDOp0/Px710zVRqGi9wUiblaZbJI/wf7eSDKjpizmqMjFJCi9eqTiD1+d0f+PrGe7zn6S0/9Getpnb3HhuWMvJ8nQMf2q8Yudq2qZ83YNwpZEiJMN3gJoB/xL7OsGjXNJoAod1q8nQeOkZevFxk0FYZyU4vFTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PU3FnkV0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE9BCC2BBFC; Mon, 27 May 2024 17:34:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716831252; bh=EkCcuQoEu2X7I/06oyPu6iBduaFvnvA2bE1UUNI0O3A=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=PU3FnkV0A2antq7p5xHzQPo6q+Z0slZH5hh4+K9X+1QTlj1gHF0puBj/58mAuMI0c bFjfXsMwalM51UzSBety/eCvqshnbn1FtFpl5TUWy48qLh7zQFqKtwZQGoUpvBHX4u KR6xFRzv+/S4yJBzEXT/x3W8qouwhFdS/qhL/ATK6Us5cTnHuA+zilGVhKTn9sphgU VCAudiKmKBmOH9DAqXnCEMN9D8yMRpIHGPk1JMwUgspOc3DD5wKGRtxlRGVW7i+qNj 31cpgj3DG3DQIqt0HqMoHdX0CY6m6HLlcqsYkuWkBEBK0OLBFbejPmv84ewXvcIUeR BxmWPfpr+4iMA== 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, 27 May 2024 20:34:08 +0300 Message-Id: Subject: Re: ecdsa_set_pub_key From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , , "Stefan Berger" Cc: "Herbert Xu" , "David Howells" , X-Mailer: aerc 0.17.0 References: In-Reply-To: On Mon May 27, 2024 at 8:25 PM EEST, Jarkko Sakkinen wrote: > Hi, > > The documentation of ecdsa_set_pub_key() is the following: > > /* > * Set the public key given the raw uncompressed key data from an X509 > * certificate. The key data contain the concatenated X and Y coordinates= of > * the public key. > */ > > If you interpret this literally it would mean 64 bytes buffer for p256 > with two 32 byte blobs for x and y. > > With such buffer the function fails with -EINVAL, which is obvious from > the code that does checks on the contents. > > Instead of responding to this, can you please fix the documentation bug? > > There was also badly documented stuff in akcipher that has been > unreacted so far so putting also that one here: > > https://lore.kernel.org/keyrings/D1HCVOZ1IN7S.1SUZ75QRE8QUZ@kernel.org/ > > BR, Jarkko The best reference I could quickly find is Wikipedia: "The older uncompressed keys are 65 bytes, consisting of constant prefix (0x04), followed by two 256-bit integers called x and y (2 * 32 bytes). The prefix of a compressed key allows for the y value to be derived from the x value." The documentation says absolutely nothing about the prefix byte, and neither Wikipedia nor kernel documentation has a reference to this "older format". BR, Jarkko