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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 8FBF3C43460 for ; Sat, 8 May 2021 13:39:16 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECDAF6141F for ; Sat, 8 May 2021 13:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECDAF6141F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.124319.234620 (Exim 4.92) (envelope-from ) id 1lfNAZ-0007Si-46; Sat, 08 May 2021 13:38:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 124319.234620; Sat, 08 May 2021 13:38:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lfNAZ-0007Sb-1A; Sat, 08 May 2021 13:38:59 +0000 Received: by outflank-mailman (input) for mailman id 124319; Sat, 08 May 2021 13:38:57 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lfNAX-0007SV-IK for xen-devel@lists.xenproject.org; Sat, 08 May 2021 13:38:57 +0000 Received: from sonata.ens-lyon.org (unknown [140.77.166.138]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 170830da-7ca9-4d09-a3de-0fcc78fac654; Sat, 08 May 2021 13:38:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 0026A201C8; Sat, 8 May 2021 13:43:35 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7VuzFJee62ij; Sat, 8 May 2021 13:43:35 +0200 (CEST) Received: from begin (lfbn-bor-1-56-204.w90-50.abo.wanadoo.fr [90.50.148.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id D2EE2201C7; Sat, 8 May 2021 13:43:35 +0200 (CEST) Received: from samy by begin with local (Exim 4.94) (envelope-from ) id 1lfLMt-00BMUL-87; Sat, 08 May 2021 13:43:35 +0200 Resent-From: Samuel Thibault Resent-Date: Sat, 8 May 2021 13:43:35 +0200 Resent-Message-ID: <20210508114335.wq5cyjpjru4ssbrh@begin> Resent-To: jandryuk@gmail.com, xen-devel@lists.xenproject.org, iwj@xenproject.org, wl@xen.org, dgdegra@tycho.nsa.gov, quan.xu0@gmail.com Received: from samy by begin with local (Exim 4.94.2) (envelope-from ) id 1leleq-0066zp-S4; Thu, 06 May 2021 23:35:44 +0200 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 170830da-7ca9-4d09-a3de-0fcc78fac654 Date: Thu, 6 May 2021 23:35:44 +0200 From: Samuel Thibault To: Jason Andryuk Cc: xen-devel@lists.xenproject.org, Ian Jackson , Wei Liu , Daniel De Graaf , Quan Xu Subject: Re: [PATCH v2 04/13] vtpmmgr: Allow specifying srk_handle for TPM2 Message-ID: <20210506213544.6twiioapinyzajb4@begin> Mail-Followup-To: Samuel Thibault , Jason Andryuk , xen-devel@lists.xenproject.org, Ian Jackson , Wei Liu , Daniel De Graaf , Quan Xu References: <20210506135923.161427-1-jandryuk@gmail.com> <20210506135923.161427-5-jandryuk@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210506135923.161427-5-jandryuk@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) Jason Andryuk, le jeu. 06 mai 2021 09:59:14 -0400, a ecrit: > Bypass taking ownership of the TPM2 if an srk_handle is specified. > > This srk_handle must be usable with Null auth for the time being. > > Signed-off-by: Jason Andryuk Reviewed-by: Samuel Thibault > --- > v2: Use "=" seperator > --- > docs/man/xen-vtpmmgr.7.pod | 7 +++++++ > stubdom/vtpmmgr/init.c | 11 ++++++++++- > 2 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/docs/man/xen-vtpmmgr.7.pod b/docs/man/xen-vtpmmgr.7.pod > index 875dcce508..3286954568 100644 > --- a/docs/man/xen-vtpmmgr.7.pod > +++ b/docs/man/xen-vtpmmgr.7.pod > @@ -92,6 +92,13 @@ Valid arguments: > > =over 4 > > +=item srk_handle= > + > +Specify a srk_handle for TPM 2.0. TPM 2.0 uses a key hierarchy, and > +this allow specifying the parent handle for vtpmmgr to create its own > +key under. Using this option bypasses vtpmmgr trying to take ownership > +of the TPM. > + > =item owner_auth= > > =item srk_auth= > diff --git a/stubdom/vtpmmgr/init.c b/stubdom/vtpmmgr/init.c > index 1506735051..130e4f4bf6 100644 > --- a/stubdom/vtpmmgr/init.c > +++ b/stubdom/vtpmmgr/init.c > @@ -302,6 +302,11 @@ int parse_cmdline_opts(int argc, char** argv, struct Opts* opts) > goto err_invalid; > } > } > + else if(!strncmp(argv[i], "srk_handle=", 11)) { > + if(sscanf(argv[i] + 11, "%x", &vtpm_globals.srk_handle) != 1) { > + goto err_invalid; > + } > + } > else if(!strncmp(argv[i], "tpmdriver=", 10)) { > if(!strcmp(argv[i] + 10, "tpm_tis")) { > opts->tpmdriver = TPMDRV_TPM_TIS; > @@ -586,7 +591,11 @@ TPM_RESULT vtpmmgr2_create(void) > { > TPM_RESULT status = TPM_SUCCESS; > > - TPMTRYRETURN(tpm2_take_ownership()); > + if ( vtpm_globals.srk_handle == 0 ) { > + TPMTRYRETURN(tpm2_take_ownership()); > + } else { > + tpm2_AuthArea_ctor(NULL, 0, &vtpm_globals.srk_auth_area); > + } > > /* create SK */ > TPM2_Create_Params_out out; > -- > 2.30.2 > -- Samuel "...[Linux's] capacity to talk via any medium except smoke signals." (By Dr. Greg Wettstein, Roger Maris Cancer Center)