Commit Graph

65 Commits

Author SHA1 Message Date
René Genz
9e99dd52d6 Fix minor spelling mistakes 2017-11-02 01:01:44 +01:00
Henrik Andersson
8c83f8957b Fix SCARD_AUTOALLOCATE handling
SCARD_AUTOALLOCATE is a define with value -1, which is compared
to an uint32. There was some missassumtion of whenever its -1 or
0xffffffff through the code.
2017-10-23 08:43:35 +02:00
Henrik Andersson
0d707ae103 Fix sign-compare compiler warnings 2017-10-20 13:30:42 +02:00
Henrik Andersson
896a923f55 Markup unused parameters 2017-10-20 11:05:52 +02:00
Henrik Andersson
267db2ceff Fix compile warnings about unused variables 2017-10-17 10:32:40 +02:00
Karl Mikaelsson
cebd4ad016 Move all Smart Card error messages to the debug level
Running rdesktop with smart card redirection could lead to scenarios
where rdesktop keeps producing error messages about the Smart Card
redirection when there isn't really an error. I don't believe that we
should log an error if the underlying PC/SC interface reports
SCARD_E_NO_SERVICE.

The logged information could be useful for developers in debugging
scenarios, so I'm keeping is as Debug rather than removing it
outright.
2017-10-11 17:24:46 +02:00
Henrik Andersson
41b8e1ce06 Merge pull request #160 from derfian/remove-make-proto
Remove infrastructure to auto-generate proto.h
2017-10-06 10:35:36 +02:00
Alexander Zakharov
ed3726a9fa Handle the lack of SCARD_CTL_CODE on Mac 2017-10-05 19:47:59 +03:00
Karl Mikaelsson
1f13c85583 Remove infrastructure to auto-generate proto.h
If proto.h is supposed to be auto-generated it should probably not be
present in the repo at all. Re-running cproto showed that proto.h has
been manually edited for quite some time, so this just makes this the
only workflow.

It also gets rid of a bit of #ifdefs, so that's nice.
2017-10-05 15:18:13 +02:00
Karl Mikaelsson
dca441c4e6 Don't log warnings/errors from TS_SCardGetStatusChange at all
Not sure why I thought the user needed to see this at all.
2017-10-04 17:11:02 +02:00
Karl Mikaelsson
96faa24bd5 Don't log common Smart Card error codes as rdesktop errors
The proper thing to do would be to forward the errors to the server
and let it deal with it. No need to present these as errors to the
user.
2017-10-04 15:20:46 +02:00
Henrik Andersson
f616b2c1f9 Release scard context if not used 2017-07-07 13:12:38 +02:00
Henrik Andersson
7d8675074f Fail SCardEstablishContext if no readers connected
Windows smartcard application generally behaves better with polling of smartcard
subsystem availability than when there are no smartcard readers available.

This is a potential workaround for issue #109
2017-03-29 13:45:04 +02:00
Henrik Andersson
b37cbe9abd Refactor for cleaner code flow 2017-03-29 13:36:43 +02:00
Henrik Andersson
87d8d123b8 Rework the logging system
This commit will add a logging system to solve the problem that
one actually need to recompile rdesktop from source to enable
different debug logging.

- Same logging api  for all kind of logging and messages to
   end user.

- Adding -v for verbose output when running rdesktop.

- All messages are logged into a subject and with a type, eg:

     logger(Keyboard, Notice, "Autos-electing %s based on locale.", locale);

- Debug logging is enabled trough a environment variable RDEKSTOP_DEBUG,
  which specifies subjects of interest, comma separated. There is a special
  subject named All which includes all subject for debug loggin. There is also
  a simple logic opeartor '!' = NOT which can be used in combination like:

    RDESKTOP_DEBUG=All,!Graphics,!Sound

  Which would give debug log output for All subject except Graphics and Sound.
2017-01-26 14:19:40 +01:00
remijouannet
b46639ad3c indent-all.sh 2016-05-24 18:02:22 +02:00
Henrik Andersson
761cc053e2 Fixes a bug with Windows Server 2012 r2 and smartcard
redirection were the RDPDR channel is shutdown by server.

