From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jarkko Sakkinen Date: Wed, 17 Jun 2020 23:46:41 +0000 Subject: Re: [PATCH v10 5/8] security: keys: trusted: Make sealed key properly interoperable Message-Id: <20200617234641.GL62794@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit List-Id: References: <20200616160229.8018-1-James.Bottomley@HansenPartnership.com> <20200616160229.8018-6-James.Bottomley@HansenPartnership.com> In-Reply-To: <20200616160229.8018-6-James.Bottomley@HansenPartnership.com> To: James Bottomley Cc: linux-integrity@vger.kernel.org, Mimi Zohar , David Woodhouse , keyrings@vger.kernel.org, David Howells On Tue, Jun 16, 2020 at 09:02:26AM -0700, James Bottomley wrote: > The current implementation appends a migratable flag to the end of a > key, meaning the format isn't exactly interoperable because the using > party needs to know to strip this extra byte. However, all other > consumers of TPM sealed blobs expect the unseal to return exactly the > key. Since TPM2 keys have a key property flag that corresponds to > migratable, use that flag instead and make the actual key the only > sealed quantity. This is secure because the key properties are bound > to a hash in the private part, so if they're altered the key won't > load. > > Backwards compatibility is implemented by detecting whether we're > loading a new format key or not and correctly setting migratable from > the last byte of old format keys. > > Signed-off-by: James Bottomley Reviewed-by: Jarkko Sakkinen /Jarkko