From: David Howells <dhowells@redhat.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: dhowells@redhat.com, David Woodhouse <dwmw2@infradead.org>,
Tadeusz Struk <tstruk@gmail.com>,
herbert@gondor.apana.org.au, 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
Subject: Re: [PATCH v2] crypto: AF_ALG - add support for keys/asymmetric-type
Date: Sat, 16 Jan 2016 10:51:53 +0000 [thread overview]
Message-ID: <5232.1452941513@warthog.procyon.org.uk> (raw)
In-Reply-To: <569677D6.7070704@intel.com>
Tadeusz Struk <tadeusz.struk@intel.com> wrote:
> I think the coupling of an algorithm to its key is the problem here.
> Usually an algorithm should be able to work with any (valid) key.
A key stored in hardware and used through that hardware won't necessarily
support all crypto operations - it may be restricted to just signing or just
encrypting for example.
> The solution to this can be implemented on the crypto API.
> If the TMP driver would register its supported algorithms on the crypto API
> and in the setkey function it would check if a key is a real key or this
> "something" (probably a ptr to TMP dev instance?) then in the first
> case it would fallback to an implementation that takes a key data.
> In the second case it can do its thing whatever it is.
>From what Herbert has said, he won't go for that since the TPM keys are
restricted in the operations one can use the key for.
I think the crypto API is what we use when the key data is available to us in
the kernel - but it should be driven through the asymmetric key API. You ask
the asymmetric key API to verify a key, say, then that will switch to the TPM
driver or to the software public key implementation. The latter will then
load the appropriate crypto layer akcipher algorithm (eg. RSA) and use that -
where the akcipher implementation will either be a software one or will get
offloaded to some hardware that can do it - but that doesn't itself securely
hold the key.
David
next prev parent reply other threads:[~2016-01-16 10:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-26 15:50 [PATCH v2] crypto: AF_ALG - add support for keys/asymmetric-type Tadeusz Struk
[not found] ` <20151226155014.27615.14985.stgit-r49W/1Cwd2f9zxVx7UNMDg@public.gmane.org>
2016-01-12 5:56 ` Tadeusz Struk
2016-01-13 12:27 ` David Woodhouse
2016-01-13 13:31 ` David Howells
[not found] ` <10464.1452691882-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2016-01-13 14:05 ` Tadeusz Struk
[not found] ` <569659AC.9070506-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-01-13 15:06 ` David Woodhouse
[not found] ` <1452697593.88154.49.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-01-13 16:14 ` Tadeusz Struk
2016-01-16 10:51 ` David Howells [this message]
[not found] ` <1452688062.88154.32.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-01-13 13:36 ` David Howells
2016-01-13 13:45 ` David Woodhouse
2016-01-13 13:52 ` Tadeusz Struk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5232.1452941513@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=herbert@gondor.apana.org.au \
--cc=keyrings@vger.kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=smueller@chronox.de \
--cc=tadeusz.struk@intel.com \
--cc=tstruk@gmail.com \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).