The RDPDR channel is shutdown by server when responses from
abdonend iorequests are received on a reinitialized RDPDR
channel. This fix adds epochs for RDPDR channel and tags 
iorequest to specific epoch to handle abdonend iorequest.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1836 423420c4-83ab-492f-b58f-81f9feb106b5
2014-09-11 11:54:46 +00:00
Henrik Andersson
fffb479e0c Workaround for bug in pcsc lite where timeout value 0
for SCardGetStatusChange() behaves just like INFINIT.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1835 423420c4-83ab-492f-b58f-81f9feb106b5
2014-09-11 11:15:46 +00:00
Peter Åstrand
3dbb64050d Ran indent-all
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1738 423420c4-83ab-492f-b58f-81f9feb106b5
2013-09-16 12:45:47 +00:00
Henrik Andersson
69b6171fd1 Remove undocumented fallback codeblock which existence is not motivated.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1733 423420c4-83ab-492f-b58f-81f9feb106b5
2013-08-29 13:27:35 +00:00
Henrik Andersson
982fd425a3 Fixes a issue with 64bit portability.
Fix for bug #366



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1729 423420c4-83ab-492f-b58f-81f9feb106b5
2013-08-12 09:52:08 +00:00
Pierre Ossman
e0766aae22 Don't screw up the attribute ID for SCardGetAttr(). It
worked by pure luck in some cases, and failed in the rest.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1724 423420c4-83ab-492f-b58f-81f9feb106b5
2013-07-05 14:32:43 +00:00
Pierre Ossman
72dd2ac5be Do a proper parsing of the ReaderState structure. We did not
handle NULL szReader properly previously.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1723 423420c4-83ab-492f-b58f-81f9feb106b5
2013-07-05 11:44:03 +00:00
Henrik Andersson
6e7f45f3e7 Adding forceOutAlignemnt(out, 8) which is just cosmetics.
Thanks goes to Arvo for his findings and provided patch of the 
bugs fixed in r1649, r1650 and this commit.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1651 423420c4-83ab-492f-b58f-81f9feb106b5
2011-12-07 09:49:44 +00:00
Henrik Andersson
d8cc551013 Fixes serious bug were output are aligned before all data is available.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1650 423420c4-83ab-492f-b58f-81f9feb106b5
2011-12-07 09:25:27 +00:00
Henrik Andersson
7e39d5a450 Fixes an invalid check for memory allocation.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1649 423420c4-83ab-492f-b58f-81f9feb106b5
2011-12-07 09:20:39 +00:00
Henrik Andersson
abb83dbd6f This patch fixes smartcard handle problems on 64bit version
of rdesktop, this is jsut a hack to fix the problem with
smartcard imlpementation temporarly due the smartcard impl.
really needs to be reimplement for a cleaner code and proper
handling.

- Ripped out the old magic scard handle code to be replaced
  with mappings the works on 64bit rdesktop.

- Added a handle map to support mapping between a 64bit handle
  and 32bit eg:  pcsclite <- 64bit-> rdesktop <- 32bit -> WTS server.

- Added handle mapping for the context handle to which old code didn't
  event respected at all eg. 64bit context handled truncated to 32bit.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1646 423420c4-83ab-492f-b58f-81f9feb106b5
