Commit Graph

2634 Commits

Author SHA1 Message Date
Martin Fleisz
5bff8bf694
Merge pull request #5125 from akallabeth/clipboard_string_length_fix
Fix #5121: Determine actual string length for input data
2018-12-11 10:30:39 +01:00
Armin Novak
66e71ef963 Added missing define for _wcsnlen for windows. 2018-12-10 14:02:57 +01:00
Armin Novak
d198f73081 Fix #5121: Determine actual string length for input data
ConvertFromUnicode ignores '\0' sequences when the length of the input
string is given. Clipboard strings may be larger than the actual string
length and padded with random data leading to decoding errors.
Limit the length to the first occurrence of a '\0'.
2018-12-10 12:41:04 +01:00
Armin Novak
1e644fc37e Added _wcsnlen function for WCHAR string length. 2018-12-10 12:39:32 +01:00
Armin Novak
e3c85eb3dc removed strcpy 2018-12-06 10:17:05 +01:00
Armin Novak
3d487d0718 Fixed #5093: Try to read timezone from java TimeZone first
persist.sys.timezone property might not exist, try to get the
timezone identifier from the java class first.
2018-12-05 10:41:14 +01:00
Armin Novak
22be8f21ae Fix length type, use size_t 2018-12-04 09:34:22 +01:00
Armin Novak
d27cd1b19e Fixed unit tests, use uniqe file names 2018-12-04 08:45:41 +01:00
Bernhard Miklautz
52d1b35a63
Merge pull request #5046 from akallabeth/silence_wlog
Do not compile extended debugging by default.
2018-11-26 11:10:59 +00:00
Armin Novak
96fe23193e Initialize WtsApi32_WtsApiFunctionTable NULL 2018-11-22 17:30:16 +01:00
Armin Novak
617c00c8f5 WLog_IsLevelActive is now a exported function istead of inline.
Since this function calls WLog_GetLogLevel anyway better only
export the API to allow internal checks to be modified in the
future without breaking API
2018-11-22 16:34:38 +01:00
Martin Fleisz
947aa80033
Merge pull request #5016 from akallabeth/windows_server_build_fix
Windows server build fix
2018-11-21 16:02:47 +01:00
Armin Novak
17bbe7a23f Do not compile extended authentication debugging by default. 2018-11-21 15:36:31 +01:00
Armin Novak
d8d30a0554 Fix #5037: Fix calls to ntlm_print_av_pair_list 2018-11-21 09:18:38 +01:00
Armin Novak
eb57ed3a30 Refactored ntlm_av_pairs API
Tightened checks, cleaned up code and improved redability.
2018-11-20 11:08:31 +01:00
Armin Novak
2ee663f39d Fixed CVE-2018-8789
Thanks to Eyal Itkin from Check Point Software Technologies.
2018-11-20 11:08:31 +01:00
Armin Novak
28f51efe9c Fixed update of log filters in case of level change. 2018-11-19 13:04:40 +01:00
Armin Novak
37a01a19d8 Fix #5024: Update inherited log level for all child loggers when setting a new one. 2018-11-19 12:19:12 +01:00
Armin Novak
a2cd934184 Fixed windows build warnings. 2018-11-15 09:01:53 +01:00
Ilya Shipitsin
77323d6f1d remove not needed check
PVS analyzer: A part of conditional expression is always true: DomainMatch.
2018-11-15 01:54:39 +05:00
Ilya Shipitsin
be8f70998a remove not needed check
PVS analyzer: A part of conditional expression is always true: bWaitAll.
2018-11-15 01:51:44 +05:00
Bernhard Miklautz
a9bcc07d23 fix [winpr/sspi]: export symbols on all systems 2018-11-14 12:19:36 +01:00
Martin Fleisz
097ac0ee13
Merge pull request #4997 from akallabeth/use_bio_free_all
Replaced BIO_free with BIO_free_all
2018-11-12 13:55:36 +01:00
Martin Fleisz
6d6a2959c2
Merge pull request #4968 from akallabeth/timezone_updates
Simplified timezone update handling:
2018-11-09 12:07:43 +01:00
Martin Fleisz
a7f0da2440
Merge pull request #4961 from akallabeth/align_malloc_fix
Fixed #2039: Check for overflow in calculations.
2018-11-09 11:58:04 +01:00
Armin Novak
71036fe0b2 Fixed #2039: Check for overflow in calculations. 2018-11-09 10:50:53 +01:00
Armin Novak
5f4843191b Replaced BIO_free with BIO_free_all
There is no point in using BIO_free with a custom recursion
to free up stacked BIOs if there is already BIO_free_all.
Using it consistently avoids memory leaks due to stacked BIOs
not being recursively freed.
2018-11-08 12:09:49 +01:00
Armin Novak
6a2d49e0ed Simplified timezone update handling:
* Fix #4965: Adjusted the timezone update script to initialize
  structs properly.
