Commit Graph

2030 Commits

Author SHA1 Message Date
Ondrej Holy
250998efb8 winpr: Be sure data points to BYTE in endian.h
The conversion macros don't work properly if input data doesn't point
to BYTE. Cast the input data to BYTE to avoid unexpected behavior and
to simplify usage of the macros.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
11221e7e2c winpr: Fix Data_Read_UINT16
There is a bug which causes that higher byte and lower byte contain
first byte of data and second byte of data is lost. The patch fixes
it similarly as it is done in Stream_Read_UINT16.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Ondrej Holy
6d2ab9cc47 winpr: Fix 64-bit architecture detection
The current definitions wrongly assume the only 64-bit architecture is
x86_64. Use the __ILP64__, __LP64__ and __LLP64__ to correctly define
the size of a long and of pointer.

The patch is needed for platforms such as ppc64, or s360x, otherwise
you can see following warnings:
warning: cast from pointer to integer of different size

The patch is modification of debian downstream patch:
http://anonscm.debian.org/cgit/collab-maint/freerdp.git/tree/debian/patches/1004_64-bit-architectures.patch

Original author is Aurelien Jarno probably.

https://github.com/FreeRDP/FreeRDP/issues/2520
2016-05-30 13:37:15 +02:00
Norbert Federa
e8c4910e2e fix segfaults casused by size_t format specifier
win32/msvc cc does not recognize the %z format specifier which caused
invalid references and segfaults on win32.
Until FreeRDP gets format specifier macros we'll cast size_t to
unsigned long and use the %lu specifier.

Also simplified winpr_backtrace_symbols() a little bit and fixed it
to allocate the correct amount of bytes for the return buffer.
2016-05-27 15:55:28 +02:00
Hardening
00dd6f8c51 Merge pull request #3372 from nfedera/fix-winpr-test-library
winpr/library: fix win32 test and some cleanup
2016-05-27 14:53:12 +02:00
Norbert Federa
d2b2a921f1 winpr/library: fix win32 test and some cleanup
On Windows we seem to have to load the TestLibrary[AB] test libraries
from in same folder the test executable runs.

Also removed the empty RemoveDllDirectory, SetDefaultDllDirectories,
AddDllDirectory tests and the redundant FreeLibrary test.

TestLibrary now works and succeeds on Win32.

sadasd
2016-05-27 14:34:41 +02:00
Norbert Federa
a45ac8dad8 winpr/path: fix PathCchFindExtensionA and more
- PathCchFindExtensionA had an off-by-one error when verifying the
  required null termination
- TestPathCchFindExtension used unicode strings when testing the
  *A (ASCII) functions
- The PathAllocCombineW implementation (which is still buggy has
  hell) used strlen to calculate the lenght of unicode strings

TestPath now succeeds on WIN32
2016-05-26 18:36:02 +02:00
Norbert Federa
9370d98575 winpr/pipe: fix CreateNamedPipe test
GetLastError() was not always checked for ERROR_PIPE_CONNECTED which
indicates success if ConnectNamePipe returns FALSE.

TestPipe now also succeeds on Win32
2016-05-26 13:52:30 +02:00
Norbert Federa
1b231f9dd9 winpr/thread: fix TestThreadCreateProcess
On WIN32 TestThread now works and is expected to succeed
2016-05-25 15:47:58 +02:00
Norbert Federa
aded51f38f winpr/synch: fix tests
TestSynchTimerQueue:
- fixed race condition

TestSynchWaitableTimerAPC:
- Use WaitForSingleObjectEx since the thread must be in an alterable state

TestSynch is now expected to succeed on WIN32
2016-05-24 22:33:27 +02:00
Norbert Federa
386d290015 winpr/synch: fix mutex implementation
- Mutex is recursive on Windows; as a consequence we have to use
  the pthread PTHREAD_MUTEX_RECURSIVE type