2011-11-24 13:19:52 +00:00
Henrik Andersson
aa517c7c39 pcsclite >= 1.6.2 does not include the type SCARD_READERSTATE_A which
breaks compilation, change code to use SCARD_READERSTATE which
is the new name and is also an typedef of the old SCARD_READERSTATE_A
from pcslite <1.9.2 versions.



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1643 423420c4-83ab-492f-b58f-81f9feb106b5
2011-11-15 08:40:41 +00:00
Pierre Ossman
1da6ed30e5 Some operations consist of just the control code, no data.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1599 423420c4-83ab-492f-b58f-81f9feb106b5
2010-06-22 13:06:50 +00:00
Pierre Ossman
b82d367a4b Translate the response to control code 3400 as it contains embedded control
codes in the local encoding.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1598 423420c4-83ab-492f-b58f-81f9feb106b5
2010-06-22 13:06:16 +00:00
Pierre Ossman
91af7ba5fc Let bogus control codes through with a warning, in case it might work
anyway.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1597 423420c4-83ab-492f-b58f-81f9feb106b5
2010-06-22 13:05:26 +00:00
Pierre Ossman
7e759ced83 Add copyright notice.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1596 423420c4-83ab-492f-b58f-81f9feb106b5
2010-06-14 07:36:52 +00:00
Pierre Ossman
1ac2cd144e Control codes to SCardControl() are platform dependent so we need to do
some translation before passing them on.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1595 423420c4-83ab-492f-b58f-81f9feb106b5
2010-06-14 07:35:55 +00:00
Pierre Ossman
4635dfc148 Remove undocumented voodoo in SCardGetStatusChange() as it causes the
system version to return immediately, causing CPU intensive loops.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1594 423420c4-83ab-492f-b58f-81f9feb106b5
2010-06-14 07:35:00 +00:00
Peter Åstrand
aab770d625 Indented
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1562 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-27 07:40:47 +00:00
Peter Åstrand
60e82d86ef Reset smart card state before reconnect. This fixes stability problems
when using smart cards in conjunction with RandR. 



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1561 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-26 12:23:53 +00:00
Peter Åstrand
f749dbfef4 Avoid a few more compile warnings. This file should now build without
warnings on 32 bit platforms, when debugging is not enabled. 



git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1560 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-26 10:24:26 +00:00
Peter Åstrand
281d7c9f06 Changed license to GPLv3
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1534 423420c4-83ab-492f-b58f-81f9feb106b5
2010-01-12 08:31:06 +00:00
Peter Åstrand
f6e5fe5f38 Indent fixes
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1428 423420c4-83ab-492f-b58f-81f9feb106b5
2008-01-24 08:06:02 +00:00
Michael Gernoth
5c01b88a5f Smartcard fixes (bigendian support, locking, bugfixes) from
Paul Winder <Paul.Winder@tadpole.com>


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1420 423420c4-83ab-492f-b58f-81f9feb106b5
2007-10-30 13:09:37 +00:00
Michael Gernoth
27c360df03 really check for version of pcsclite in configure.ac
this fixes the smartcard-support on OS X 10.5


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1419 423420c4-83ab-492f-b58f-81f9feb106b5
2007-10-28 16:49:45 +00:00
Pierre Ossman
190c138e53 Respect mask used when searching for cards.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1415 423420c4-83ab-492f-b58f-81f9feb106b5
2007-07-03 14:20:04 +00:00
Pierre Ossman
421c2386d3 Improve readability of smart card code.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1414 423420c4-83ab-492f-b58f-81f9feb106b5
2007-07-03 14:08:06 +00:00
Pierre Ossman
d90bdbcb23 Fix two crashes caused by improver handling of structures.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1413 423420c4-83ab-492f-b58f-81f9feb106b5
2007-06-28 12:52:13 +00:00
Michael Gernoth
a8338fcd6e always make g_out an array
this removes duplicated code from scard.c


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1396 423420c4-83ab-492f-b58f-81f9feb106b5
2007-02-20 16:51:46 +00:00
Michael Gernoth
9769d751ee some more RD_BOOL
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1372 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-08 12:38:34 +00:00
Jay Sorg
6091381a81 prefix BOOL with RD_
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1371 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-08 04:47:06 +00:00
Michael Gernoth
510afcca69 ignore PCSCs idea of BOOL
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1367 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-04 23:19:54 +00:00
Michael Gernoth
ce8fe4d0e4 RD_ prefix
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1366 423420c4-83ab-492f-b58f-81f9feb106b5
2007-01-04 14:38:48 +00:00
Michael Gernoth
a9ad53b482 add human readable error messages
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1329 423420c4-83ab-492f-b58f-81f9feb106b5
2006-11-04 20:02:42 +00:00