* Updated the scripts to generate the files directly
* Added a small HOWTO
* Split zone information to separate files to allow automatic
  update without further manual editing.

Create a timezone.c file that does conform to C rules.
2018-11-07 14:46:24 +01:00
Bernhard Miklautz
472f7ea936 fix [winpr/util]: memory leak in TestCmdLine 2018-11-05 12:29:06 +01:00
Bernhard Miklautz
29d3fea3d7
Merge pull request #4974 from Devolutions/android_timezone_fix
Remove unsupported call to fseek when file is opened with popen
2018-10-31 11:26:19 +00:00
Jonathan Lafontaine
610a882f1d remove unsupported call to fseek when file is opened with popen 2018-10-30 16:47:06 -04:00
Martin Fleisz
7b0f4f5dc4
Merge pull request #4907 from akallabeth/transport_write_leak_fix
Transport write leak fix
2018-10-29 14:54:55 +01:00
Armin Novak
fffd352f83 Fixed warnings in Stream test. 2018-10-25 15:52:12 +02:00
Armin Novak
b7f272cd16 Fixed casts in Data_Read macros. 2018-10-25 15:52:12 +02:00
Armin Novak
97e68deea5 Fixed initialisation in DEFINE_EVENT_ENTRY define 2018-10-24 16:50:05 +02:00
Armin Novak
987ca5ec6a Fixed another bunch of warnings. 2018-10-24 14:36:12 +02:00
Armin Novak
86f08981ef Fixed warnings of uninitialized struct values. 2018-10-24 13:25:18 +02:00
Armin Novak
46d6aa4e2b Fixed cast warnings for thread wrapper 2018-10-24 13:24:45 +02:00
akallabeth
16d37b1a17
Merge pull request #4932 from hardening/stream_static
winpr: add some functions to use wStream in a static way
2018-10-22 21:16:36 +02:00
Norbert Federa
0572572eb9 fix issue with fnObjectFree and related casts
- remove unnecessary/dangerous OBJECT_xxx function-style casts
- fix -Wstrict-prototypes issue with OBJECT_NEW_FN definition
2018-10-19 11:30:01 +02:00
Armin Novak
554e18780b USe const compare function pointer arguments 2018-10-18 09:06:55 +02:00
David Fort
13e2a8834d winpr: add some functions to use wStream in a static way
It's sometime useful to create a stream aliasing a buffer on the stack, and
it's nice if we don't need some extra malloc for this.

Example use:
   BYTE buffer[20];
   wStream s;

   Stream_StaticInit(&s, buffer, sizeof(buffer));
   Stream_Write_UINT16(&s, 0xff01);
   Stream_Free(&s, FALSE);
