From: David Woodhouse Subject: Re: [PATCH v2] crypto: AF_ALG - add support for keys/asymmetric-type Date: Wed, 13 Jan 2016 13:45:14 +0000 Message-ID: <1452692714.88154.39.camel@infradead.org> References: <1452688062.88154.32.camel@infradead.org> <20151226155014.27615.14985.stgit@desktop.home> <10839.1452692211@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="sha-1"; protocol="application/x-pkcs7-signature"; boundary="=-pvY4fa4G/WV0+D7si3hq" Cc: Tadeusz Struk , herbert@gondor.apana.org.au, tadeusz.struk@intel.com, smueller@chronox.de, linux-api@vger.kernel.org, marcel@holtmann.org, linux-kernel@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, zohar@linux.vnet.ibm.com, Jarkko Sakkinen , peterhuewe@gmx.de To: David Howells Return-path: In-Reply-To: <10839.1452692211@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-crypto.vger.kernel.org --=-pvY4fa4G/WV0+D7si3hq Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2016-01-13 at 13:36 +0000, David Howells wrote: > David Woodhouse wrote: >=20 > > David, is there a way to do that test purely in software without > > needing hardware support? We know that the data might not actually be > > present in all cases... is there an easy test for that case? >=20 > I have written a user TPM driver that talks to a userspace TPM implementa= tion > out of the backend.=C2=A0=C2=A0It's been pushed to the TPM driver guy but= I'm not sure > what became of it.=C2=A0=C2=A0I'll chase it up. I was thinking of something a lot simpler =E2=80=94 like a test hack with a= key type that just puts a *pointer* to the key data in the 'payload', to ensure that nobody is violating the rules about directly touching the payload (which should be private to the implementation). --=20 dwmw2 --=-pvY4fa4G/WV0+D7si3hq Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIISjjCCBicw ggUPoAMCAQICA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