aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorDmitry Kasatkin <d.kasatkin@samsung.com>2013-05-06 08:58:15 -0400
committerMimi Zohar <zohar@linux.vnet.ibm.com>2013-10-25 17:15:18 -0400
commit3fe78ca2fb1d61ea598e63fcbf38aec76b36b3a8 (patch)
treed980cc80515b6ee7609de1e61583fa91cedaae83 /include/crypto
parentee08997fee16f10be23c9748d609dbdf3baab8e4 (diff)
keys: change asymmetric keys to use common hash definitions
This patch makes use of the newly defined common hash algorithm info, replacing, for example, PKEY_HASH with HASH_ALGO. Changelog: - Lindent fixes - Mimi CC: David Howells <dhowells@redhat.com> Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/public_key.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
index b34fda4dcabf..fc09732613ad 100644
--- a/include/crypto/public_key.h
+++ b/include/crypto/public_key.h
@@ -15,6 +15,7 @@
15#define _LINUX_PUBLIC_KEY_H 15#define _LINUX_PUBLIC_KEY_H
16 16
17#include <linux/mpi.h> 17#include <linux/mpi.h>
18#include <crypto/hash_info.h>
18 19
19enum pkey_algo { 20enum pkey_algo {
20 PKEY_ALGO_DSA, 21 PKEY_ALGO_DSA,
@@ -25,19 +26,8 @@ enum pkey_algo {
25extern const char *const pkey_algo_name[PKEY_ALGO__LAST]; 26extern const char *const pkey_algo_name[PKEY_ALGO__LAST];
26extern const struct public_key_algorithm *pkey_algo[PKEY_ALGO__LAST]; 27extern const struct public_key_algorithm *pkey_algo[PKEY_ALGO__LAST];
27 28
28enum pkey_hash_algo { 29/* asymmetric key implementation supports only up to SHA224 */
29 PKEY_HASH_MD4, 30#define PKEY_HASH__LAST (HASH_ALGO_SHA224 + 1)
30 PKEY_HASH_MD5,
31 PKEY_HASH_SHA1,
32 PKEY_HASH_RIPE_MD_160,
33 PKEY_HASH_SHA256,
34 PKEY_HASH_SHA384,
35 PKEY_HASH_SHA512,
36 PKEY_HASH_SHA224,
37 PKEY_HASH__LAST
38};
39
40extern const char *const pkey_hash_algo_name[PKEY_HASH__LAST];
41 31
42enum pkey_id_type { 32enum pkey_id_type {
43 PKEY_ID_PGP, /* OpenPGP generated key ID */ 33 PKEY_ID_PGP, /* OpenPGP generated key ID */
@@ -91,7 +81,7 @@ struct public_key_signature {
91 u8 digest_size; /* Number of bytes in digest */ 81 u8 digest_size; /* Number of bytes in digest */
92 u8 nr_mpi; /* Occupancy of mpi[] */ 82 u8 nr_mpi; /* Occupancy of mpi[] */
93 enum pkey_algo pkey_algo : 8; 83 enum pkey_algo pkey_algo : 8;
94 enum pkey_hash_algo pkey_hash_algo : 8; 84 enum hash_algo pkey_hash_algo : 8;
95 union { 85 union {
96 MPI mpi[2]; 86 MPI mpi[2];
97 struct { 87 struct {