summaryrefslogtreecommitdiffstats
path: root/ncr.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-24 13:43:43 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-24 18:38:58 +0200
commitffb3e747f8b50ca18701530d1729a4ee3aa4ae69 (patch)
treeefa9b3552566ce2891c1c105cd9fd5f4c3baa269 /ncr.h
parent4b45720ea1dffc3514c81439c7f93928d05c5521 (diff)
downloadcryptodev-linux-ffb3e747f8b50ca18701530d1729a4ee3aa4ae69.tar.gz
cryptodev-linux-ffb3e747f8b50ca18701530d1729a4ee3aa4ae69.tar.xz
cryptodev-linux-ffb3e747f8b50ca18701530d1729a4ee3aa4ae69.zip
Added a support for reading session data directly from userspace.
Diffstat (limited to 'ncr.h')
-rw-r--r--ncr.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/ncr.h b/ncr.h
index d3f4813..d666628 100644
--- a/ncr.h
+++ b/ncr.h
@@ -276,14 +276,30 @@ typedef enum {
NCR_VERIFICATION_FAILED = -2,
} ncr_error_t;
+typedef enum {
+ NCR_DATA,
+ NCR_DIRECT_DATA,
+} ncr_data_type_t;
+
struct ncr_session_op_st {
/* input */
ncr_session_t ses;
- ncr_data_t input;
- ncr_data_t output; /* when verifying signature this is
- * the place of the signature.
- */
+ union {
+ struct {
+ ncr_data_t input;
+ ncr_data_t output; /* when verifying signature this is
+ * the place of the signature.
+ */
+ } ndata;
+ struct {
+ void* input;
+ size_t input_size;
+ void* output;
+ size_t output_size;
+ } udata;
+ } data;
+ ncr_data_type_t type;
/* output of verification */
ncr_error_t err;
@@ -296,7 +312,7 @@ struct ncr_session_once_op_st {
#define NCRIO_SESSION_INIT _IOR ('c', 300, struct ncr_session_st)
#define NCRIO_SESSION_UPDATE _IOWR ('c', 301, struct ncr_session_op_st)
-#define NCRIO_SESSION_FINAL _IOR ('c', 302, struct ncr_session_op_st)
+#define NCRIO_SESSION_FINAL _IOWR ('c', 302, struct ncr_session_op_st)
/* everything in one call */
#define NCRIO_SESSION_ONCE _IOWR ('c', 303, struct ncr_session_once_op_st)