From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z670RNwT" 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-security-module@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