- Adapt MutexCloseHandle accordingly
- ReleaseMutex returned TRUE even if pthread_mutex_unlock failed
- Fixed and improved the TestSynchMutex ctest
2016-05-24 15:10:57 +02:00
Bernhard Miklautz
5d030534db winpr/event: fix file descriptor leak
SetEventFileDescriptor overrides the internal file descriptor of the
event but didn't close it. Now if the descriptor is closed if it isn't
marked as attached.
2016-05-23 13:04:44 +02:00
Hardening
4e66df7228 Merge pull request #3333 from akallabeth/memleak_fixes
Memleak fixes
2016-05-13 11:32:48 +02:00
Robert Corrigan
73e13b0b29 KB3153731: May 2016 DST update for Azerbaijan, Chile, Haiti and Morocco 2016-05-12 13:24:21 -04:00
Armin Novak
eacf2b542e Fixed memory leaks. 2016-05-12 10:01:30 +02:00
Marc-André Moreau
6b73757085 Merge branch 'master' of github.com:awakecoding/FreeRDP 2016-05-11 13:13:02 -04:00
Marc-André Moreau
d4c809c4ae winpr: fix definitions of synchronization barrier and interlocked functions 2016-05-11 13:12:44 -04:00
Marc-André Moreau
915b9a15b1 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	winpr/libwinpr/bcrypt/CMakeLists.txt
2016-05-11 11:05:17 -04:00
Bernhard Miklautz
59fbfdb24b Add library libwinpr-tools
libwinpr-tools is a replacement for winpr-makecert-tool.a. Currently
it's basically the same as winpr-makecert-tool.a but in future
functionality that doesn't fit directly in winpr will be added here.
2016-05-03 14:42:08 +02:00
Bernhard Miklautz
81d30cc480 Disable comm tests per default
comm tests require a serial device for testing. If the test environment
isn't available the tests will return errors therefore the tests are
now disabled per default. They can be (re-)enabled by using the cmake
option BUILD_COMM_TESTS.
2016-05-02 16:59:25 +02:00
Bernhard Miklautz
bd7ed27f92 Merge pull request #3305 from akallabeth/dynamic_channel_crash_fix
Dynamic channel crash fix
2016-04-26 11:01:40 +02:00
akallabeth
a62d962bc7 Merge pull request #3250 from mfleisz/cssp_v3
core: Add support for CredSSP version 3
2016-04-26 09:59:40 +02:00
Armin Novak
ee186bec73 ListDictionary handle NULL list argument. 2016-04-26 09:34:12 +02:00
Robert Corrigan
f8c42da561 KB3148851: Updates to Russian Time Zones for 2016 2016-04-13 14:44:30 -04:00
Marc-André Moreau
a192967a5b libwinpr-path: fix missing shlwapi.lib import 2016-03-30 10:58:36 -04:00
Marc-André Moreau
8fcc2aabf1 Merge branch 'master' of github.com:awakecoding/FreeRDP 2016-03-30 10:47:01 -04:00
Marc-André Moreau
cedf6d98e2 freerdp: more UWP porting 2016-03-29 20:34:52 -04:00
Marc-André Moreau
4d629a7999 freerdp: UWP porting 2016-03-29 16:03:15 -04:00
Bernhard Miklautz
9e8c6c99b6 First shot on fixing over linking
If a target is linked against libraries with cmake
(target_link_libraries) and the libraries are not marked as PRIVATE
they are "exported" and in case a other target is linked against this
target it is also linked against *all* (not private) libraries.

Without declaring private libraries PRIVATE a lot of over linking
(linking against unneeded libraries) was done.
2016-03-29 18:14:34 +02:00
Bernhard Miklautz
b184f58c1b winpr/TestFileGetStdHandle: rename variable stdout
stdout shouldn't be used as variable name (can't even be used on
windows).
2016-03-29 18:14:16 +02:00
Marc-André Moreau
2201ac5266 winpr: fix PathFileExists on UWP 2016-03-25 12:20:51 -04:00
Martin Fleisz
98528ea973 winpr: Fix definition of NTSTATUS_FROM_WIN32 2016-03-18 13:45:51 +01:00
Martin Fleisz
1c2d315354 core: Add support for CredSSP version 3 2016-03-18 13:32:13 +01:00
Martin Fleisz
80cd64732f Merge pull request #3164 from akallabeth/windows_UnixChangeFileMode
Implemented UnixChangeFileMode for windows.
2016-03-16 15:19:11 +01:00
akallabeth
0c99d6a4fe Merge pull request #3226 from rjcorrig/#3198
winpr: Updates time zones and fixes bias values
2016-03-16 13:32:51 +01:00
Robert Corrigan
a4f0089d45 winpr_detect_windows_time_zone should have void argument 2016-03-16 08:29:21 -04:00
Armin Novak
3d23a772f6 Updated ConvertToUnicode return check. 2016-03-16 13:08:06 +01:00
Bernhard Miklautz
1b1563658e Merge pull request #3214 from hardening/fix_systemd_appender
Make systemd appender honor layout and logs off
2016-03-16 11:58:31 +01:00
Marc-André Moreau
9211f44e46 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2016-03-15 20:19:15 -04:00
Robert Corrigan
16796b9c9d winpr: Updates time zones and fixes bias values 2016-03-14 11:38:31 -04:00
Martin Fleisz
0249b09677 winpr: Fix definition of PathFileExists on Win32 2016-03-14 14:08:48 +01:00
Hardening
19494bd75a Make systemd appender honor layout and log off 2016-03-10 23:41:12 +01:00
Martin Fleisz
30325f189f Merge pull request #3181 from akallabeth/wlog_filter_fix
Respecting filter in WLog_GetLogLevel
2016-03-08 10:05:57 +01:00
Marc-André Moreau
c78a142388 Merge branch 'master' of github.com:awakecoding/FreeRDP 2016-03-07 21:21:17 -05:00
Marc-André Moreau
d61c2d4535 winpr: fix ini utils leak 2016-03-07 21:21:06 -05:00
Marc-André Moreau
ceefc4b099 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2016-03-07 10:19:50 -05:00
Armin Novak
2208a84cd4 Moved assistance to winpr crypto. 2016-03-07 11:51:13 +01:00
akallabeth
ece552dad2 Merge pull request #3200 from dwmw2/master
winpr: Bump API version to 2.0
2016-03-07 10:50:35 +01:00
Armin Novak
34b12362cb Fixed FreeBSD support for filetime settings. 2016-03-06 15:01:58 +01:00
David Woodhouse
701f54e07d winpr: Bump API version to 2.0
In commit 12bd0ec8 ("winpr: BUMP the API version to 1.2") it was stated
that the intention was to allow multiple winpr versions to be installed
in parallel.

