From: Stephan Mueller <smueller@chronox.de>
To: David Howells <dhowells@redhat.com>
Cc: keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
mathew.j.martineau@linux.intel.com
Subject: Re: key retention service: DH support
Date: Tue, 24 May 2016 09:29:15 +0200 [thread overview]
Message-ID: <2025704.nsKCcck7Ux@tauon.atsec.com> (raw)
In-Reply-To: <28895.1464074381@warthog.procyon.org.uk>
Am Dienstag, 24. Mai 2016, 08:19:41 schrieb David Howells:
Hi David,
> Stephan Mueller <smueller@chronox.de> wrote:
> > The KDF patches are fully tested. All that would be needed on the key
> > retention side after the shared secret generation are the following calls:
> >
> > kdf = crypto_alloc_rng(NAME, 0, 0);
> >
> > crypto_rng_reset(kdf, <shared_secret>, sizeof(<shared_secret>));
> >
> > crypto_rng_generate(kdf, LABEL, sizeof(LABEL), outbuf, outbuflen);
> >
> > NAME would be the KDF type such as "kdf_ctr(hmac(sha256))"
> >
> > LABEL would be an arbitrary string defined by the key service (e.g.
> > "LxKeyRet").
>
> So there wouldn't be a change to the DH keyctl (including functional)?
Assuming that the LABEL and/or the KDF name are not configurable by user
space, the only potential difference I would see is that a user could ask for
the length of the output data.
Think of it like the KDF in a network protocol where the shared secret has
some length X but the caller needs data of length Y for a specific use (e.g. a
symmetric key plus an HMAC key). The use case for such "local" DH operation
would be the writing of encrypted data while the system is locked. The
encryption of the actual file data is done using a symmetric algo with
symmetric key, potentially with an integrity key. Usually, the DH shared
secret size is not equal to the size of a symmetric key. So, a KDF would be
needed to bring it to the right size.
Ciao
Stephan
next prev parent reply other threads:[~2016-05-24 7:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-23 18:57 key retention service: DH support Stephan Mueller
2016-05-24 7:04 ` David Howells
2016-05-24 7:14 ` Stephan Mueller
2016-05-24 7:19 ` David Howells
2016-05-24 7:29 ` Stephan Mueller [this message]
2016-05-24 16:22 ` Mat Martineau
2016-05-24 16:45 ` Stephan Mueller
2016-05-25 10:25 ` Herbert Xu
2016-05-25 10:58 ` David Howells
2016-05-26 17:04 ` Mat Martineau
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=2025704.nsKCcck7Ux@tauon.atsec.com \
--to=smueller@chronox.de \
--cc=dhowells@redhat.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=mathew.j.martineau@linux.intel.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