"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "sesman/chansrv/smartcard_pcsc.c" between
xrdp-0.9.13.1.tar.gz and xrdp-0.9.14.tar.gz

About: xrdp is a remote desktop protocol (rdp) server (accepting connections from rdesktop and Microsoft’s own terminal server / remote desktop clients).

smartcard_pcsc.c  (xrdp-0.9.13.1):smartcard_pcsc.c  (xrdp-0.9.14)
skipping to change at line 589 skipping to change at line 589
int uds_client_id; int uds_client_id;
int cchReaders; int cchReaders;
}; };
/*****************************************************************************/ /*****************************************************************************/
/* returns error */ /* returns error */
int int
scard_process_list_readers(struct trans *con, struct stream *in_s) scard_process_list_readers(struct trans *con, struct stream *in_s)
{ {
int hContext; int hContext;
int bytes_groups; unsigned int bytes_groups;
int cchReaders; int cchReaders;
char *groups; /*
* At the time of writing, the groups strings which can be sent
* over this interface are all small:-
*
* "SCard$AllReaders", "SCard$DefaultReaders", "SCard$LocalReaders" and
* "SCard$SystemReaders"
*
* We'll allow a bit extra in case the interface changes
*/
char groups[256];
struct pcsc_uds_client *uds_client; struct pcsc_uds_client *uds_client;
struct pcsc_context *lcontext; struct pcsc_context *lcontext;
struct pcsc_list_readers *pcscListReaders; struct pcsc_list_readers *pcscListReaders;
LLOGLN(10, ("scard_process_list_readers:")); LLOGLN(10, ("scard_process_list_readers:"));
uds_client = (struct pcsc_uds_client *) (con->callback_data); uds_client = (struct pcsc_uds_client *) (con->callback_data);
in_uint32_le(in_s, hContext); in_uint32_le(in_s, hContext);
in_uint32_le(in_s, bytes_groups); in_uint32_le(in_s, bytes_groups);
groups = (char *) g_malloc(bytes_groups + 1, 1); if (bytes_groups > (sizeof(groups) - 1))
{
LLOGLN(0, ("scard_process_list_readers: Unreasonable string length %u",
bytes_groups));
return 1;
}
in_uint8a(in_s, groups, bytes_groups); in_uint8a(in_s, groups, bytes_groups);
groups[bytes_groups] = '\0';
in_uint32_le(in_s, cchReaders); in_uint32_le(in_s, cchReaders);
LLOGLN(10, ("scard_process_list_readers: hContext 0x%8.8x cchReaders %d", LLOGLN(10, ("scard_process_list_readers: hContext 0x%8.8x cchReaders %d",
hContext, cchReaders)); hContext, cchReaders));
lcontext = get_pcsc_context_by_app_context(uds_client, hContext); lcontext = get_pcsc_context_by_app_context(uds_client, hContext);
if (lcontext == 0) if (lcontext == 0)
{ {
LLOGLN(0, ("scard_process_list_readers: " LLOGLN(0, ("scard_process_list_readers: "
"get_pcsc_context_by_app_context failed")); "get_pcsc_context_by_app_context failed"));
g_free(groups); g_free(groups);
return 1; return 1;
} }
pcscListReaders = g_new0(struct pcsc_list_readers, 1); pcscListReaders = g_new0(struct pcsc_list_readers, 1);
pcscListReaders->uds_client_id = uds_client->uds_client_id; pcscListReaders->uds_client_id = uds_client->uds_client_id;
pcscListReaders->cchReaders = cchReaders; pcscListReaders->cchReaders = cchReaders;
scard_send_list_readers(pcscListReaders, lcontext->context, scard_send_list_readers(pcscListReaders, lcontext->context,
lcontext->context_bytes, groups, cchReaders, 1); lcontext->context_bytes, groups, cchReaders, 1);
g_free(groups);
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
int int
scard_function_list_readers_return(void *user_data, scard_function_list_readers_return(void *user_data,
struct stream *in_s, struct stream *in_s,
int len, int status) int len, int status)
{ {
struct stream *out_s; struct stream *out_s;
 End of changes. 5 change blocks. 
4 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)