However, it's not sufficient to change just the *minor* version of the
library. The soname is still 'libwinpr.so.1', and thus we still can't
coexist with earlier versions — in particular, we can't install FreeRDP2
in parallel with existing distribution packages of earlier versions.

Bump the soname so it does actually work
2016-03-04 13:22:58 +00:00
Norbert Federa
ef4b29e5b3 ConvertFromUnicode fixes and misc hardening
- Added missing ConvertFromUnicode checks
- If ConvertToUnicode allocates memory, guarantee the null termination
  similar to ConvertFromUnicode's implementation
- Fixed some TestUnicodeConversion.c CTest return values
- Added some CTests for ConvertFromUnicode and ConvertToUnicode
- Misc code and protocol hardening fixes in the surrounding code regions
  that have been touched
2016-03-03 16:56:19 +01:00
Armin Novak
ee2839fc7f Caching log filter after first use.
Reduce runtime penalty for log level checks by
remembering the log level found during first call.
2016-03-03 12:43:39 +01:00
Jakub Adam
bc750e9830 Fix build on older 32-bit Ubuntu releases
Some older 32-bit versions of gcc fail on '#elif __x86_64__'.
This applies at least to what Ubuntu 14.04 and 15.04 have as
the default compiler.
2016-03-02 19:40:38 +01:00
Armin Novak
0ea7aea6d9 Remember filter log level. 2016-03-02 19:07:32 +01:00
Bernhard Miklautz
7075353417 winpr: fix regression in timezone detection
ConvertToUnicode can't be used if the destination is a static buffer.
StandardName and DaylightName were invalid and timezone
redirection didn't work.