2018-10-17 19:07:48 +02:00
Armin Novak
3416d1bdee Reset stream length to capacity in StreamPool_Take 2018-10-17 14:54:53 +02:00
Armin Novak
f91590ecbf Fixed bugs detected during scanbuild run 2018-10-17 13:19:33 +02:00
Marc-André Moreau
ce234411c9
Merge pull request #4914 from Devolutions/winpr-dll-export
Add WINPR_DLL definition to control WinPR symbol exporting
2018-10-16 09:09:05 -04:00
Martin Fleisz
168bab905d
Merge pull request #4916 from Devolutions/ios-path-fix
Fix iOS path detection functions
2018-10-05 09:50:27 +02:00
Sébastien Duquette
2497fcf941 Use fnObjectEquals in ArrayList_Remove. 2018-10-04 16:57:29 -04:00
Richard Markiewicz
ee7b5460b5 freerdp - fix iOS directory paths 2018-10-04 16:54:40 -04:00
Marc-André Moreau
1b42e512ee winpr: add WINPR_DLL definition 2018-10-04 15:09:49 -04:00
Armin Novak
a0f42280c3 Check if a boolean or flag argument has additional data.
Treat it as an error.
2018-09-28 12:59:20 +02:00
Armin Novak
bfeac80ed3 Fixed macro _stream_read_n16_le and _stream_read_n16_be
Cast to appropriate type to avoid integer truncation warnings.
2018-09-14 10:08:38 +02:00
Armin Novak
fad20be6e6 Fixed missing includes. 2018-08-27 14:34:42 +02:00
Armin Novak
00a5d06fc1 Fixed coverity memory leak. 2018-08-27 14:34:42 +02:00
Armin Novak
62c1696d4c Removed use of unchecked sprintf 2018-08-27 14:34:42 +02:00
Armin Novak
114abad767 Removed use of strcpy. 2018-08-27 14:34:09 +02:00
Armin Novak
d7d5567891 Fixed missing const. 2018-08-24 13:40:36 +02:00
Armin Novak
c159b2e9c8 Fixed missing check before calling memcpy 2018-08-24 13:40:36 +02:00
Martin Fleisz
8248dcb3bb
Merge pull request #4816 from akallabeth/drive_cmd_fix
Fix #4680: Return proper directory name.
2018-08-24 09:45:26 +02:00
Martin Fleisz
0afba58405
Merge pull request #4814 from akallabeth/linked_list_add_object
Linked list add object for user defined functions
2018-08-24 08:37:41 +02:00
Armin Novak
ab18f8f222 Fix #4680: Return proper directory name. 2018-08-23 10:04:26 +02:00
Ondrej Holy
95a043e0eb winpr/winsock: Fix leak found by covscan
0 is valid return value from socket().

leaked_handle: Handle variable "fd" going out of scope leaks the handle.
2018-08-23 09:11:24 +02:00
Ondrej Holy
0a11a06dc9 winpr/winsock: Format code by astyle
Run ./scripts/format_code.sh before the following changes.
2018-08-23 09:11:24 +02:00
Ondrej Holy
10b9c516f6 winpr/utils/wlog: Fix leak found by covscan
leaked_storage: Variable "result" going out of scope leaks the storage it points to.
leaked_storage: Variable "bt" going out of scope leaks the storage it points to.
2018-08-23 09:11:24 +02:00
Ondrej Holy
d3c2ceb0f6 winpr/utils/wlog: Format code by astyle
Run ./scripts/format_code.sh before the following changes.
2018-08-23 09:11:24 +02:00
Ondrej Holy
4813a70897 winpr/utils/ntlm: Prevent releasing function argument
The patch changes API of functions instead of fixing unused and broken code.

