Commit Graph

11512 Commits

Author SHA1 Message Date
Bernhard Miklautz
36c6478627 fix client/smartcard: indentation and return value
Integrate feedback from pull request review.
2017-12-14 16:21:19 +01:00
Bernhard Miklautz
5a1c0081c5 fix smartcard: SCardStatus unicode handling
* fix StatusW_Call to rely and use SCardStatusW
* fix trace call in  StatusW_Call - needs to be called after the sizes
  are set
* unify SCardStatus functions for pcsc - let the internal function handle unicode directly

This fixes an issue with size calculations of SCardStatusW.
2017-12-14 15:46:14 +01:00
Bernhard Miklautz
94b35cb4f7 fix channel/smartcard: leak in Connect[AW]
smartcard_Connect[AW] leaked the reader buffer in error case.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
bff9b98e67 feat winpr/smartcard: add test for SCardStatus
Add an extensive test for SCardStatus. It's not enabled per default
as it requires a reader with card to be present.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
9fc754170b fix channel/smartcard: SCardStatus
Add support for fmszReaderNamesIsNULL. Formating of the touched files
was also updated.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
bc8bdc3e54 fix channel/smartcard: compiler warnings
* remove unused variables
* remove unused jump label
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
6b691948cf refactor winpr/smartcard/pcsc: reader/group naming
The PCSC SCard implementation in winpr tried to rename reader and group
names received from PCSC to something similar to what the windows smart
card service would return.

Because of the following reasons this mapping was removed:

* reader names are not standardized
* no mapping of reader name should be required at all
* the mapping added extra complexity
* the mapping didn't produce the same names as if the reader was
  directly connected on windows (or redirected from a windows host)

In case there are situations where this is nevertheless required this
feature can simple be (re-)implemented a part of the smart card channel.

Also the formatting was fixed.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
389b7f218b feat winpr: add WINPR_UNUSED macro
WINPR_UNUSED can be used to mark intentionally unused function parameters.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
e3d45c4580 fix channel/smartcard: remove SCardAddReaderName
SCardAddReaderName isn't part of the SCard API.

Note: removing this also removes the possibility to redirect single
smartcard readers with /smartcard:READERNAME. However this features
wasn't implemented in a general way and will be re-added as part of
the smart card channel directly.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
1e6fea7fa7 fix channel/smartcard: simplify channel variables
Path was not really used and name was duplicated. Use the device->Name
directly.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
6e63c6afd9 fix channel/smartcard: remove status mappings
The state tracking/modifications (presumably thought as optimization?!) in
PCSC_SCardGetStatusChange_Internal cause a lot of applications to behave
incorrectly and/or hang. Ideally no modifications of the states should
be necessary as PCSC implements the same API as passed over the channel.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
f8a3e7acd4 fix channel/smartcard: GetStatusChange return code
In case SCardGetStatusChange returned an error the call didn't return
any data but STATUS_NO_MEMORY as the calloc failed. This caused problems
with multiple applications server side (hangs and incorrect behavior).

Now the case when no readers are returned is handed correctly and the
data is also filled and send if the call fails.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
46a7538322 fix channel/smartcard: async request handling
The smart card channel tried to mimic mstsc's behavior on if an IRP was
processed synchronously or asynchronously. As the channel uses one thread per
context it could happen, especially with PCSC, that the main
channel thread was blocked waiting for an smart card operation to
complete. To prevent that behavior only call known safe functions in the
main thread (like CreateContext) and call the rest asynchronously.

For example the channel would block if a ListReaders is invoked on
the same context where a GetStatusChange (infinite timeout)
was already pending. Only when a status change happened the channel
would continue.

