[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.OSX.2.20.1605111624090.16566@mjmartin-mac01.local>
Date: Wed, 11 May 2016 16:50:05 -0700 (PDT)
From: Mat Martineau <mathew.j.martineau@...ux.intel.com>
To: David Howells <dhowells@...hat.com>
cc: mathew.j.martineau@...ux.intel.com, tadeusz.struk@...el.com,
linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org, keyrings@...r.kernel.org,
linux-crypto@...r.kernel.org, dwmw2@...radead.org
Subject: Re: [RFC PATCH 5/8] KEYS: Provide software public key query function
[ver 3]
On Wed, 11 May 2016, David Howells wrote:
> Provide a query function for the software public key implementation. This
> permits information about such a key to be obtained using
> query_asymmetric_key() or KEYCTL_PKEY_QUERY.
>
> Signed-off-by: David Howells <dhowells@...hat.com>
> ---
>
> crypto/asymmetric_keys/public_key.c | 96 ++++++++++++++++++++++++++++++-----
> 1 file changed, 82 insertions(+), 14 deletions(-)
>
> diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
> index 96983906d2a2..e9967e5a2c25 100644
> --- a/crypto/asymmetric_keys/public_key.c
> +++ b/crypto/asymmetric_keys/public_key.c
> +static int software_key_query(const struct kernel_pkey_params *params,
> + struct kernel_pkey_query *info)
> +{
...
> + len = crypto_akcipher_maxsize(tfm);
> + info->key_size = len * 8;
> + info->max_data_size = len;
> + info->max_sig_size = len;
> + info->max_enc_size = len;
> + info->max_dec_size = len;
If len > UINT16_MAX, should UINT16_MAX be reported as the max size?
Similar question for len*8 and key_size.
--
Mat Martineau
Intel OTC
Powered by blists - more mailing lists