freed_arg: "free" frees parameter "NtHash".
2018-08-23 09:11:24 +02:00
Ondrej Holy
1c1d00aac0 winpr/utils/ntlm: Format code by astyle
Run ./scripts/format_code.sh before the following changes.
2018-08-22 14:34:02 +02:00
Ondrej Holy
35bccd5262 winpr/sspi/ntlm: Fix leak found by covscan
leaked_storage: Variable "sam" going out of scope leaks the storage it points to.
leaked_storage: Variable "s" going out of scope leaks the storage it points to.
leaked_storage: Variable "snt" going out of scope leaks the storage it points to.
2018-08-22 14:34:02 +02:00
Ondrej Holy
724bc7acd2 winpr/io/device: Fix leak found by covscan
leaked_storage: Variable "lpPipePath" going out of scope leaks the storage it points to.
2018-08-22 14:34:02 +02:00
Ondrej Holy
df9d0fab80 winpr/io/device: Format code by astyle
Run ./scripts/format_code.sh before the following changes.
2018-08-22 14:34:02 +02:00
Ondrej Holy
acbd6e6322 winpr/file: Fix leak found by covscan
overwrite_var: Overwriting handle "h" in "h = (HANDLE)0xffffffffffffffff" leaks the handle.
2018-08-22 14:34:02 +02:00
Armin Novak
b77dc13b5f Implemented linked list compare and value copy functions. 2018-08-22 12:39:11 +02:00
Armin Novak
8b8e85271c Fixed #4793: Return correct file handle for existing directory 2018-08-13 13:17:56 +02:00
Armin Novak
0352dc3d6c Fixed invalid format string. 2018-08-01 12:56:18 +02:00
Armin Novak
ed89328349 Fixed missing argument checks. 2018-07-30 10:46:20 +02:00
Armin Novak
3d8dec7fbf Removed debug log messages. 2018-07-11 16:37:29 +02:00
Armin Novak
dbfa896d5a Fixed errno reset. 2018-07-11 16:27:14 +02:00
Armin Novak
2b91095eb3 Fixed pattern detection if path is already a directory. 2018-07-11 10:58:37 +02:00
Armin Novak
30843ef4d8 Code cleanups and more logging. 2018-07-11 10:53:26 +02:00
Pascal J. Bourguignon
17a3782d1a FIX: moved declarations above the statements for strict C 90 compliance. 2018-06-07 13:29:44 +02:00
Pascal J. Bourguignon
15f2bafeab Cleaned up const char** -> char** for argv, since we definitely do modify the argv!
(we overwrite the password and pin arguments).
This implies changes in the argument parsing tests that now must pass a mutable argv
(copied from the statically declared test argvs).
Some other const inconsistency have been dealt with too.
2018-06-06 16:43:09 +02:00
Robert Corrigan
992554a01f Update time zone data to April 2018 2018-05-15 15:53:36 -04:00
Armin Novak
5a5b5eb6dd Fixed loadepng memory leak. 2018-05-15 14:30:35 +02:00
Martin Fleisz
f653686958
Merge pull request #4637 from akallabeth/win_ninja_support
VS2017 support: set pdb output directory for Ninja generator.
2018-05-15 13:47:28 +02:00
Armin Novak
e8b9116507 Fixed invalid function argument for ntlm_compute_message_integrity_check 2018-05-11 11:00:46 +02:00
Armin Novak
e71a39f214 Fixed compiler warnings (unused) 2018-05-11 11:00:01 +02:00
Armin Novak
6e958e7edb Fix #4628: CommandLineFindNextArgumentA must check the current argument
When determining if there is a next argument first check the current one
for abort criteria.
2018-05-06 10:49:05 +02:00
Armin Novak
5b961e9c75 Fixed /pth: Consistently treat the hash offset to password length. 2018-05-03 17:51:11 +02:00
akallabeth
dd577377dd
Merge pull request #4617 from kevans91/spurious
Upstream the rest of our local FreeBSD patching
2018-05-03 11:55:03 +02:00
akallabeth
d130d9cb21
Merge pull request #4613 from kevans91/file64
Enable 64-bit file support on FreeBSD as well
2018-05-03 11:31:54 +02:00
akallabeth
ba37f04e1b
Merge pull request #4616 from kevans91/timerfd-nonblock
Pass TFD_NONBLOCK to timerfd_create to avoid later fcntl
2018-05-03 10:56:04 +02:00
akallabeth
613e0be208
Merge pull request #4614 from kevans91/cmakemod
Abstract away CMake module installation setting, install differently on FreeBSD
2018-05-03 09:49:31 +02:00
Kyle Evans
8073a7850e Pull in the libepoll-shim includes for libwinpr's synch/test
This allows FreeBSD to successfully build with BUILD_TESTING enabled. Currently,
only 3/184 tests fail:

	 13 - TestLibraryLoadLibrary (Failed)
	 14 - TestLibraryGetProcAddress (Failed)
	 15 - TestLibraryGetModuleFileName (Failed)

These failures are probably due to a lack of GetModuleFileNameA implementation
on FreeBSD.
2018-05-02 23:19:44 -05:00
Kyle Evans
2fb992a962 Upstream the rest of our local FreeBSD patching
FreeBSD/DragonflyBSD are also UNIX platforms, as far as trio is concerned, and
we don't need to be setting the CMAKE_INSTALL_RPATH on FreeBSD.
2018-05-02 22:09:42 -05:00
Kyle Evans
f1a7c3cc6a Pass TFD_NONBLOCK to timerfd_create to avoid later fcntl 2018-05-02 21:03:49 -05:00
Kyle Evans
5463b23591 Enable 64-bit file support on FreeBSD as well 2018-05-02 10:38:44 -05:00
Kyle Evans
a7c0632bf2 Use SetFreeRDPCMakeInstallDir where CMake modules are installed 2018-05-02 10:36:52 -05:00
Armin Novak
60bf33f79d Determine posix timer availability by function availability
To avoid having to whitelist every os starting to implement posix
timer API just detect if the functions are available.
2018-05-02 11:17:32 +02:00
David Fort
a03c0d88d5
Merge pull request #4606 from kevans91/libressl-fixes
Pull in the LibreSSL compatibility patches from FreeBSD
2018-05-02 10:39:22 +02:00
Martin Fleisz
c0804699f1
Merge pull request #4609 from akallabeth/clipboard_return_check
Added proper return value checks for clipboard data.
2018-05-02 10:10:55 +02:00
Armin Novak
a1c3c1ad64 Added proper return value checks for clipboard data. 2018-05-02 09:21:42 +02:00
Kyle Evans
45d8e2dfb2 Pull in libepoll-shim for the bits that require timerfd/epoll
libepoll-shim is our implementation of this API on top of kevent. It supplies
the same headers and a library, but we don't install it in any of the default
include search paths when it comes in through ports on an as-needed basis.

This set of changes is restricted to FREEBSD-compatible OS, which includes
DragonflyBSD and FreeBSD.
2018-05-01 23:42:25 -05:00
Kyle Evans
f8c391876f Pull in the LibreSSL compatibility patches from FreeBSD 2018-05-01 08:43:36 -05:00
Martin Fleisz
b228deb998
Merge pull request #4543 from oshogbo/master
Fix variable passsed to HashCallback with MIC.
2018-04-18 14:50:31 +02:00
Mariusz Zaborski
509afe252d Remove MessageIntegrityCheck from context. 2018-04-17 15:03:27 +02:00
Mariusz Zaborski
fe37fede50 Fix variable passsed to HashCallback with MIC.
The value in the context is not set yet and we need one from
authentication message.
2018-04-06 21:18:20 +02:00
Mariusz Zaborski
00374382d9 There is no reason to restrict nSize to 2 the hostname can be empty on
UNIX-like machines.
2018-04-06 21:07:51 +02:00
MartinHaimberger
a9ecd6a6cc
Merge pull request #4535 from akallabeth/warning_fixes
Warning fixes
2018-04-05 10:20:43 +02:00
MartinHaimberger
55973288f2
Merge pull request #4514 from akallabeth/com_lpt_fix
Com lpt fix
2018-04-04 12:52:39 +02:00
Armin Novak
842707b106 Fixed printf format string. 2018-04-04 10:44:51 +02:00
Armin Novak
b260937ca6 Use __attribute__((destructor)) on non windows systems.
atexit in shared libraries is not universally supported.
2018-04-03 14:04:22 +02:00
Armin Novak
e0d112d548 Removed all calls to WLog_Init and WLog_Uninit
Since the calls are no longer required remove their usage.
2018-04-03 13:06:41 +02:00
Armin Novak
d249335708 Removed winpr_exit
As the cleanup functions are called by atexit a dedicated
cleanup call is no longer required.
2018-04-03 12:56:33 +02:00
Armin Novak
e1b53a282f Fix #4524: Initialize with cleanup handler
Use singleton initializer and register cleanup handler for logger.
2018-04-03 10:18:59 +02:00
UndefBehavior
08e7217c1b Fix SCardStatusW function
Terminating null character was inserted in the middle of readerNames instead of
last position in the unicode version of SCardStatus function.
This commit fix it.
2018-03-30 07:32:23 -07:00
Ilya Shipitsin
14c15c680d resolve several possible null pointer dereference
issue detected by cppcheck

[channels/drive/client/drive_main.c:454] -> [channels/drive/client/drive_main.c:443]: (warning) Either the condition '!irp' is redundant or there is possible null pointer dereference: irp.
[client/X11/xf_window.c:582] -> [client/X11/xf_window.c:580]: (warning) Either the condition '!xfc' is redundant or there is possible null pointer dereference: xfc.
[winpr/libwinpr/path/test/TestPathShell.c:40] -> [winpr/libwinpr/path/test/TestPathShell.c:43]: (warning) Either the condition '!path' is redundant or there is possible null pointer dereference: path.
[winpr/libwinpr/path/test/TestPathShell.c:49] -> [winpr/libwinpr/path/test/TestPathShell.c:52]: (warning) Either the condition '!path' is redundant or there is possible null pointer dereference: path.
2018-03-24 17:46:39 +05:00
Armin Novak
1316b828c9 Removed reserved COM and LPT check. 2018-03-23 10:44:32 +01:00
Martin Fleisz
8df96364f2 cssp: Add support for protocol version 6 2018-03-20 10:37:38 +01:00
Armin Novak
9bd13c25c9 Added WaitableTimer implementation for mac OS. 2018-03-12 13:39:21 +01:00
Armin Novak
44eebbb6e0 Fixed compiler warnings. 2018-03-07 14:47:06 +01:00
Armin Novak
66cc038c93 Fixed threadpool work function return and arguments. 2018-03-07 14:36:55 +01:00
Armin Novak
2517755d25 Fixed thread function return and parameters. 2018-03-07 14:36:55 +01:00
Martin Fleisz
900aa94796 debug: Fix broken format specifiers 2018-03-06 16:32:36 +01:00
Martin Fleisz
5077e88689
Merge pull request #4447 from akallabeth/apple_rpath_namespace
Apple rpath namespace fixes
2018-02-16 10:54:03 +01:00
Armin Novak
10aabdd631 Removed apple flat-namespace hack. 2018-02-16 10:05:11 +01:00
Armin Novak
e36d87b55c Fix #4445: Do not call fclose on NULL file. 2018-02-16 09:05:39 +01:00
Martin Fleisz
5d1ff02d02
Merge pull request #4414 from akallabeth/pthread_cleanup_fix
Pthread cleanup fix
2018-02-15 11:02:37 +01:00
Martin Fleisz
19a00f2099
Merge pull request #4325 from akallabeth/fixes_com
Fixes serial redirection name check and SAM file parser
2018-02-15 10:39:33 +01:00
Martin Fleisz
13be71381c
Merge pull request #4434 from akallabeth/winpr_digest_param
Fixed winpr digest type.
2018-02-14 15:54:13 +01:00
Armin Novak
89859d4c54 Fixed missing error return. 2018-02-14 13:51:38 +01:00
Armin Novak
5903d5b375 Fixed winpr digest type. 2018-02-14 12:48:45 +01:00
Armin Novak
53d2150e00 Fixed windows unicode authentication. 2018-02-13 11:29:56 +01:00
Armin Novak
2d58e96dcc Exit main thread with winpr_exit to trigger resource cleanup.
When using pthread_once with destructors they are only called,
if each thread (including the main thread) is exited with pthread_exit.
Introducing winpr_exit as a wrapper for that purpose.
2018-02-12 10:33:02 +01:00
Armin Novak
855dc9abaf Clear message queue on free. 2018-02-09 10:29:18 +01:00
Armin Novak
c586a300cf Fixed init once return. 2018-02-07 13:22:07 +01:00
Bernhard Miklautz
c7f1656ea8
Merge pull request #4400 from hardening/defines_clean
set some define consistency
2018-02-07 12:34:27 +01:00
David Fort
7ceb85c7a8
Merge pull request #4340 from akallabeth/init_once
Fix remaining issues with #2006
2018-02-07 10:34:18 +01:00
David Fort
6c64aa4e20 fixed include path
It was working because of multiple include directories.
2018-02-05 14:34:49 +01:00
David Fort
917bc4b551 set some define consistency
This patch cleanup the defines to make then consistent.
2018-02-05 14:17:23 +01:00
Armin Novak
60ab8cc724 Fixed memory leak. 2018-01-24 14:11:33 +01:00
Armin Novak
29f2d2d9bb Fixed missing packageName setup in server NLA 2018-01-17 09:09:58 +01:00
Armin Novak
dc48c42926 Refactored NTLM, functions static where approprate 2018-01-16 11:34:07 +01:00
Armin Novak
1611ec16b1 Refactored kerberos SSPI
* Functions static where approrpriate
* Variables static const where appropriate
2018-01-16 10:58:30 +01:00
Armin Novak
609a4eb6ae Fixed ICU support for CP_ACP 2018-01-16 10:37:19 +01:00
Armin Novak
c62fde53a4 Fix #4306:
* Do not reset context when changing package.
* All functions not exported static.
2018-01-16 10:31:08 +01:00
Armin Novak
5550f6ffe1 Fixed #4357: NTLM debug message. 2018-01-12 09:22:08 +01:00
Armin Novak
9804d5a4a7 SamOpen return NULL if file was not opened. 2018-01-08 13:07:11 +01:00
Armin Novak
d03f9858af Fixed #2006: Use InitOnceExecuteOnce 2018-01-08 12:41:32 +01:00
David Fort
e1cc601963
Merge pull request #4323 from akallabeth/scanbuild_fixes
Scanbuild and other warnings fixed
2018-01-08 11:16:21 +01:00
Anton Afanasyev
ed2e4e576d StartHTML and EndHTML values can be left-padded with 0 characters. strtol and friends treat this as base-8 if base is specified as 0.
Because these values are always sent in base-10, fix is to always use base-10
2018-01-06 18:45:22 -08:00
Armin Novak
04708b37e1 Fixed serious issues with SAM file parser
The parser ommitted various checks during file parsing.
Invalid syntax did crash the whole thing.
2017-12-21 14:39:43 +01:00
Armin Novak
6f1b8f04c6 Fixed check for reserved com devices. 2017-12-21 14:39:32 +01:00
Armin Novak
a0b49f4e07 Removed unused functions, fixed feature define guards 2017-12-21 11:30:21 +01:00
Armin Novak
50a0968c6a Removed unused variables. 2017-12-21 11:29:24 +01:00
Armin Novak
6a21bdae3d Fixed various scanbuild warnings. 2017-12-21 09:34:35 +01:00
akallabeth
e3e65734e8
Merge pull request #4303 from krisztian-kovacs-balabit/use-redirection-password
Use redirection password
2017-12-20 17:01:58 +01:00
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
KOVACS Krisztian
3c56300afa winpr/sspi: add possibility to set auth identity with Unicode password
To be able to avoid password conversion if the password is already unicode
this change adds the sspi_SetAuthIdentityWithUnicodePassword() function
that is identical to sspi_SetAuthIdentity() except that the password is
used without further conversions in the Unicode identity.
2017-12-06 16:30:57 +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
Armin Novak
4eb5b8e349 Replaced atoi 2017-11-15 15:52:16 +01:00
Armin Novak
8c2bd951ae Allow printing of custom arguments in help. 2017-11-15 15:25:34 +01:00
Armin Novak
65f4c560d3 Fixed uninitialized values and leaks. 2017-11-13 16:20:57 +01:00
dodo040
60406794ce fix Kerberos flavour's detection (MIT/Heimdal) and double free for MIT<1.13 2017-11-13 16:20:56 +01:00
dodo040
1d97286a76 fix undeclared identifier on Windows 2017-11-13 16:20:56 +01:00
dodo040
335de159b0 use SSIZE_T instead of ssize_t 2017-11-13 16:20:56 +01:00
dodo040
9adb971181 handle missing ssize_t on Windows 2017-11-13 16:20:56 +01:00
dodo040
3e897a63cb remove useless includes 2017-11-13 16:20:56 +01:00
dodo040
e0a9999fb2 fix: GSS API init, enterprise name management, variable names and format code 2017-11-13 16:20:56 +01:00
dodo040
b81f168f0e initial commit for kerberos support 2017-11-13 16:20:55 +01:00
David Fort
de7d7e43c9 serial redirection: implement event char
The signotec signature device requires the eventChar support to work properly in
serial redirection mode. This implementation is basic but does the job for this
device.

