lkml.org 
[lkml]   [2015]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC v4 2/4] crypto: add PKE API
On Thu, Jun 11, 2015 at 12:05:44PM -0700, Tadeusz Struk wrote:
>
> +int crypto_akcipher_setkey(struct crypto_akcipher *tfm,
> + const struct public_key *pkey)
> +{
> + if (tfm->pkey)
> + akcipher_free_key(tfm->pkey);
> +
> + return akcipher_clone_key(tfm, pkey);
> +}

No please do not expose the struct public_key crap to the new
API. The key should be completely opaque to entities outside
of the algorithm. So make it raw and read out the MPIs from
it.

The contents of the function must go into the algorithm setkey
function, not the crypto API. So RSA would read out however
many MPIs it needs and verify it, and so on.

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: 2015-06-12 05:21    [W:0.608 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site