From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Date: Tue, 10 Mar 2020 15:22:58 +0000 Subject: Re: [PATCH v8 1/8] lib: add ASN.1 encoder Message-Id: <1583853778.5686.14.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <20200310050939.29251-1-James.Bottomley@HansenPartnership.com> <20200310050939.29251-2-James.Bottomley@HansenPartnership.com> In-Reply-To: <20200310050939.29251-2-James.Bottomley@HansenPartnership.com> To: linux-integrity@vger.kernel.org Cc: Mimi Zohar , Jarkko Sakkinen , David Woodhouse , keyrings@vger.kernel.org On Mon, 2020-03-09 at 22:09 -0700, James Bottomley wrote: > We have a need in the TPM2 trusted keys to return the ASN.1 form of > the TPM key blob so it can be operated on by tools outside of the > kernel. The specific tools are the openssl_tpm2_engine, openconnect > and the Intel tpm2-tss-engine. To do that, we have to be able to > read and write the same binary key format the tools use. The current > ASN.1 decoder does fine for reading, but we need pieces of an ASN.1 > encoder to write the key blob in binary compatible form. > > For backwards compatibility, the trusted key reader code will still > accept the two TPM2B quantities that it uses today, but the writer > will only output the ASN.1 form. > > The current implementation only encodes the ASN.1 bits we actually > need. > > Signed-off-by: James Bottomley > Sorry, screwed up on tags here (forgot to add reviewed-by:). I've resent the entire patch set here: https://lore.kernel.org/linux-integrity/20200310051607.30334-1-James.Bottomley@HansenPartnership.com/ James From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F21CFC10F27 for ; Tue, 10 Mar 2020 15:23:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDAC2215A4 for ; Tue, 10 Mar 2020 15:23:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="awaDYWgp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=hansenpartnership.com header.i=@hansenpartnership.com header.b="awaDYWgp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727768AbgCJPXB (ORCPT ); Tue, 10 Mar 2020 11:23:01 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:45520 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgCJPXB (ORCPT ); Tue, 10 Mar 2020 11:23:01 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id C119D8EE130; Tue, 10 Mar 2020 08:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1583853780; bh=Qhp/hn6y0+PPWeQltwAXqcBWh81eIwGg4ZOYwHYMCB4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=awaDYWgp39AUrr/psnWbI5d38DagTcQtRLG2JR9LmTfRALw02A5fIksAzWS4ahDFi VPA2BczaiZxaCkZmaxl0bF2GmrG2AUok8dsdzHpJYI1qmsA+o/id84ScK9tUM9+xo9 IWW3uaqOEAfNPYpOppdnVDRszphSQJ/03/kGIv5M= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PoHMto9_6MhV; Tue, 10 Mar 2020 08:23:00 -0700 (PDT) Received: from [153.66.254.194] (unknown [50.35.76.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 10C5C8EE0E2; Tue, 10 Mar 2020 08:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1583853780; bh=Qhp/hn6y0+PPWeQltwAXqcBWh81eIwGg4ZOYwHYMCB4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=awaDYWgp39AUrr/psnWbI5d38DagTcQtRLG2JR9LmTfRALw02A5fIksAzWS4ahDFi VPA2BczaiZxaCkZmaxl0bF2GmrG2AUok8dsdzHpJYI1qmsA+o/id84ScK9tUM9+xo9 IWW3uaqOEAfNPYpOppdnVDRszphSQJ/03/kGIv5M= Message-ID: <1583853778.5686.14.camel@HansenPartnership.com> Subject: Re: [PATCH v8 1/8] lib: add ASN.1 encoder From: James Bottomley To: linux-integrity@vger.kernel.org Cc: Mimi Zohar , Jarkko Sakkinen , David Woodhouse , keyrings@vger.kernel.org Date: Tue, 10 Mar 2020 08:22:58 -0700 In-Reply-To: <20200310050939.29251-2-James.Bottomley@HansenPartnership.com> References: <20200310050939.29251-1-James.Bottomley@HansenPartnership.com> <20200310050939.29251-2-James.Bottomley@HansenPartnership.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Mon, 2020-03-09 at 22:09 -0700, James Bottomley wrote: > We have a need in the TPM2 trusted keys to return the ASN.1 form of > the TPM key blob so it can be operated on by tools outside of the > kernel. The specific tools are the openssl_tpm2_engine, openconnect > and the Intel tpm2-tss-engine. To do that, we have to be able to > read and write the same binary key format the tools use. The current > ASN.1 decoder does fine for reading, but we need pieces of an ASN.1 > encoder to write the key blob in binary compatible form. > > For backwards compatibility, the trusted key reader code will still > accept the two TPM2B quantities that it uses today, but the writer > will only output the ASN.1 form. > > The current implementation only encodes the ASN.1 bits we actually > need. > > Signed-off-by: James Bottomley > Sorry, screwed up on tags here (forgot to add reviewed-by:). I've resent the entire patch set here: https://lore.kernel.org/linux-integrity/20200310051607.30334-1-James.Bottomley@HansenPartnership.com/ James