From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932772AbbJMRfJ (ORCPT ); Tue, 13 Oct 2015 13:35:09 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:44144 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932331AbbJMRfG (ORCPT ); Tue, 13 Oct 2015 13:35:06 -0400 Date: Tue, 13 Oct 2015 11:34:42 -0600 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, peterhuewe@gmx.de, gregkh@linuxfoundation.org, akpm@linux-foundation.org, mjg59@srcf.ucam.org, Marcel Selhorst , David Safford , Mimi Zohar , David Howells , "open list:KEYS-TRUSTED" , "open list:KEYS-TRUSTED" Subject: Re: [PATCH 3/4] tpm: seal/unseal for TPM 2.0 Message-ID: <20151013173442.GB22160@obsidianresearch.com> References: <1443775102-9727-1-git-send-email-jarkko.sakkinen@linux.intel.com> <1443775102-9727-4-git-send-email-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1443775102-9727-4-git-send-email-jarkko.sakkinen@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.160 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 02, 2015 at 11:38:17AM +0300, Jarkko Sakkinen wrote: > Added tpm_trusted_seal() and tpm_trusted_unseal() API for sealing > trusted keys. > > This patch implements basic sealing and unsealing functionality for > TPM 2.0: We really need to stop using chip id's as a handle - the caller should be using a pointer, it is just a horrible API, and the TPM_ANY_NUM business is awful too.. TPM's are stateful devices! Is it feasible to introduce new APIs with a saner scheme? The api layering also seems really weird to me. At a minimum the tpm_seal_trusted should be called within key_seal, but really, should key_seal be migrated into the TPM core? I'm not sure it makes alot of sense to have a tpm_seal_trusted which uses the high level key structs when other tpm functions are all low level RPC wrappers... Jason