[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-security-module
Subject:    Re: [PATCH 06/18] asymmetric keys: support parsing PKCS #8 private key information
From:       Pavel Machek <pavel () ucw ! cz>
Date:       2013-08-25 16:10:12
Message-ID: 20130825161012.GC5171 () amd ! pavel ! ucw ! cz
[Download RAW message or body]

On Thu 2013-08-22 19:01:45, Lee, Chun-Yi wrote:
> Add ASN.1 files and parser to support parsing PKCS #8 noncompressed private
> key information. It's better than direct parsing pure private key because
> PKCS #8 has a privateKeyAlgorithm to indicate the algorithm of private
> key, e.g. RSA from PKCS #1
> 
> Reviewed-by: Jiri Kosina <jkosina@suse.cz>
> Signed-off-by: Lee, Chun-Yi <jlee@suse.com>


> +#include <crypto/public_key.h>
> +
> +struct pkcs8_info {
> +	enum pkey_algo privkey_algo:8;		/* Private key algorithm */

Are you sure this is well-defined?

> +struct private_key_algorithm *pkcs8_private_key_algorithms[PKEY_ALGO__LAST] = {
> +	[PKEY_ALGO_DSA]         = NULL,
> +#if defined(CONFIG_PUBLIC_KEY_ALGO_RSA) || \
> +	defined(CONFIG_PUBLIC_KEY_ALGO_RSA_MODULE)
> +	[PKEY_ALGO_RSA]         = &RSA_private_key_algorithm,
> +#endif
> +};

  pkey_algo
  privkey_algo
  private_key_algorithm

...you use all variants.

Having symbols with "__" inside them is "interesting". I'd not do it.
										Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic