Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp1006334lqp; Thu, 23 May 2024 06:41:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfsDUdvmzbJbAGyuAWVwvW+zsY1sXjdf1SHog4Uye8Xgggsr9HRQuu0GguR3zYphtXNK88q4gT1EPp9pOdLFSJyXc5hBr5yqvg3iljdQ== X-Google-Smtp-Source: AGHT+IGO7z7jdpDssxCo9PBtW8Jn/FNA4T60mlnlUmwjZUnGcYoUx6KH+CfWg5eYgHQnyoLgFNeR X-Received: by 2002:a17:902:e74f:b0:1f3:32f:c235 with SMTP id d9443c01a7336-1f339f42dffmr34616775ad.34.1716471680000; Thu, 23 May 2024 06:41:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716471679; cv=pass; d=google.com; s=arc-20160816; b=L0ZK9qRIOYYpYA0ahNNSdaUtDn4X5kMTGLtRs2eBrqsWZ5O6hESbtaHIAd6F92vquJ gG52Va7RNRxCvPWeOflUUJPjW2j6L7b6EwRlbLvQMcwcjF8SM/Bmo43LTKyzCrGcGWMV vNqovQ782OiiBWSgDMxLH/MJY+0y3RGMLlGmzTuHdjGccrP7DWr6yQ5HsgLtCt9bw7HL xzwr5mZQu7/FxtdC+ojN7jYYAVGIhim3X2NbJdy98CnTGSMsWnP1SR4cRmuAx4dZ0YdO aBDnBkJsMuuukjEZmUdHA1JtG7Q1WpcpFqYKxj59QSlg026xl8jRUpQWwhRVCbfkjraN crTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:feedback-id:dkim-signature :dkim-signature; bh=mRnx5COVI0LWUi/LFa3Yn+dBzWKQMQVX8mCS5YjrH3Y=; fh=842BbODrIwUGOD0huzbjFRFcMbTA3at+3nSB0pWBnss=; b=UXLSUr7Ue6cyseXbRGLiE0q0oGMXA+piyc12pmheoTlLjhCd/xtKSBNhNyeEVsMY6m bpIqK/MWYJhzx4gdTo8GcqeKZeZa7sRJgqA4KVQ0xIsz6Csfto+/X7FtUxhHn4yQHYMG d3iR+ngmJDZxdVkq3+OPZiP8GIh8xJH74J9X/4CX5aonb/+tsbHQZCIO0dAwAWCp+zQo /jaPAAmKGuzRTqR2MNFT1Zjc72rLVO6C9nH/LkI8KZsUm7A83lguDJGmiznk53mWUfho 2GT/lBJTaTWwc6pf0upbp6oHzkJwRRNH8djZf1nM81tQFM5Moh9eTcmPOziW/WJ40iRO Lj9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@benboeckel.net header.s=fm3 header.b=MRTMLC6Q; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=CH7HJe7u; arc=pass (i=1 spf=pass spfdomain=benboeckel.net dkim=pass dkdomain=benboeckel.net dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-crypto+bounces-4353-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4353-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bad473esi19906635ad.184.2024.05.23.06.41.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 06:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4353-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@benboeckel.net header.s=fm3 header.b=MRTMLC6Q; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=CH7HJe7u; arc=pass (i=1 spf=pass spfdomain=benboeckel.net dkim=pass dkdomain=benboeckel.net dkim=pass dkdomain=messagingengine.com); spf=pass (google.com: domain of linux-crypto+bounces-4353-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4353-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E732BB20E73 for ; Thu, 23 May 2024 13:41:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEDD314A4FC; Thu, 23 May 2024 13:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=benboeckel.net header.i=@benboeckel.net header.b="MRTMLC6Q"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CH7HJe7u" X-Original-To: linux-crypto@vger.kernel.org Received: from wfhigh6-smtp.messagingengine.com (wfhigh6-smtp.messagingengine.com [64.147.123.157]) (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 C2A0013B7B3; Thu, 23 May 2024 13:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716471670; cv=none; b=hSWNeBDAlsbOmWQT7xdCgqCWObRuI+PaqL3aL6BeKDfnsDJedxN/9hnWndeyFkcrhfIv4Iw63zrbRT10gXLBwEpGB8R+oDxFfm72dKLG9MOhglfprNZ1bfpr1K2krw48qxkPA3K2DtEC91OoZ9cvgwZDVoNZ1ZcmKc81TBfoIo0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716471670; c=relaxed/simple; bh=+5mIF7Xs1S52MlyNiTrZXhoj1RZF0L6UZJv60N3/q4A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J11l5hNGA5cretvdFOsWeO66BNxxcFWSakqPMbfHQNYrO97CldokrIVvmhzZnie4J1ttumbiLJ3DUfX7Pgr3g/NQzYZgyA7B05oaetmIbtg+8Zi+195+m1V3oaxuSNU7pAMKd/PuGgGMcRmk8tcZKjq3+DLLpnJNc5slzy1jOTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benboeckel.net; spf=pass smtp.mailfrom=benboeckel.net; dkim=pass (2048-bit key) header.d=benboeckel.net header.i=@benboeckel.net header.b=MRTMLC6Q; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CH7HJe7u; arc=none smtp.client-ip=64.147.123.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=benboeckel.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=benboeckel.net Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.west.internal (Postfix) with ESMTP id BC10E1800167; Thu, 23 May 2024 09:41:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 23 May 2024 09:41:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=benboeckel.net; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1716471665; x= 1716558065; bh=mRnx5COVI0LWUi/LFa3Yn+dBzWKQMQVX8mCS5YjrH3Y=; b=M RTMLC6QwvUKwunisoJo+GmL7cqhgOOOX9TbQJUbw23vOaSQR4NjbvcN6mhdJYb7e aV6BU9SdvJIC8nXPLzHi4g/dJ4RGfqituK8yQaBZw/qbPLGPDbGxPuOA9KtOJvuP lq3Fk65V5t52FHhRUTw8n6eknT3Etra10p34ohOolKapDKotmcvKjACufp6LzdB7 sKdS3kVPHvLcNFMt8LtaLX3dWoPXVBRwNDk4zPpCa0A84uz2LjTwON6PfE+6NldH 2sGem4VLAPfAlN+AZvvdG0dIT2qmiOyXPPk2eAqUN9nWGr1hLKhN11iqcJ04uPBz e0BpmQP2aZ1wUTGB8OUqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1716471665; x=1716558065; bh=mRnx5COVI0LWUi/LFa3Yn+dBzWKQ MQVX8mCS5YjrH3Y=; b=CH7HJe7uCQ27n7ovFF8rTNAADbDEJ0Y0m7OpDPikdres 8qIW8ChFuw//gZuLKdmYF/lSwyocDHeB2sW7z3cD0T7yRp96YOWuDPtJpUARsmOb 6iWvlEo4oy9FCIeKOXyhFbPV7y84tAx4jsqQ3pCSJoleQdCVwUp/uPEs74R5BdUT JNhCOP+bMBQNc9mtJECwoAyBMV5jjnO0qQ+t7KR9xJhhOa4Lr3/Zhi8TiJH4Bjfo lK46u8Ve0SnfGk5p+bf0CrnEiz9OmefZVChL/F6rP6G81Oh8789SYpD6HyX1y1Bo Km7AeJxC11Im8eD7TBI/2nFpIwj10vgVqi654ia4WA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeiiedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujggfsehttdertddtreejnecuhfhrohhmpeeuvghn uceuohgvtghkvghluceomhgvsegsvghnsghovggtkhgvlhdrnhgvtheqnecuggftrfgrth htvghrnhepffelgeffveelkeffkeehiefgtdeluedvtdfghfdtvdefgfejheffudeuveek vddvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh gvsegsvghnsghovggtkhgvlhdrnhgvth X-ME-Proxy: Feedback-ID: iffc1478b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 23 May 2024 09:41:03 -0400 (EDT) Date: Thu, 23 May 2024 09:41:03 -0400 From: Ben Boeckel To: Jarkko Sakkinen Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org, David Woodhouse , Eric Biggers , James Bottomley , Herbert Xu , "David S. Miller" , Andrew Morton , Mimi Zohar , David Howells , Paul Moore , James Morris , "Serge E. Hallyn" , "open list:CRYPTO API" , open list , "open list:SECURITY SUBSYSTEM" Subject: Re: [PATCH v2] KEYS: trusted: Use ASN.1 encoded OID Message-ID: References: <20240523132341.32092-1-jarkko@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240523132341.32092-1-jarkko@kernel.org> User-Agent: Mutt/2.2.12 (2023-09-09) On Thu, May 23, 2024 at 16:23:37 +0300, Jarkko Sakkinen wrote: > There's no reason to encode OID_TPMSealedData at run-time, as it never > changes. > > Replace it with the encoded version, which has exactly the same size: > > 67 81 05 0A 01 05 Is it the same size? It looks considerably smaller to me (6*4 bytes versus 8 bytes). > Include OBJECT IDENTIFIER (0x06) tag and length as the epilogue so that > the OID can be simply copied to the blob. An "epilogue" occurs at the end, but it seems to be at the beginning here (that would be a "prologue"). > -static u32 tpm2key_oid[] = { 2, 23, 133, 10, 1, 5 }; > +/* Encoded OID_TPMSealedData. */ > +static u8 OID_TPMSealedData_ASN1[] = {0x06, 0x06, 0x67, 0x81, 0x05, 0x0a, 0x01, 0x05}; I'd say that a comment of what it encodes would be good to have for context, but the source tree has `OID_TPMSealedData` in a header with the value in a comment there, so that seems good enough to me. > as it never changes. Should it, perhaps be `const` too? --Ben