summaryrefslogtreecommitdiffstats
path: root/sesman/chansrv/smartcard_pcsc.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2013-08-05 20:16:18 -0700
committerJay Sorg <jay.sorg@gmail.com>2013-08-05 20:16:18 -0700
commit8b48e2274e4ecbce56893b6915d13781474d19d6 (patch)
tree67e02aebd1b5abb65aeac07bf0479486bc4e3620 /sesman/chansrv/smartcard_pcsc.c
parent6c07ee0ba39c869b5a092e1c5de698da976e6953 (diff)
downloadxrdp-proprietary-8b48e2274e4ecbce56893b6915d13781474d19d6.tar.gz
xrdp-proprietary-8b48e2274e4ecbce56893b6915d13781474d19d6.zip
chansrv: work on smartcard
Diffstat (limited to 'sesman/chansrv/smartcard_pcsc.c')
-rw-r--r--sesman/chansrv/smartcard_pcsc.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c
index ab6cb4ca..5312ec5f 100644
--- a/sesman/chansrv/smartcard_pcsc.c
+++ b/sesman/chansrv/smartcard_pcsc.c
@@ -22,7 +22,7 @@
* this will act like pcsc daemon
*/
-#define PCSC_STANDIN 0
+#define PCSC_STANDIN 1
#include "os_calls.h"
#include "smartcard.h"
@@ -56,20 +56,23 @@ struct version_struct
};
typedef struct version_struct version_struct;
-typedef struct rxSharedSegment
+struct rxSharedSegment
{
tui32 mtype; /** one of the \c pcsc_adm_commands */
tui32 user_id;
tui32 group_id;
tui32 command; /** one of the \c pcsc_msg_commands */
tui64 date;
- unsigned char key[PCSCLITE_MSG_KEY_LEN]; /* 16 bytes */
+ tui8 key[PCSCLITE_MSG_KEY_LEN]; /* 16 bytes */
union _u
{
- unsigned char data[PCSCLITE_MAX_MESSAGE_SIZE];
+ tui8 data[PCSCLITE_MAX_MESSAGE_SIZE];
struct version_struct veStr;
} u;
-} sharedSegmentMsg, *psharedSegmentMsg;
+};
+typedef struct rxSharedSegment sharedSegmentMsg, *psharedSegmentMsg;
+
+#define RXSHAREDSEGMENT_BYTES 2088
extern int g_display_num; /* in chansrv.c */
@@ -122,19 +125,35 @@ scard_pcsc_check_wait_objs(void)
/*****************************************************************************/
/* returns error */
int APP_CC
-scard_process_msg(struct stream *s)
+scard_process_version(psharedSegmentMsg msg)
{
- psharedSegmentMsg msg;
+ return 0;
+}
+/*****************************************************************************/
+/* returns error */
+int APP_CC
+scard_process_msg(struct stream *s)
+{
+ sharedSegmentMsg msg;
+ int rv;
+
+ g_memset(&msg, 0, sizeof(msg));
+ in_uint32_le(s, msg.mtype);
+ in_uint32_le(s, msg.user_id);
+ in_uint32_le(s, msg.group_id);
+ in_uint32_le(s, msg.command);
+ in_uint64_le(s, msg.date);
LLOGLN(0, ("scard_process_msg: mtype 0x%2.2x command 0x%2.2x",
- msg->mtype, msg->command));
- msg = (psharedSegmentMsg)(s->p);
- switch (msg->mtype)
+ msg.mtype, msg.command));
+ rv = 0;
+ switch (msg.mtype)
{
case 0xF8: /* CMD_VERSION */
+ rv = scard_process_version(&msg);
break;
}
- return 0;
+ return rv;
}
/*****************************************************************************/
@@ -187,7 +206,7 @@ my_pcsc_trans_conn_in(struct trans *trans, struct trans *new_trans)
g_con = new_trans;
g_con->trans_data_in = my_pcsc_trans_data_in;
- g_con->header_size = sizeof(sharedSegmentMsg);
+ g_con->header_size = RXSHAREDSEGMENT_BYTES;
LLOGLN(0, ("my_pcsc_trans_conn_in: sizeof sharedSegmentMsg is %d",
sizeof(sharedSegmentMsg)));