summaryrefslogtreecommitdiffstats
path: root/include/linux/ncr.h
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-23 17:52:29 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-23 17:52:29 +0200
commit16ace6317db2c47b36b08b0addfe91356151c08d (patch)
tree3a3c051b43333fabe1116e45e512acadf11da3e8 /include/linux/ncr.h
parent893a38ffe67459db005bd1c7f129c04508cd015d (diff)
parentd3d66b196cda9b100f3e3e0e742e0c2a76f2751a (diff)
downloadkernel-crypto-16ace6317db2c47b36b08b0addfe91356151c08d.tar.gz
kernel-crypto-16ace6317db2c47b36b08b0addfe91356151c08d.tar.xz
kernel-crypto-16ace6317db2c47b36b08b0addfe91356151c08d.zip
Merge branch 'standalone-master' into standalone-rename
Conflicts: examples/Makefile examples/ncr.c examples/pk.c examples/speed.c
Diffstat (limited to 'include/linux/ncr.h')
-rw-r--r--include/linux/ncr.h36
1 files changed, 17 insertions, 19 deletions
diff --git a/include/linux/ncr.h b/include/linux/ncr.h
index 30158897fb3..f6c8f9ff43a 100644
--- a/include/linux/ncr.h
+++ b/include/linux/ncr.h
@@ -63,9 +63,6 @@ typedef enum {
typedef int ncr_data_t;
#define NCR_DATA_INVALID (ncr_data_t)(0)
-/* When initializing a data_t we can initialize it as a kernel data object
- * or as an object that points to userspace data.
- */
struct ncr_data_init_st {
ncr_data_t desc;
size_t max_object_size;
@@ -74,21 +71,14 @@ struct ncr_data_init_st {
size_t initial_data_size;
};
-struct ncr_data_init_user_st {
- ncr_data_t desc;
- unsigned int flags;
- void __user *data; /* can be null */
- size_t __user* data_size_ptr;
-};
-
struct ncr_data_st {
ncr_data_t desc;
void __user* data;
size_t data_size; /* rw in get */
+ unsigned int append_flag; /* only when used with NCRIO_DATA_SET */
};
-#define NCRIO_DATA_INIT _IOWR('c', 200, struct ncr_data_init_st)
-#define NCRIO_DATA_INIT_USER _IOWR('c', 200, struct ncr_data_init_user_st)
+#define NCRIO_DATA_INIT _IOWR('c', 200, struct ncr_data_init_st)
#define NCRIO_DATA_GET _IOWR('c', 201, struct ncr_data_st)
#define NCRIO_DATA_SET _IOR('c', 202, struct ncr_data_st)
#define NCRIO_DATA_DEINIT _IOR('c', 203, ncr_data_t)
@@ -150,8 +140,9 @@ typedef enum {
/* used in derivation/encryption
*/
struct ncr_key_params_st {
- ncr_key_t key;
-
+ /* this structure always corresponds to a key. Hence the
+ * parameters of the union selected are based on the corresponding
+ * key */
union {
struct {
uint8_t iv[NCR_CIPHER_MAX_BLOCK_LEN];
@@ -166,7 +157,10 @@ struct ncr_key_params_st {
ncr_algorithm_t oaep_hash; /* for OAEP */
ncr_algorithm_t sign_hash; /* for signatures */
unsigned int pss_salt; /* PSS signatures */
- } pk;
+ } rsa;
+ struct {
+ ncr_algorithm_t sign_hash; /* for signatures */
+ } dsa;
} params;
};
@@ -174,7 +168,8 @@ struct ncr_key_derivation_params_st {
ncr_key_t newkey;
unsigned int keyflags; /* for new key */
- struct ncr_key_params_st key;
+ ncr_key_t key;
+ struct ncr_key_params_st params;
};
#define MAX_KEY_ID_SIZE 20
@@ -193,7 +188,6 @@ struct ncr_key_info_st {
struct ncr_key_data_st {
ncr_key_t key;
ncr_data_t data;
-
/* in case of import this will be used as key id */
uint8_t key_id[MAX_KEY_ID_SIZE];
size_t key_id_size;
@@ -218,12 +212,14 @@ struct ncr_key_data_st {
#define NCRIO_KEY_DEINIT _IOR ('c', 215, ncr_key_t)
-/* Key wrap ioctls
+/* FIXME key wrap ioctls
*/
struct ncr_key_wrap_st {
ncr_wrap_algorithm_t algorithm;
ncr_key_t keytowrap;
- struct ncr_key_params_st key;
+
+ ncr_key_t key;
+ struct ncr_key_params_st params;
ncr_data_t data; /* encrypted keytowrap */
};
@@ -266,6 +262,8 @@ typedef int ncr_session_t;
struct ncr_session_st {
/* input */
ncr_algorithm_t algorithm;
+
+ ncr_key_t key;
struct ncr_key_params_st params;
ncr_crypto_op_t op;