Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp1039355lqp; Thu, 23 May 2024 07:26:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQnkQ9QlyIdmL6MLgkpzsBQYhNFkDn/L3egQz9pqyfxSxm+4bVHL0QAkPW2/qpmeNo623m81n51eNtekTcvC5Vf/0EvS3P56gQmIFZfQ== X-Google-Smtp-Source: AGHT+IHfeME5O+Y/bWZZIvqpHf1YM5rvKaF8tBHGy7BkpHOorUl5AT8EH6/HKlKB4hcu8f7echKj X-Received: by 2002:a67:f892:0:b0:47b:ab0d:b3f2 with SMTP id ada2fe7eead31-48a2bb79961mr2154263137.9.1716474391352; Thu, 23 May 2024 07:26:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716474391; cv=pass; d=google.com; s=arc-20160816; b=HxSxc6iT9VHM/mjUWPivbH0lS4WCH/l35aYJGHIswwVptjDI6tAxEQ48ck4V8e8hBt SEnmnTbigG82Y/eu6JYefc3z/lV2In5dMDKrGQAnoylEyODBEsCj0IkYsP57TZXp1OZn lHUiPCr3I2PwJFGBKbARv8u3CDVm9/Uwcadaj99KFey1o9ZgNJdFjlpGHQhpL5Joa7gZ c05kxyHJUmBNWlRqH7ckRlc9gaEA1zw14bVM4PYCNugaD6eZ/6qrl3/dipgYaJEhFVaI KcjnHzRR5JLWhcujpsE17Ht5w8jp4CwcXeZcFc0NahfnIsh4gP80AKHSOp2eYNCw2X/b ePpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=lpuS2XIpxhkh0cGhkRhHfwVb0FeEw1mbRG5no741r3E=; fh=yxZp+IJNGUPWVYLADy2+iWbtLYK0joRWjUQ/aA21czw=; b=BuxgWd7uETil4MD4H4NnRpw4lythAi5ky4i408XbeqWwYV9fX1sZRhCzftyh8tmxYS 6FV6tQPkYFG9xnw1QXVeNupHMHuSI8moB0n62ZK1d6x/RLsVntPujYoplJZ+6cqTdvN8 diOG0oTkrEe97LFv5Siq0Px8BcblzP94lEgMVfO/k5wkfwlPUWxjQoXUG6n3eh7mGbQL UE/ywIrQzkEw2UKcqfp9exUGph2tFfEX0ToHp3u0XhFk5G8abgC7h/OLeRhZRFKCNPr7 ycZIg6sAJhpca3INl7ZZBbWOoKDe9Z1ZWKib7gKz7ShSAaN7DMAonscdZPY1E/8Pwkp/ N2ig==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z670RNwT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4359-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4359-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a1e0cc1a2514c-7fce9f7cb46si4079391241.203.2024.05.23.07.26.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 07:26:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4359-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z670RNwT; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4359-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4359-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 13AA01C21110 for ; Thu, 23 May 2024 14:26:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E39714BF90; Thu, 23 May 2024 14:26:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z670RNwT" 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 4DC0F14B963; Thu, 23 May 2024 14:26:26 +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=1716474386; cv=none; b=VD5LdrOsm6MD582WCawTvcnli4eNEvzzpttdTWY2UY9EM3Cg9WmWQsghfBv2SjCZ9q9kK8kSbHGGIT1PR6Dk+XJrqUN4L2nWone5il4JwnU7Z3EdpQJ7/jUwWpe/gKubgq4co2WScW1kh+CGmzMgA35MQjnJm47MeGsqEt3AzqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716474386; c=relaxed/simple; bh=BRelUIXHRNbgKGr9uiec6fA7kfy2IAO96U7wtTdHOvA=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=DM3ljbnksQmvV3K5aBW7qkdNfBOAqVMu1HqpJF4mr9NjQ87udct5CKllkdM7kSeJ+O8fTZZPfzxHgO9IVgl1sqj6f6YxMdPq2SL/fyonKn/VwSpzBSvb6mlByLlIFQ51GrZb/ZrsqC3QqaHYw36jblx+m8YTZDgHlLIc1UTrm0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z670RNwT; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 003FDC2BD10; Thu, 23 May 2024 14:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716474385; bh=BRelUIXHRNbgKGr9uiec6fA7kfy2IAO96U7wtTdHOvA=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=Z670RNwTpMiq5Ropebg1SSzUGgmihspQHBUatXA6Zxb38ecj8kvHRNiVQ/rOPyXSK pexclw0Ro64CFUkzd/xtmc9Yctiukv3Ru2Od/yExS6oKWk7lA4Iu3VW1bjmjB10aqG HG+nU6EWLzJxbVScmQG1Ch7AcSduL4lvcYA5Z+SYvBQu/9dIksubwIOQhls82gRqLr fmnih4zlqEArYM/cZE+2zhnRKzX8lDlge1PbvL+tIwsNc9j2k/YgrOzgQmVUxXgFeJ QAtiBUqAeYrqFuwGah49rEAwUTuv5xzb6O7fEHf/lpC4tFRN8JStK5YJ0jRUq3I+cg CRe9ywQ1MSqTw== 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: Thu, 23 May 2024 17:26:19 +0300 Message-Id: Cc: , "David Woodhouse" , "Eric Biggers" , "James Bottomley" , "Ben Boeckel" , "David Howells" , "Herbert Xu" , "David S. Miller" , "Andrew Morton" , "James Bottomley" , "Mimi Zohar" , "Paul Moore" , "James Morris" , "Serge E. Hallyn" , "open list:CRYPTO API" , "open list" , "open list:SECURITY SUBSYSTEM" Subject: Re: [PATCH v3] KEYS: trusted: Use ASN.1 encoded OID From: "Jarkko Sakkinen" To: "Jarkko Sakkinen" , X-Mailer: aerc 0.17.0 References: <20240523142056.17159-1-jarkko@kernel.org> In-Reply-To: <20240523142056.17159-1-jarkko@kernel.org> On Thu May 23, 2024 at 5:20 PM EEST, Jarkko Sakkinen wrote: > There's no reason to encode OID_TPMSealedData at run-time, as it never > changes. > > Replace it with an encoded u8-array, which has the same number of > elements: > > 67 81 05 0A 01 05 > > Include OBJECT IDENTIFIER (0x06) tag and length as the prologue so that > the OID can be simply copied to the blob leading to: > > 06 06 67 81 05 0A 01 05 > > Since this in stationary place in the buffer it is guaranteed to always > fit and not further checks are required. > > Reviewed-by: David Howells > Signed-off-by: Jarkko Sakkinen Does not really substitute distribution kernel testing, which is IMHO essential for something like TPM2 boot in systemd but for simple patches like this, the following does a trivial smoke test: export LINUX_OVERRIDE_SRCDIR=3D git clone https://gitlab.com/jarkkojs/linux-tpmdd-test.git cd linux-tpmdd-test cmake -Bbuild && make -Cbuild buildroot-prepare make -Cbuild/buildroot/build build/buildroot/build/images/run-tests.sh I'm planning to migrate at some point to systemd and make it appear more like distribution tho.. For recompiling just kernel only thing needed is: rm -rf build/buildroot/build/build/linux-custom make -Cbuild/buildroot/build I've put this also to the MAINTAINERS entry of TPM driver although I use it also for keyrings etc. Also it is open for contributions via Gitlab merge requests (not requesting them per se but I'm open to such possibility). BR, Jarkko