Sponsored by: Rangee GmbH (http://www.rangee.de)
2017-11-06 22:26:17 +01:00
Armin Novak
269c78802d Fixed #4199: ConvertFindDataAToW string length 2017-10-31 16:52:08 +01:00
Mike Gilbert
5cd230ac74 winpr: _IoCreateDeviceEx: fix mkdir error check
The mkdir(2) function returns 0 on success, and -1 on error.

This resolves an error in TestIoDevice when /tmp/.device/ does not
exist.

Bug: https://bugs.gentoo.org/635838
2017-10-30 11:59:35 -04:00
Roman Kalashnikov
612e8b0710
Update semaphore.c 2017-10-28 11:59:23 +03:00
Roman Kalashnikov
4db363f107
Fixed Expression 'pComm != NULL' is always true
pComm was checked earlier in 1363 string:
`if (pComm == NULL)`
2017-10-28 01:48:41 +03:00
Roman Kalashnikov
67a97612e6
Fixed duplicated assigne 2017-10-28 01:46:06 +03:00
Armin Novak
3840b27945 Fixed file timestamps. 2017-10-12 11:28:07 +02:00
Bernhard Miklautz
1aec784f75 feat: add support for .source_version
When building packages, especially when source packages are used, git is
not necessarily available or the source isn't provided in git. In those
cases it wasn't possible to set the GIT_REVISION and --version shows
"n/a" for the git revision.

If the file .source_version is available now the content of it is used
as GIT_REVISION. Packagers might want to add a .source_version file
when they don't build the packages from git.

Possible breaking change:

The variable PRODUCT_VERSION isn't available anymore. Use GIT_REVISION
instead.
2017-10-06 15:02:23 +02:00
Armin Novak
bcfa434da2 Fixed resizing of PubSub 2017-09-25 13:33:04 +02:00
David Fort
babeb34d88 Merge pull request #4060 from akallabeth/icu_support
Using ICU instead of custom unicode conversion.
2017-09-25 09:33:58 +02:00
Bernhard Miklautz
3626676ac6 winpr/makecert: fix linking against libcrypto
Use OPENSSL_CRYPTO_LIBRARIES instead of linking against crypto directly.
2017-09-23 14:13:39 +02:00
Bernhard Miklautz
bbd11eef1d Merge pull request #4045 from akallabeth/drive_fixes_overlayfs
Drive fixes overlayfs
2017-09-22 17:22:00 +02:00
David Fort
5115ecd948 Merge pull request #4063 from akallabeth/auth_fixes
Fixed leaks, certificate comparison and channel context cleanup
2017-08-30 10:19:12 +02:00
Bernhard Miklautz
52fbfb7b12 fix clang warnings, directly include wtypes.h (#4097)
* build: clang use -Wno-unused-command-line-argument

With clang 5.0 builds are quite noisy otherwise.

* Directly include wtypes.h

Directly include winpr/wtypes.h where _fseeki64 or _ftelli64 is used.

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: parentheses-equality

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning: tautological-compare

* fix build warnings with clang 5

clang version: 5.0.0-svn310678-1~exp1 (branches/release_50)
Warning:
incompatible pointer types passing 'size_t *' (aka 'unsigned
long *') to parameter of type 'UINT32 *' (aka 'unsigned int *')
[-Wincompatible-pointer-types]
2017-08-29 09:09:38 +02:00
Armin Novak
7e32e90d4c Fixed RSA generation for OpenSSL >= 1.1 2017-08-17 13:16:32 +02:00
Armin Novak
f143fcc298 Fixed data type, eliminate warning. 2017-08-16 15:45:11 +02:00
Armin Novak
9ebfbc1fcb FindNextFileAx, continue if a inalid file is found. 2017-08-16 10:25:23 +02:00
Bernhard Miklautz
ed36f55f3e Merge pull request #4088 from akallabeth/file_api_64bit_fixes
fseeko and ftello for 64bit file support.
2017-08-16 10:04:13 +02:00
Armin Novak
c3d4b7d262 fseeko and ftello for 64bit file support. 2017-08-14 08:42:49 +02:00
Armin Novak
82d9ebc380 Fixed FileSetFilePointer warnings 2017-08-10 16:56:20 +02:00
MartinHaimberger
80ed23779f Merge pull request #4076 from akallabeth/SetFilePointer_fix
Set file pointer fix
2017-08-09 10:35:37 +02:00
Armin Novak
7d7e5487ab Fixed SetFilePointer, added SetFilePointerEx 2017-08-08 10:51:50 +02:00
Jura Sasek
a84c5cbfb9 Sun keyboard 2017-08-04 13:09:32 +02:00
Armin Novak
efe6971899 Skip FIFO files in listings. 2017-08-04 09:01:13 +02:00
Armin Novak
0a23bdf61f Abort CreateFile for existing files of type FIFO 2017-08-03 14:45:19 +02:00
Armin Novak
436829142e Mapped ENOTCONN to ERROR_FILE_NOT_FOUND 2017-08-03 14:38:20 +02:00
Mike Gabriel
dc075fb133 Fix warning in man pages
"warning: can't find macro file `www.tmac))'""`"
2017-08-03 08:41:50 +02:00
Mike Gabriel
c045bddf3f Fix typos in some error messages 2017-08-03 08:38:05 +02:00
David Fort
c84065f40c Merge pull request #4069 from yurashek/master
Build on Solaris
2017-08-02 09:53:38 +02:00
Armin Novak
11fa9f6753 Free credentials on exit. 2017-07-28 08:39:49 +02:00
Armin Novak
ceda244165 Fixed uninitialized values and leaks. 2017-07-28 08:35:31 +02:00
Valery Kartel
9bf9ff9e8a Fix build with LibreSSL 2017-07-26 17:12:14 +03:00
Armin Novak
1868acb0ac Using ICU instead of custom unicode conversion.
If WITH_ICU CMake option is set the unicode conversion routines
use ICU instead of custom conversion code.
2017-07-26 13:00:45 +02:00
Armin Novak
c8f97efb40 Added EROFS mapping. 2017-07-26 11:02:55 +02:00