Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp182284lqb; Thu, 23 May 2024 14:53:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiKVMuP4g4BEP/svPz/dx3OPQ/i3c0+bP1Md2wIQf+PPA5v++V+HwGaM8+crto1WarIUS902e9FJAkaUQkn+ao7dlGZmz5b/cQsQvZUQ== X-Google-Smtp-Source: AGHT+IE+U+5eEQSQ5RnzKobNXtXaSj09ex0q6xVvXC+CBC0qP4pRPtCoePYkLe7USzVWA1lUs8Ex X-Received: by 2002:a50:9b14:0:b0:572:3b3c:754f with SMTP id 4fb4d7f45d1cf-57850c19067mr588328a12.4.1716501211721; Thu, 23 May 2024 14:53:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716501211; cv=pass; d=google.com; s=arc-20160816; b=RstWyLU/TQ/sx519fUUKwzckLZtmvc3caQMLLhaeJ0jzXN1w/vSw0gUlbZ5vJfDKQf muqlD+Yk70Q8fV5x0ZA6MB1tK5bNo7E36INFsvv2scI1OVeZB/q69A4W31TMJjrTxesw uR1ZStpg8tnNthE+vQRCgKOvP3ZA18vSGmoa+znRe8Jkc1ylZbb11P3vod6Tgio2SmQV O0e9zhfIP9ABf9OB8SClwC0LvJKMj37AhhZH3CdBcvGPHED9Oekr+ZntGw1rOgADYnVs c2YHIRUFQlJZ6v4z4dP+iOrNbrWTMETnKgOJQc8mRLqkNeXsqQlTgixsrKLKjnK1MeJJ wbvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=NCWiW/gZgoCMR9g2vitXym6LfXu6Kcd/6hlvoBxuxvE=; fh=CgL0k16p4VZtKWksdBivUUQ8211FLW4IRLBGSyXWqNc=; b=J8ve+pwrK2F1hjy486yl6lAOY9A8TcQ1hjS3MIyIblmqFlTTB3f+33rRD/qAa6uwOP PXahTVYOONVkLz21PAI248qaOMpJtxCziYFoLM4/7MsNDcVIIqo/TzdMef5vjaQbeKku X69JtLo/Bd9n4bCCtdths8LFI++mwCE+zpCmSR5D5xJw/MHCDWRpJYPdYAICZkG6YMHB cBUdiSoI7Usx3GCTqXcUCgGiabI8QzeHuQOPmCbcrMHpOuaAz3bK5sSFYi6POJoDRa/z Aw0ZbNrc2xYB/71a/X8mNbPtud6hTj3iFU1ZjSL1KR5JEWMtMeoTAQV1Ltp/60RRNl5o eLaA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N+QTRAc1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4379-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4379-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-5785233115dsi135391a12.2.2024.05.23.14.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 14:53:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4379-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=N+QTRAc1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4379-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4379-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 EE6C41F2509B for ; Thu, 23 May 2024 21:53:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95E4A128801; Thu, 23 May 2024 21:52:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N+QTRAc1" 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 3CF8C12837E; Thu, 23 May 2024 21:52:49 +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=1716501170; cv=none; b=hFSBNKEO26RG6YRlWi6qG6LetlNMkdjd0aYROhOmojf6nKdJIz5XLus/Q4VgeGdR36v0Jzojl92ZUjUL1QUTXuoQiBcRku3AABZJNpNgMcADehCNRe9B3WsKqLwy2uoINVYndQsGeek5o6FdyI5UsRCL8xSuf9VARoe6nJmbixw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716501170; c=relaxed/simple; bh=qVXCdb9gwnJoKTwqTDhw5JHJWQVhusvlDAvTSUdAPNA=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=QDsmSkrBASVtwvMBlJD+pBoRH/dM1AFPB3FdHsJcuHUs1qBhf9V436ch2VJlTmcA4OI995yY/n3i1P1Qe9UFbn4eSirb8vSMeuc30zYZhhRJ9CSa0584lWsEB2Jtcw8ZdUcVl8b6GRAZEaXNx7bO0nTnw0EkORm6ugDzBy+Kr8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N+QTRAc1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 540A5C3277B; Thu, 23 May 2024 21:52:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716501169; bh=qVXCdb9gwnJoKTwqTDhw5JHJWQVhusvlDAvTSUdAPNA=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=N+QTRAc1vqCf6bb6jlX8pcoBnHH0ZHS4WSWeqk4QWQAbwlSXP4+QRTxc6DyZdyhYo UhElfJ7/a+UnL1Lg9fNdl64D/D7sEe33fXbTqPfqJwsRF9k/9/i+A6NvL+k3evJZ5a 1nPSzcCYcOst0tpv65+/Hvdm/ixRjvMtSBR48gLJkGTrRzxE7Z4Pc/Q9U7VVhSeARZ F+wCkyi5wTjH8kAO1/ecrDmA7SJrgEklcQhRxw+O6mNHxlkhg2eJjL3OvPmRg9q/Jj pHagKMt5mAtvokwNGR26zi0LUYHn4Ah04hxRmxFutXXoJjdJuQXttpZ+coHS3F6hsT UaG2G6+jm2KrA== 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 00:52:44 +0300 Message-Id: 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 From: "Jarkko Sakkinen" 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: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 says > > + * that there is epilogue with algorithm OID and parameters length. > > + * Neither size nor semantics is documented *anywhere*, and there's n= o > > + * struct to hold them. > > + * > > + * So zeroing out the last eight bytes after the key blob seems like = the > > + * best bet, given no better (or any) information. The size of the > > + * parameters (two u32's) was found from crypto/asymmetric/public_key= .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. BR, Jarkko