Note: Due to the one context per thread design it's important that
cancel isn't queued an alway run synchronously. Otherwise a specific
context might lock.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
3dc4e283db fix channel/smartcard: return value handling
Device control calls always returned SCARD_S_SUCCESS even if an error
occurred. This caused server side software (including the card manager)
to behave incorrectly.
2017-12-13 17:04:06 +01:00
Bernhard Miklautz
99c69cde27 fix channel/smartcard: error handling
According to MS-RDPESC the smart card channel must set the IoStatus to
an NTSTATUS in case a encoding or decoding error happens. The smart card
channel did this correctly but the output stream was modified
incorrectly causing the smart card remote manager to stop in error
cases.
2017-12-13 17:04:06 +01:00
Martin Fleisz
f6b8a6eaa2
Merge pull request #4276 from akallabeth/big_endian_more
Big endian fixes
2017-12-13 09:58:14 +01:00
Martin Fleisz
6aa914363a
Merge pull request #4301 from hardening/geometry
geometry: a skeleton for the MS-RDPEGT channel
2017-12-13 09:09:33 +01:00
David Fort
3b670703fb
Merge pull request #4277 from akallabeth/mac_server
Mac fixes
2017-12-12 10:40:14 +01:00
Armin Novak
0a9ef97a57 Fixed uninitialized variable. 2017-12-12 10:35:02 +01:00
David Fort
a6cfd3c49a geometry: a skeleton for the MS-RDPEGT channel
The base for implementing the MS-RDPEGT client channel that allows to track window
geometry.
2017-12-08 11:26:29 +01:00
Martin Fleisz
876a7697be
Merge pull request #4297 from akallabeth/cmd_parser_hardening
Fix #4296: Hardened command line post filter.
2017-12-05 14:40:03 +01:00
Martin Fleisz
5931fd4fe4
Merge pull request #4294 from akallabeth/shadow_fix
Shadow server crash fixes
2017-12-05 11:19:59 +01:00
Martin Fleisz
ed9a4b7d45
Merge pull request #4288 from hardening/disp_channel
Disp channel changes and improvements
2017-12-05 10:56:14 +01:00
Bernhard Miklautz
22c71c0034
Merge pull request #4298 from myfreeweb/libressl-fix-fips
Fix LibreSSL build
2017-12-02 16:09:43 +01:00
Greg V
bfe3af4c72 Fix LibreSSL build
LibreSSL does not support FIPS mode.
2017-12-01 18:34:48 +03:00
David Fort
1e48405d19 drdynvc: fix invalid check
There were a copy'n paste error in the check of a malloc.
2017-12-01 14:20:24 +01:00
David Fort
e73da4a656 display control channel: add a callback called when we receive capabilities
We need a signal to know when the channel is ready and it's safe to send the
monitor layouts.
2017-12-01 14:19:39 +01:00
Armin Novak
78a0c4c618 Fix #4296: Hardened command line post filter. 2017-12-01 13:13:21 +01:00
akallabeth
0cb5907664
Merge pull request #4275 from ondrejholy/big-endian-fixes
Big endian fixes
2017-12-01 11:24:50 +01:00
David Fort
d2cb79ce98
Merge pull request #4292 from daixj-shterm/master
Fix #4291: xfreerdp segfault when connecting freerdp-shadow-cli
2017-11-29 15:28:37 +01:00
Armin Novak
877f161465 Reset errno in X11 monitor enumeration
XOpenDisplay may succeed but set errno,
reset at the end of the function.
2017-11-29 14:17:27 +01:00
Armin Novak
33271415fe Fixed /monitors argument checks. 2017-11-29 14:13:50 +01:00
daixj
d10448fde2 Fix #4291: xfreerdp segfault when connecting freerdp-shadow-cli 2017-11-29 05:12:40 -05:00
David Fort
e064aa6a99 xfreerdp: when available use xrandr to get display infos 2017-11-29 10:38:48 +01:00
akallabeth
2f15b806f5
Merge pull request #4287 from bmiklautz/dev2
2.0.0-dev2 - start rc2 development cycle
2017-11-28 16:36:32 +01:00
Bernhard Miklautz
1cda26274f client/android: increase version 2017-11-28 15:33:03 +01:00
Bernhard Miklautz
ac9b6d15f2 2.0.0-dev2 - start rc2 development cycle 2017-11-28 15:29:17 +01:00
akallabeth
84f8161897
Merge pull request #4286 from bmiklautz/rc1
Version 2.0.0-rc1
2017-11-28 15:26:30 +01:00
Bernhard Miklautz
8244370bfb Version 2.0.0-rc1 2017-11-28 15:03:09 +01:00
David Fort
cf33966f2e
Merge pull request #4282 from akallabeth/force_ipv6
Fix #4281: Added option to prefer IPv6 over IPv4
2017-11-28 10:48:53 +01:00
Bernhard Miklautz
cb4b6267e9
Merge pull request #4284 from akallabeth/channel_count_fix_v2
Fixed channel count exceed checks
2017-11-28 10:47:27 +01:00
Armin Novak
3e4c274cc9 Fixed channel count exceed checks
The check aborted on CHANNEL_MAX_COUNT - 1 instead
of correctly at CHANNEL_MAX_COUNT
2017-11-28 09:40:04 +01:00
akallabeth
ae0fb64656
Merge pull request #4283 from bmiklautz/kfreebsd
fix build: GNU/kFreeBSD
2017-11-28 09:19:58 +01:00
David Fort
2f4a2f8595
Merge pull request #4272 from akallabeth/static_channel_checks
Fix #3378: 31 static channels are supported.
2017-11-27 22:46:23 +01:00
Bernhard Miklautz
0da2fb6915 fix/build: handle GNU/kFreeBSD like other BSDs
Based on a patch for Debian from
Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
2017-11-27 17:04:52 +01:00
Mike Gabriel
d4af7eaa59 fix/build: GNU/kFreeBSD is not FreeBSD 2017-11-27 17:04:52 +01:00
Bernhard Miklautz
50105c8157
Merge pull request #3991 from akallabeth/stream_string_helper
Stream convenience functions to read/write strings.
2017-11-27 11:49:46 +01:00
Bernhard Miklautz
baf52f529f
Merge pull request #4261 from akallabeth/doc_ssl_store
Fix #3890: Point to OpenSSL doc for private CA
2017-11-27 11:46:54 +01:00
Armin Novak
2cc64298f2 Fix #4281: Added option to prefer IPv6 over IPv4 2017-11-27 11:43:54 +01:00
Bernhard Miklautz
73533230a3
Merge pull request #4220 from akallabeth/version_from_file_or_tag
Extract build version from file or git tag.
2017-11-27 10:57:26 +01:00