lkml.org 
[lkml]   [2019]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 25/59] keys/mktme: Preparse the MKTME key payload
On Wed, Jul 31, 2019 at 18:07:39 +0300, Kirill A. Shutemov wrote:
> From: Alison Schofield <alison.schofield@intel.com>
> +/* Make sure arguments are correct for the TYPE of key requested */
> +static int mktme_check_options(u32 *payload, unsigned long token_mask,
> + enum mktme_type type, enum mktme_alg alg)
> +{
> + if (!token_mask)
> + return -EINVAL;
> +
> + switch (type) {
> + case MKTME_TYPE_CPU:
> + if (test_bit(OPT_ALGORITHM, &token_mask))
> + *payload |= (1 << alg) << 8;
> + else
> + return -EINVAL;
> +
> + *payload |= MKTME_KEYID_SET_KEY_RANDOM;
> + break;
> +
> + case MKTME_TYPE_NO_ENCRYPT:
> + *payload |= MKTME_KEYID_NO_ENCRYPT;
> + break;

The documentation states that for `type=no-encrypt`, algorithm must not
be specified at all. Where is that checked?

--Ben

\
 
 \ /
  Last update: 2019-08-05 13:59    [W:0.215 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site