Commit Graph

2278 Commits

Author SHA1 Message Date
Martin Fleisz bfe8359b5b
Merge pull request #4239 from akallabeth/test_memleak_fixes
Test memleak fixes
2017-12-20 12:38:38 +01:00
akallabeth 097f8edd97
Merge pull request #4312 from bmiklautz/smartcard-cleanup
Smartcard fixes and cleanup
2017-12-14 16:56:29 +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
Martin Fleisz 5cec90c781
Merge pull request #4305 from hardening/xrandr_fix
Fix XRandr for old systems and MacOSX
2017-12-13 17:24:41 +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 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 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
Martin Fleisz f6b8a6eaa2
Merge pull request #4276 from akallabeth/big_endian_more
Big endian fixes
2017-12-13 09:58:14 +01:00
Armin Novak ae2a96293b Cleanup and initialization checks. 2017-12-12 11:40:48 +01:00
Armin Novak 7305828122 Fix #4239: Various memory leaks
* Fixed all tests, now can be run with -DWITH_ADDRESS_SANITIZER=ON compiled.
* Enabled address sanitizer for nightly builds.
2017-12-12 11:40:48 +01:00
Armin Novak 0a9ef97a57 Fixed uninitialized variable. 2017-12-12 10:35:02 +01:00
David Fort 41823080f9 Fix users of Stream_GetPosition() that returns size_t 2017-12-11 22:38:58 +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
Greg V bfe3af4c72 Fix LibreSSL build
LibreSSL does not support FIPS mode.
2017-12-01 18:34:48 +03: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
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
Armin Novak c91900dfb3 Fixed big endian issues with bitmap read. 2017-11-24 12:03:46 +01:00
Ondrej Holy e5574f276a winpr/nt: Fix wide char string on big endian
Wide char strings are always little endian encoded and thus
Data_Write_UINT16 has to be used in _RtlAnsiStringToUnicodeString.
It fixes TestIoDevice on big endian machines among others.

https://github.com/FreeRDP/FreeRDP/issues/4231
2017-11-23 20:01:01 +01:00
Armin Novak 377bfeb227 Fix #3378: 31 static channels are supported. 2017-11-23 16:18:44 +01:00
akallabeth 71e38a4ce7
Merge pull request #4267 from ondrejholy/autofips
Enable FIPS mode automatically
2017-11-23 10:49:15 +01:00
Ondrej Holy 6973b14eed Enable FIPS mode automatically
FreeRDP aborts if OpenSSL operates in FIPS mode and +fipsmode is not
manually specified. Let's prevent the abortion and enable the necessary
options in that case automatically.
2017-11-23 10:09:17 +01:00
Armin Novak 4fe12b0ea3 Fix #4247: warnings introduced with #3904 2017-11-20 10:18:15 +01:00
akallabeth b156b937fe
Merge pull request #3904 from bjcollins/master
FIPS Mode support for xfreerdp
2017-11-17 13:31:43 +01:00
Martin Fleisz 4ff1251488
Merge pull request #4236 from akallabeth/scan_fix_remastered
Scanbuild warning fixes
2017-11-17 13:02:46 +01:00
Armin Novak 1bb4f121b4 Fixed formatting. 2017-11-17 12:45:28 +01:00
Brent Collins 9ca9df1ead Make the new winpr_Digest*MD5_Allow_FIPS functions more generic to no longer be MD5 specific in design. This way the FIPS override
could easily be extended to more digests in the future. For now, an attempt to use these functions with anything other than MD5 will
not work.
2017-11-17 12:43:07 +01:00
Brent Collins 922a0fa495 Fix checks for openssl version numbers around fips changes, they were using an incorrect version matching 1.1.0 and not 1.0.1
Simplify the logic to enable openssl fips mode
2017-11-17 12:43:07 +01:00
Brent Collins a0526317ea Fix the return values of the winpr_Digest_Init functions which were accidentally removed
during rework in previous checkin.
2017-11-17 12:43:07 +01:00
Brent Collins 68ab485e63 Fix logic error in reworked MD5 call for establishing keys, and fix some minor whitespace issues. 2017-11-17 12:43:07 +01:00
Brent Collins 7aa9e7a97f Fix variable definition placement to adhere to older C standard. 2017-11-17 12:43:06 +01:00
Brent Collins 5284100bb0 FIPS_mode() and FIPS_mode_set() does not exist in OpenSSL versions before 1.0.1 2017-11-17 12:43:06 +01:00
Brent Collins 2dddae738f Change initialization of EVP_CIPHER_CTX to use API function instead of trying to calloc().
Fix some warnings noted from build output.
2017-11-17 12:43:06 +01:00
Brent Collins 497ba442be Workaround for missing EVP_CIPH_FLAG_FIPS_NON_ALLOW flag in openssl 1.0.0. 2017-11-17 12:43:06 +01:00
Brent Collins d98b88642b Add new command-line option to force xfreerdp into a fips compliant mode.
This option will ensure that NLA is disabled(since NTLM uses weak crypto algorithms), FIPS
encryption is enabled, and ensure fips mode is enabled for openssl.

Selectively override specific uses of MD5/RC4 with new API calls specifically tailored to override FIPS.

Add comments on why overriding the use of these algorithms under FIPS is acceptable for the locations where overrides happen.

Remove check of server proprietary certificate which was already being ignore to avoid use of MD5.

Initialize winpr openssl earlier to ensure fips mode is set before starting using any crypto algorithms.
2017-11-17 12:43:06 +01:00
David Fort 0d92c725c6
Merge pull request #4000 from akallabeth/ign_keyword_fix
Command line ignore empty if flag set
2017-11-16 13:26:01 +01:00
Armin Novak 7b58495e7b Fixed warnings and formatting. 2017-11-15 15:56:24 +01:00
Armin Novak 1fd6308ef5 Functions static, warnings fixed. 2017-11-15 15:56:24 +01:00
Armin Novak 90e1d39fec Fixed formatting and warnings. 2017-11-15 15:56:24 +01:00
Armin Novak 44dfaf7841 Fixed dead store warning. 2017-11-15 15:56:24 +01:00
Armin Novak 3baba6f9c0 Removed unused argument. 2017-11-15 15:56:24 +01:00
Armin Novak f24158fe07 Fixed missing function return check. 2017-11-15 15:56:24 +01:00
Armin Novak 0aa5a83536 Fixed multiple warnings in parser 2017-11-15 15:56:21 +01:00
Armin Novak 26d079e53b Fixed compile warnings. 2017-11-15 15:54:38 +01:00