This regression was introduced with PR #3151
2016-03-02 18:44:17 +01:00
Armin Novak
41fdac2667 Respecting filter in WLog_GetLogLevel 2016-03-02 14:11:15 +01:00
Martin Fleisz
857c37393b Merge pull request #3163 from akallabeth/set_file_time
Implemented SetFileTime
2016-03-02 09:43:46 +01:00
Armin Novak
c74e37dbfd Implemented UnixChangeFileMode for windows. 2016-03-02 09:41:47 +01:00
Armin Novak
65cddbc3fb Removed obsolete log message. 2016-03-02 09:16:59 +01:00
Armin Novak
227ecc4bd5 Fixed uninitialized variable. 2016-03-02 09:16:49 +01:00
Bernhard Miklautz
e02af8287e Merge pull request #3160 from akallabeth/stream_fixes
Stream fixes
2016-03-01 16:44:19 +01:00
Armin Novak
a79072a87c Added tests for remaining stream functions. 2016-03-01 12:58:09 +01:00
Armin Novak
e7814d5855 Fixed stream API for Stream_Copy. 2016-03-01 12:57:48 +01:00
Armin Novak
a98e0f9ebb Reverted opaque structures. 2016-03-01 10:29:51 +01:00
Bernhard Miklautz
014f31db35 Merge pull request #3171 from akallabeth/crypto_simplification
Crypto simplification
2016-02-29 17:10:53 +01:00
Armin Novak
c182be093d Removed module.def from build config. 2016-02-29 15:24:07 +01:00
Armin Novak
68c402ac58 Removed windows module.def files.
All symbols exported from libraries are declared
using *_API defines.
2016-02-29 15:18:47 +01:00
Armin Novak
4e4d2e11d4 Fixed crypto tests. 2016-02-29 14:45:03 +01:00
Armin Novak
19568c6e9b Fixed indentation. 2016-02-29 11:12:32 +01:00
Armin Novak
7e6501374d Fixed memory leak. 2016-02-29 11:10:15 +01:00
Armin Novak
b429d230cb Refactored crypto *_New functions. 2016-02-29 09:00:02 +01:00
Armin Novak
92c15783dc Updated RC4 API, fixed crashing bug. 2016-02-28 11:19:29 +01:00
Armin Novak
238ff3b315 Unified encryption functions. 2016-02-27 23:28:49 +01:00
Armin Novak
4929844971 Fixed const argument for Stream_Write. 2016-02-27 22:16:41 +01:00
Armin Novak
1036f1e296 Fixed default visibility.
When nothing is declared, only export symbols defined
with WINPR_API or FREERDP_API defined.
Override this setting if BUILD_TESTING to allow tests
access to internal functions usually not exposed.
2016-02-26 19:44:14 +01:00
Armin Novak
98d4a9347a Added support for android SetFileTime.
Deactivated libjpeg support for android.
2016-02-26 12:27:59 +01:00
Armin Novak
5537230298 Fixed missing iOS UTIME_OMIT. 2016-02-26 11:43:54 +01:00
Armin Novak
436be2441a Implemented SetFileTime 2016-02-26 11:00:17 +01:00
Martin Fleisz
4f22682ed2 Merge pull request #3151 from akallabeth/timezone_refactor
Timezone refactor
2016-02-26 09:57:35 +01:00
Hardening
4217262680 Merge pull request #3156 from akallabeth/ssl_wrapper_merge
Ssl wrapper merge
2016-02-26 09:52:43 +01:00
Armin Novak
fe8f5dee82 Fixed indentation. 2016-02-26 09:32:17 +01:00
Bernhard Miklautz
71836f6cab build winpr: export WINPR_API_VERSION 2016-02-25 23:38:53 +01:00
Armin Novak
cf9543e350 Converted Stream defines to inline functions.
Using inline functions allows compiler type checks
2016-02-25 20:13:56 +01:00
Armin Novak
f997421098 Unified hmac functions. 2016-02-24 21:50:08 +01:00
Armin Novak
6e8ea34f06 Updated cryto wrapper API. 2016-02-24 20:32:20 +01:00
Armin Novak
0bfe5bad85 Fixed naming of static functions. 2016-02-24 20:16:19 +01:00
Armin Novak
06da644007 Unified md5 functions. 2016-02-24 16:46:25 +01:00
Armin Novak
0e4ea3943a Unified sha1 functions. 2016-02-24 16:36:15 +01:00
Armin Novak
7795ebdc15 Fixed return value for DST. 2016-02-24 09:43:53 +01:00
Armin Novak
495df6d6ec Readded read timezone from link. 2016-02-24 09:42:12 +01:00
Armin Novak
1cd6697bca Implemented timezone detection for android
Refactored version of patch from pxx02134
2016-02-24 09:28:30 +01:00
Armin Novak
447ac23aee Refactored timezone functions. 2016-02-24 09:28:30 +01:00
akallabeth
7c5fcc9ee2 Merge pull request #3149 from bmiklautz/feb22
Misc fixes
2016-02-23 20:23:52 +01:00
Bernhard Miklautz
35faa8b221 Merge pull request #3148 from mfleisz/win32_include_fix
winpr/file: Add missing include (io.h) for windows builds
2016-02-23 11:44:58 +01:00
akallabeth
05aa425cae Merge pull request #2851 from ilammy/x11-cliprdr/improve-format-support
Improve clipboard format support in X11 client
2016-02-23 09:56:17 +01:00
Martin Fleisz
1b881e47d3 winpr/file: Add missing include (io.h) for windows builds 2016-02-23 09:55:55 +01:00
Bernhard Miklautz
e6f013eac7 fix spelling
replace occured with occurred
Fixes #3142
2016-02-22 17:01:43 +01:00
Bernhard Miklautz
12bd0ec823 winpr: BUMP the API version to 1.2
This is required that the exported cmake find module can be
differentiated from the "old" one. This allows it to have
multiple winpr API version installed in parallel.

find_package should now be used with an explicit version number
set like:

find_package(WinPR 1.2 REQUIRED)
2016-02-16 17:39:22 +01:00
Hardening
2a3e9996b3 Merge pull request #2710 from akallabeth/cert_temp_accept_v2
Extended certificate callbacks.
2016-02-15 13:52:47 +01:00
Bernhard Miklautz
cf6ea23576 Merge pull request #3123 from nfedera/fix-keyboardtype-7
Several fixes for keyboard type 7 (japanese)
2016-02-12 10:43:25 +01:00