lkml.org 
[lkml]   [2016]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/8] KEYS: Provide software public key query function [ver #2]
Mat Martineau <mathew.j.martineau@linux.intel.com> wrote:
>
>> + if (strcmp(encoding, "pkcs1") == 0) {
>> + /* The data wangled by the RSA algorithm is typically padded
>> + * and encoded in some manner, such as EMSA-PKCS1-1_5 [RFC3447
>> + * sec 8.2].
>> + */
>> + if (!hash_algo)
>> + n = snprintf(alg_name, CRYPTO_MAX_ALG_NAME,
>> + "pkcs1pad(%s)",
>> + pkey->pkey_algo);
>
> Did you see Herbert's patch that strips out non-hash pkcs1pad capabilities
> (and the ensuing discussion)?
>
> http://www.spinics.net/lists/linux-crypto/index.html#20432
>
> I'm making use of pkcs1pad(rsa) with a TLS implementation, so it's good to
> see it supported here.

Indeed I'm nacking this patch because it's exporting a purely
software algorithm to user-space for no good reason. AFAICS
there is nothing in the pkcs1pad code that cannot be done in
user-space, even assuming that your private key is secret and
only accessible from the kernel.

IOW exporting the raw RSA might make sense because the key may
not be visible to user-space, or that the RSA might be implemented
in hardware offload, but there is no sane reason to export pkcs1pad.

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2016-06-24 12:21    [W:0.769 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site