summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorDmitry Kasatkin <d.kasatkin@samsung.com>2013-05-06 15:58:15 +0300
committerMimi Zohar <zohar@linux.vnet.ibm.com>2013-10-25 17:15:18 -0400
commit3fe78ca2fb1d61ea598e63fcbf38aec76b36b3a8 (patch)
treed980cc80515b6ee7609de1e61583fa91cedaae83 /include/crypto
parentee08997fee16f10be23c9748d609dbdf3baab8e4 (diff)
downloadop-kernel-dev-3fe78ca2fb1d61ea598e63fcbf38aec76b36b3a8.zip
op-kernel-dev-3fe78ca2fb1d61ea598e63fcbf38aec76b36b3a8.tar.gz
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 b34fda4..fc09732 100644
--- a/include/crypto/public_key.h
+++ b/include/crypto/public_key.h
@@ -15,6 +15,7 @@
#define _LINUX_PUBLIC_KEY_H
#include <linux/mpi.h>
+#include <crypto/hash_info.h>
enum pkey_algo {
PKEY_ALGO_DSA,
@@ -25,19 +26,8 @@ enum pkey_algo {
extern const char *const pkey_algo_name[PKEY_ALGO__LAST];
extern const struct public_key_algorithm *pkey_algo[PKEY_ALGO__LAST];
-enum pkey_hash_algo {
- PKEY_HASH_MD4,
- PKEY_HASH_MD5,
- PKEY_HASH_SHA1,
- PKEY_HASH_RIPE_MD_160,
- PKEY_HASH_SHA256,
- PKEY_HASH_SHA384,
- PKEY_HASH_SHA512,
- PKEY_HASH_SHA224,
- PKEY_HASH__LAST
-};
-
-extern const char *const pkey_hash_algo_name[PKEY_HASH__LAST];
+/* asymmetric key implementation supports only up to SHA224 */
+#define PKEY_HASH__LAST (HASH_ALGO_SHA224 + 1)
enum pkey_id_type {
PKEY_ID_PGP, /* OpenPGP generated key ID */
@@ -91,7 +81,7 @@ struct public_key_signature {
u8 digest_size; /* Number of bytes in digest */
u8 nr_mpi; /* Occupancy of mpi[] */
enum pkey_algo pkey_algo : 8;
- enum pkey_hash_algo pkey_hash_algo : 8;
+ enum hash_algo pkey_hash_algo : 8;
union {
MPI mpi[2];
struct {
OpenPOWER on IntegriCloud