From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Date: Tue, 03 Mar 2020 20:06:14 +0000 Subject: Re: [PATCH v6 4/6] security: keys: trusted: use ASN.1 TPM2 key format for the blobs Message-Id: <20200303200614.GD5775@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <20200302122759.5204-1-James.Bottomley@HansenPartnership.com> <20200302122759.5204-5-James.Bottomley@HansenPartnership.com> In-Reply-To: <20200302122759.5204-5-James.Bottomley@HansenPartnership.com> To: James Bottomley Cc: linux-integrity@vger.kernel.org, Mimi Zohar , David Woodhouse , keyrings@vger.kernel.org On Mon, Mar 02, 2020 at 07:27:57AM -0500, James Bottomley wrote: > Modify the TPM2 key format blob output to export and import in the > ASN.1 form for TPM2 sealed object keys. For compatibility with prior > trusted keys, the importer will also accept two TPM2B quantities > representing the public and private parts of the key. However, the > export via keyctl pipe will only output the ASN.1 format. > > The benefit of the ASN.1 format is that it's a standard and thus the > exported key can be used by userspace tools (openssl_tpm2_engine, > openconnect and tpm2-tss-engine). The format includes policy > specifications, thus it gets us out of having to construct policy > handles in userspace and the format includes the parent meaning you > don't have to keep passing it in each time. > > This patch only implements basic handling for the ASN.1 format, so > keys with passwords but no policy. > > Signed-off-by: James Bottomley tpm_key (like you have tpm2_key prefix). /Jarkko 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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 358C8C3F2D1 for ; Tue, 3 Mar 2020 20:06:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 161672073B for ; Tue, 3 Mar 2020 20:06:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731410AbgCCUGS (ORCPT ); Tue, 3 Mar 2020 15:06:18 -0500 Received: from mga12.intel.com ([192.55.52.136]:18071 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731338AbgCCUGS (ORCPT ); Tue, 3 Mar 2020 15:06:18 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2020 12:06:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,511,1574150400"; d="scan'208";a="233868214" Received: from fkuchars-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.4.236]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2020 12:06:15 -0800 Date: Tue, 3 Mar 2020 22:06:14 +0200 From: Jarkko Sakkinen To: James Bottomley Cc: linux-integrity@vger.kernel.org, Mimi Zohar , David Woodhouse , keyrings@vger.kernel.org Subject: Re: [PATCH v6 4/6] security: keys: trusted: use ASN.1 TPM2 key format for the blobs Message-ID: <20200303200614.GD5775@linux.intel.com> References: <20200302122759.5204-1-James.Bottomley@HansenPartnership.com> <20200302122759.5204-5-James.Bottomley@HansenPartnership.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200302122759.5204-5-James.Bottomley@HansenPartnership.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org On Mon, Mar 02, 2020 at 07:27:57AM -0500, James Bottomley wrote: > Modify the TPM2 key format blob output to export and import in the > ASN.1 form for TPM2 sealed object keys. For compatibility with prior > trusted keys, the importer will also accept two TPM2B quantities > representing the public and private parts of the key. However, the > export via keyctl pipe will only output the ASN.1 format. > > The benefit of the ASN.1 format is that it's a standard and thus the > exported key can be used by userspace tools (openssl_tpm2_engine, > openconnect and tpm2-tss-engine). The format includes policy > specifications, thus it gets us out of having to construct policy > handles in userspace and the format includes the parent meaning you > don't have to keep passing it in each time. > > This patch only implements basic handling for the ASN.1 format, so > keys with passwords but no policy. > > Signed-off-by: James Bottomley tpm_key (like you have tpm2_key prefix). /Jarkko