From ffb3e747f8b50ca18701530d1729a4ee3aa4ae69 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 24 Jul 2010 13:43:43 +0200 Subject: Added a support for reading session data directly from userspace. --- ncr.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'ncr.h') 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) -- cgit