Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp187011lqb; Thu, 23 May 2024 15:03:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXjI/Clf9bngLKyd/tvZK3QIeVXQ8Ab5AFF470BtQQQan4K4sb1UCxhpl/6YPeiUR/RLD3vzk5+BF/WBJPeC/zjRvT3YJkSC4zwuUUuVg== X-Google-Smtp-Source: AGHT+IFNVgCqZzQHahfBtGpu/oJM2ZDU+QKIsawMn0PYGVA8lu1BMKbQRiiwQ12o0WuBtqr3NBD/ X-Received: by 2002:a2e:b050:0:b0:2e1:e0cc:e4e1 with SMTP id 38308e7fff4ca-2e95b27af25mr1750311fa.50.1716501809350; Thu, 23 May 2024 15:03:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716501809; cv=pass; d=google.com; s=arc-20160816; b=0MfmPZXM8MxAnIF2mnRNtj62CKJ8Gv7O9GRuGqNOHGzz5BxcilnPASOx45YyoZp1AF GNUiMGCD2CUzMBnyqZsnRiLFJidA/NQHSvzeJns8SO9DLuMa9IJiCvasDd9VY9LZ0zjE 3GMyMdPPIRAPd7gxsPtVGaG9clNJmv17bmDhrQBzrlinGuxNVwvhjhQuwcYhNxOGyLRv cDCMjB1WqyV2SwW7/7vc57Dlu77C+3q56RNxVtnXqu9uccS9z+PXLDSw5/0Z4tQmageA wJ8LHB1ypl1bpnvp/7/bxAq98aS+bkAaEKVY9P9bzF3omVl7AS3cWh1ROdjvnihnfNuh YMvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=Jvsdm22HkVK9xx5B7+O1lfeQJby3kZROb76Gky9oMlQ=; fh=CgL0k16p4VZtKWksdBivUUQ8211FLW4IRLBGSyXWqNc=; b=ju/cAyrdqiislK2QJyGTW6RmnakKDhkVeYYCnTT75dJnK9II02LMZNvEgjmbqRoDWu 6v/1LZQNCMHsOipEzdT4URePXfs2x4ghOKUu0waQpumhapOszXx0iUwolaODweW1fnV3 ABSRaCMY35cz5xtvDLnq/7v4BtNPJEw6S2kkItzw0AaDHogJYEdAi24JfEuHqxsTqZth 3wX3d3su2OQqCyrf0FMgavpP1y9Mxnd+s4CchlattshFOG4h6m7hwr272OPpJ//cFbS+ qcDqz+N91tJK9GUWmEl7+ZZ9eE0KI6u3jPvgq3Lb6g0G+Q5pd9eujyxgCVPleLnj1GrB pZmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RSnhl9Z0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4380-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. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-578524b499esi125199a12.523.2024.05.23.15.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 15:03:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RSnhl9Z0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4380-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 3114C1F24E90 for ; Thu, 23 May 2024 22:02:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E14E127E3C; Thu, 23 May 2024 22:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RSnhl9Z0" 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 D70F682D9A; Thu, 23 May 2024 22:02:50 +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=1716501771; cv=none; b=mCXQRFyPiv7ZgkD/0zQEPD5UB4+wqp/b5g3L8v53PNnLeozvls1d3vsvNBjhe39Cz1zsZlocG/q6+MGR/sPDl00HaT6FgFOVn340kMSfXaI3q1n3qajbErXn+yf6tLcZmnJi/UZ/LsuKBZEcVT4OsbbXdbK259IIG3/s7J2+wQ0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716501771; c=relaxed/simple; bh=MkxHSfTiHM+Phs6yvFjdnUfl4fNZsmBCrS3G4WLC9yA=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=RrJ7FeeMY7yMfqwqeRMltpjPDdXVOyjPPrTDdA8MA3DrHWwOz1VuKhdWbLymgxQw8SSkm2gCOLDTf0FUaRClPAxOAWDcfw4V/VrecRsygAun2fXm21cSptp57bizpg/BEiECSd4CJ3Jt0pvKd39Megt7s3weGrmMq6sk48ZqtuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RSnhl9Z0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0648C2BD10; Thu, 23 May 2024 22:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716501770; bh=MkxHSfTiHM+Phs6yvFjdnUfl4fNZsmBCrS3G4WLC9yA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RSnhl9Z0jhBQu9KzKaFJyVrRTIFvATUsrIKLnfrcI+nx/QP8EQVlnfLmfeRUaSo4B 8jvghvNNpuKcMsGWXeHfR68oat6DzbfT6y70dFzveqgCeQetzMU+cRh/p/viAhSaA9 uJpgD2B7BdvLcWupM62XOQrxC7N9DpEezCmrPrwaEHalXGRCh05Y/39fRgMpN9xz87 Eg5xR34cupGUvqHq2Qqh8VedsEQmEKmtFz+IBjlAL3u1Qm47fkWJswh5Ma7cDiyMtC ssi+CishOGjcDohlUr15JO6D27+/PI089/R4Cf0YIIdfrDgXpdsTpEbyzvqZQIXKE4 jd22eg6ekW+6g== 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: Fri, 24 May 2024 01:02:45 +0300 Message-Id: From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , "Herbert Xu" Cc: , , , "James Prestwood" , "David Woodhouse" , "Eric Biggers" , "James Bottomley" , , "David S. Miller" , "open list" , "David Howells" , "James Bottomley" , "Stefan Berger" , "Ard Biesheuvel" , "Mario Limonciello" Subject: Re: [PATCH v5 5/5] keys: asymmetric: ASYMMETRIC_TPM2_KEY_RSA_SUBTYPE X-Mailer: aerc 0.17.0 References: <20240523212515.4875-1-jarkko@kernel.org> <20240523212515.4875-6-jarkko@kernel.org> In-Reply-To: On Fri May 24, 2024 at 12:52 AM EEST, Jarkko Sakkinen wrote: > On Fri May 24, 2024 at 12:39 AM EEST, Jarkko Sakkinen wrote: > > On Fri May 24, 2024 at 12:25 AM EEST, Jarkko Sakkinen wrote: > > > + /* > > > + * ABI requires this according include/crypto/akcipher.h, which say= s > > > + * that there is epilogue with algorithm OID and parameters length. > > > + * Neither size nor semantics is documented *anywhere*, and there's= no > > > + * struct to hold them. > > > + * > > > + * So zeroing out the last eight bytes after the key blob seems lik= e the > > > + * best bet, given no better (or any) information. The size of the > > > + * parameters (two u32's) was found from crypto/asymmetric/public_k= ey.c. > > > + */ > > > + memset(work, 0, 8); > > > > This is a mystery (or nightmare). > > This is from akchiper_alg documentation: > > * @set_pub_key: Function invokes the algorithm specific set public key > * function, which knows how to decode and interpret > * the BER encoded public key and parameters > > No struct, no size information and no description what they are used for. > > Can we get these properly documented? My documentation at the moment > is grep and kprobes, literally. That said, zero issues with the interface, just pointing out the part that is not right, and should be fixed. I mean I have three layers: this, rsa-pcks1 and rsa. How I can be sure that either of two layers below never ever up until sun melts will do any changes that would break, with the data that I put there? Is this a contract that will hold forever? This is concerning so I have to point this out. BR, Jarkko