summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-23 18:07:42 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-23 18:07:42 +0200
commitda3eeeff5744e8ea4bcdb819db3afad6437f5231 (patch)
treee9e92f4856b03aed9bcd1098625e0db060512140 /include
parent732e36a02b032e6cacd26694da55629b5e32c3bd (diff)
parent16ace6317db2c47b36b08b0addfe91356151c08d (diff)
downloadkernel-crypto-da3eeeff5744e8ea4bcdb819db3afad6437f5231.tar.gz
kernel-crypto-da3eeeff5744e8ea4bcdb819db3afad6437f5231.tar.xz
kernel-crypto-da3eeeff5744e8ea4bcdb819db3afad6437f5231.zip
Merge branch 'standalone-rename' into userspace-crypto
Conflicts: .gitignore
Diffstat (limited to 'include')
-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 47b03015f6b..5103e1e8b6a 100644
--- a/include/linux/ncr.h
+++ b/include/linux/ncr.h
@@ -60,9 +60,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;
@@ -71,21 +68,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)
@@ -147,8 +137,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];
@@ -163,7 +154,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;
};
@@ -171,7 +165,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
@@ -190,7 +185,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;
@@ -215,12 +209,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 */
};
@@ -263,6 +259,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;