Commit Graph

3247 Commits

Author SHA1 Message Date
akallabeth
53a52a055d Added missing WINPR_ASSERT to MessageQueue 2021-09-20 10:59:59 +02:00
akallabeth
d80b418bbc Added object copy support to queue
* Added object copy support to Queue_Enqueue
* Added Queue_Discard to clear the top of the queue
* Added some doxygen for queue functions.
2021-09-20 10:59:59 +02:00
Armin Novak
1d9e886a7f Fixed timezone detection on linux.
Fix originally proposed via IRC by myth0s
Original changeset at https://paste.debian.net/hidden/0a03314a/
2021-09-20 09:39:40 +02:00
akallabeth
ab90ddc781 Fixed clang pragma 2021-09-14 09:45:03 +02:00
akallabeth
436e65acc9 Use BIO_read_ex only with OpenSSL >= 1.1.1 2021-09-14 09:45:03 +02:00
Armin Novak
673fb46836 Fixed uninitialized warnings 2021-09-10 08:16:25 +02:00
Armin Novak
0fe1e2359e Fixed all reserved-id-macro warnings 2021-09-10 08:16:25 +02:00
Armin Novak
ba0da04217 Fixed compilation warnings and duplicate defines 2021-09-09 08:53:20 +02:00
Armin Novak
4daa09c3e5 Fixed missing checks for queue functions 2021-09-09 08:53:20 +02:00
Armin Novak
6c859b4579 Fixed winpr-makecert for large data
Reading data from BIO did not check for completeness.
2021-09-09 08:53:20 +02:00
Armin Novak
9f0eff604e Silence GCC reserved-id-macro warnings in compatibility header 2021-09-09 08:53:20 +02:00
Armin Novak
0f8c52b9ca Fixed const warnings with argument parser 2021-09-09 08:53:20 +02:00
Armin Novak
c8571dd5fd Replaced chmod with safer fchmod
* Use fchmod so the file may not change underneath
* Add unit tests for SetFileAttributesA
* Add warning logs for unsupported flags
2021-09-06 10:11:14 +02:00
Armin Novak
fbae9ba88c Added LoadLibraryX and LoadLibraryExX
These functions take a UTF8 string and load a library with
LoadLibraryW under windows.
2021-09-03 08:29:15 +02:00
Armin Novak
737f5a2036 Fixed argument const correctness 2021-08-27 13:21:02 +02:00
akallabeth
f1bde376b1
Raw channel send (#7255)
* Added raw channel data write function

* Use nego_set_state

* Added ArrayList_ForEachAP

* Provide va_copy for older VS compilers
2021-08-26 16:17:51 +02:00
Armin Novak
68f24477f6 Fixed compilation warnings on mac 2021-08-26 15:08:28 +02:00
Armin Novak
55d2363efb Removed alloca use from WaitForMultipleObjectsEx 2021-08-25 13:41:38 +02:00
Armin Novak
5afa592244 Fixed cast-qual warnings 2021-08-24 11:10:51 +02:00
Armin Novak
cbb06a7c17 Fixed DsParse implementations and tests
* Implemented DsMakeSpnW
* Removed unimplemented DsCrackSpnA and DsCrackSpnW
2021-08-24 10:45:57 +02:00
Armin Novak
04ff6b8824 Implemented TestFileDeleteFile 2021-08-24 10:45:57 +02:00
Armin Novak
af0ce13d8a Removed not implemented module 2021-08-24 10:45:57 +02:00
Armin Novak
5eea7fc12d WINPR_UNUSED argc, argv for unit tests 2021-08-24 10:45:57 +02:00
Armin Novak
f515bd4560 Fixed shadowing and type errors 2021-08-24 10:45:57 +02:00
Pascal Nowack
8fe794b312 winpr/clipboard: Omit last line ending for gnome-copied-files
Every uri in the x-special/gnome-copied-files mime type is separated by
a '\n' char.
However, not every line ends with '\n'. The last line MUST not include
the new line character.
2021-08-19 09:08:11 +02:00
Mike Gilbert
5208a67ea7
Fix TestUnicodeConversion on big endian machines (#7219)
Wide character literals are stored in native byte order.
Use an array of bytes as a reference instead.

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6968
2021-08-16 22:11:03 +02:00
Ondrej Holy
67f3fff2c8
winpr/crypto: Load legacy provider to fix rc4 with OpenSSL 3.0 (#7210)
* winpr/crypto: Exit cleanly when EVP_EncryptInit_ex fails

The `EVP_EncryptInit_ex` function may fail in certain configurations.
Consequently, FreeRDP segfaults in `EVP_CIPHER_CTX_set_key_length`.
Let's handle the `EVP_EncryptInit_ex` failures and exit cleanly in
such case.

* winpr/crypto: Load legacy provider to fix rc4 with OpenSSL 3.0

Currently, the `EVP_EncryptInit_ex` function fails for rc4 with OpenSSL 3.0.
This is becuase rc4 is provided by the legacy provider which is not loaded
by default. Let's explicitly load the legacy provider to make FreeRDP work
with OpenSSL 3.0.

Relates: https://github.com/openssl/openssl/issues/14392
Fixes: https://github.com/FreeRDP/FreeRDP/issues/6604
2021-08-03 15:28:58 +02:00
Armin Novak
00c5a42eef Fixed warnings in TestLinkedList 2021-08-02 10:28:06 +02:00
Armin Novak
610396e197 Fixed compilation warnings
Try to get the number of warnings down
2021-08-02 10:28:06 +02:00
Mike Gilbert
0c81c73c8d winpr: avoid calling FIPS_mode() with OpenSSL 3.0
Fixes: 26bf2816c3
2021-08-02 08:27:07 +02:00
Fabrice Fontaine
0976cce458 winpr/include/winpr/file.h: fix build on uclibc
Include stdio.h to fix the following build failure with uclibc raised
since version 2.4.0 and
eb6777ea69:

In file included from /tmp/instance-0/output-1/build/freerdp-2.4.0/winpr/libwinpr/utils/lodepng/lodepng.c:30:
/tmp/instance-0/output-1/build/freerdp-2.4.0/winpr/include/winpr/file.h:524:11: error: unknown type name 'FILE'
 WINPR_API FILE* winpr_fopen(const char* path, const char* mode);
           ^~~~

Fixes:
 - http://autobuild.buildroot.org/results/31e770a330158035e24b7b952bec0030138482b7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-08-01 09:37:24 +02:00
ddoe
fb3f85779b fixup! Improvement: Add a way to get timezone from environment. Firstly get timezone from environment. If not present, use file method 2021-07-20 15:31:57 +02:00
ddoe
badc57984e Improvement: Add a way to get timezone from environment.
Firstly get timezone from environment. If not present, use file method
2021-07-20 15:31:57 +02:00
Martin Fleisz
74c6ad9906 test: Add unit test for CommandLineParseCommaSeparatedValuesEx 2021-07-07 09:07:46 +02:00
Martin Fleisz
a29cffbb6d winpr: Fix parsing of comma separated values if list is an empty string 2021-07-07 09:07:46 +02:00
akallabeth
1c7e3933a4
Fixed CMake options, define in library that use them. (#7141) 2021-07-01 16:19:12 +02:00
akallabeth
c3a85432b8 Fixed buildpackage warnings 2021-06-30 11:57:23 +02:00
akallabeth
14f41bb435 Remove obsolete HAVE_SYS_STRTIO_H 2021-06-30 10:06:17 +02:00
Armin Novak
ed7e3761f1 Fixed include paths for uwac 2021-06-28 15:06:30 +02:00
Armin Novak
c8d570a074 Fixed include paths for WinPR 2021-06-28 15:06:30 +02:00
Armin Novak
2e42df9515 Fixed HAVE_PTHREAD_MUTEX_TIMEDLOCK 2021-06-28 15:06:30 +02:00
Armin Novak
fd08c77f7f Fixed definition of config.h symbols 2021-06-28 15:06:30 +02:00
Alexandru Bagu
9c259f09ec fix setValue for HashTable 2021-06-28 09:12:40 +02:00
Biswapriyo Nath
a22bd407b0 winpr: Fix typo in NTLM_AV_ID member.
According to Microsoft specifications[1] the 10th member is named as MsvAvChannelBindings.
[1]: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-nlmp/
2021-06-23 12:04:29 +02:00
akallabeth
534d30beb3
No deprecated (#7107)
* Removed cmake options disabling compiler warnings

* Added deprecation compile options

* Fixed android client use of deprecated symbols

* Removed obsolete callback
2021-06-22 14:39:10 +02:00
Armin Novak
8ef57bf296 Replaced CMAKE_[SOURCE|BINARY]_DIR with PROJECT_[SOURCE|BINARY]_DIR
Thanks @Pollux42 for the hint in #7096
2021-06-22 08:54:18 +02:00
akallabeth
b453d5e40e Fixed rdtk, uwac and winpr standalone builds 2021-06-22 08:54:18 +02:00
akallabeth
81cef9251f Upgrade CMake requirement to 3.4 2021-06-22 08:54:18 +02:00
Ali Abdel-Qader
c0e29f7f19 Re-added "extern" to ntlm_export.h symbols 2021-06-19 09:49:41 +02:00
Armin Novak
4dfee30934 Fixed smartcard related warnings 2021-06-18 11:32:16 +02:00
Armin Novak
09cf11ecf0 WinPR: Fixed warnings, added assertions 2021-06-18 11:32:16 +02:00
Armin Novak
81a4670af0 Fixed ntlm_export.h includes 2021-06-18 09:41:02 +02:00
akallabeth
6726772d8d Fixed integer warnings 2021-06-18 09:41:02 +02:00
akallabeth
8d82adb28a Fixed warnings 2021-06-17 10:35:22 +02:00
Armin Novak
2e0d1cc33c Fixed integer warnings, fixed data types 2021-06-17 10:35:22 +02:00
Armin Novak
299c962b28 Fixed warnings 2021-06-17 10:35:22 +02:00
Armin Novak
d9a8083ddf Added WINPR_NORETURN, fixed warnings 2021-06-17 10:35:22 +02:00
Armin Novak
1af7ef2f1b Fixed compilation warnings and typos 2021-06-16 15:21:56 +02:00
Armin Novak
9e94f1dace Improve WINPR_ASSERT, log backtrace 2021-06-16 14:26:06 +02:00
Armin Novak
f5bb6d12fc Fixed compilation warnings 2021-06-16 14:26:06 +02:00
Armin Novak
1b3adfae0a Added WINPR_ASSERT to Stream and StreamPool 2021-06-16 14:26:06 +02:00
Armin Novak
d7f3ce0acd Added callback deprecation attribute 2021-06-16 14:26:06 +02:00
Armin Novak
64280aa13c Added WINPR_ASSERT to collections 2021-06-16 11:46:42 +02:00
Armin Novak
61c1d82e3b Return function != NULL in HashTable_SetHashFunction 2021-06-16 11:46:42 +02:00
Armin Novak
31862e60f9 Added missing return checks 2021-06-16 11:46:42 +02:00
Armin Novak
bca7bcd8b0 Cleaned up Queue API, use WINPR_ASSERT 2021-06-16 11:46:42 +02:00
Armin Novak
216f65336e Fixed HashTable and ArrayList use errors 2021-06-16 11:46:42 +02:00
Armin Novak
e25c5625c8 Added WINPR_ASSERT in HashTable 2021-06-16 11:46:42 +02:00
Armin Novak
bfcad7d6aa Added WINPR_ASSERT in ArrayList 2021-06-16 11:46:42 +02:00
Armin Novak
c2bef2bfa9 Fixed return value checks for ArrayList_Append and HashTable_Insert 2021-06-16 11:46:42 +02:00
Armin Novak
b9a9f50dd2 Hide HashTable_SetupForStringData implementation 2021-06-16 11:46:42 +02:00
Armin Novak
30776358bb Readded ArrayList_Add and HashTable_Add as deprecated 2021-06-16 11:46:42 +02:00
Armin Novak
a96c192977 Added parameter checks 2021-06-16 11:46:42 +02:00
Armin Novak
96eca171e2 Removed const from HashTable_ForEach function 2021-06-16 11:46:42 +02:00
Armin Novak
d6c84c28fb Renamed ArrayList_Add to ArrayList_Append
* Do not break API silently
2021-06-16 11:46:42 +02:00
Armin Novak
a1c8e4cf85 Refactored ArrayList_Add to conform to other functions 2021-06-16 11:46:42 +02:00
Armin Novak
880c603c26 Renamed HashTable_Add to HashTable_Insert
* Since the changes break HashTable_Add rename it so that it will
  not fail silently
2021-06-16 11:46:42 +02:00
Armin Novak
cb642699c8 Modified HashTable API to be opaque
* Reuse wObject function pointers
* Add missing getters/setters
* Clean up return types, const correctness of arguments
2021-06-16 11:46:42 +02:00
akallabeth
3a75228242 Added option do disable WINPR_ASSERT 2021-06-14 09:37:07 +02:00
Armin Novak
d36d94766e Replaced assert with WINPR_ASSERT 2021-06-14 09:37:07 +02:00
Armin Novak
b435e6db9b Added WINPR_ASSERT
Added a WinPR macro that can be used for WinPR and FreeRDP to
replace standard C assert.
It is more verbose and logs issues to WLog which makes it easier
for us to trace problems in the field.
2021-06-14 09:37:07 +02:00
Armin Novak
210b9f58b7 Increased time in TestSynchMultipleThreads 2021-06-09 11:03:37 +02:00
Armin Novak
c5fded2d83 Improved runtime of unit tests 2021-06-08 08:21:47 +02:00
Armin Novak
37c7d5d0f0 Increased TestSynchCritical timeout 2021-06-01 14:18:01 +02:00
Armin Novak
855b77a8d5 Fixed memory leak in TestPrint 2021-06-01 14:18:01 +02:00
Armin Novak
98cd46ca9c Fixed WLog_Uninit loop counter 2021-06-01 14:18:01 +02:00
Marc-André Moreau
96f07ea993 Windows ARM64 build fixes 2021-06-01 14:18:01 +02:00
David Fort
d76c8470b1
Merge pull request #7066 from akallabeth/rdpei_crash_fix
Stop rdpei thread before cleaning up listener
2021-05-31 13:19:44 +02:00
Armin Novak
a2930c04c3 Fixed random sleep time for test_synch_barrier_thread 2021-05-31 12:29:16 +02:00
Armin Novak
d4b3267860 Make TestSynchBarrier verbose 2021-05-31 12:26:30 +02:00
akallabeth
6b36c6d417
Replace fopen and path functions with wrappers (#7043)
Functions like fopen, PathFileExists, PathMakePath need to call
the wide character versions on windows for utf-8 support.
2021-05-31 11:42:03 +02:00
Marc-André Moreau
10d2e8a349 iOS build system fixes 2021-05-31 11:21:15 +02:00
David Fort
2f64d02272
Merge pull request #7046 from awakecoding/wlog-robustness
Add WLog locks to prevent logger initialization race conditions
2021-05-28 17:43:00 +02:00
Marc-André Moreau
79c469bd7a Add WLog locks to prevent logger initialization race conditions 2021-05-28 09:27:24 -04:00
Marc-André Moreau
1f1ce81b22 Gracefully handle edge case where clipboard format name is NULL 2021-05-28 10:42:31 +02:00
Marc-André Moreau
af08701c10 Avoid seeking when reading Android timezone identifier 'file' 2021-05-28 10:21:13 +02:00
Marc-André Moreau
73a931f941 WinPR: don't warn about thread-local storage on iOS, add comment banning its use for new code 2021-05-28 09:57:15 +02:00
Marc-André Moreau
a8355d4117 Improve pthread_mutex_timedlock detection, fix Android function definition 2021-05-28 09:24:33 +02:00
Marc-André Moreau
555944f027 run clang-format 2021-05-26 08:40:29 +02:00
Marc-André Moreau
eb6777ea69 Fix Windows Unicode file path handling issues (+add winpr_fopen wrapper) 2021-05-26 08:40:29 +02:00
Marc-André Moreau
29760a9009 Fix possible WSAEventSelect() file descriptor leak 2021-05-26 08:26:06 +02:00
Biswapriyo Nath
c0c9eb5908 Check MINGW32 for duplicate type declaration. 2021-05-25 09:41:44 +02:00
Biswapriyo Nath
37bbf9d218 CMake: Install DLLs in bin folder.
In Win32 platform, executables and runtime libraries need to be in one folder.
2021-05-25 09:41:44 +02:00
akallabeth
997ea7e09d Increased thread test run time to fix failing mac tests 2021-05-25 08:54:09 +02:00
Armin Novak
6f2c6625e4 Added FREERDP/WINPR prefix to define GIT_REVISION 2021-05-18 13:37:34 +02:00
David Fort
ab4fe21439 winpr: add a HashTable_Foreach function and associated tests
This useful functions allows to browse all value pairs of a hashtable without
having to allocate some memory for keys and then retrieving each element.
It may also make sense with synchronized hashtables because before you were forced to
HashTable_GetKeys() and then HashTable_GetItemValue() which is locking again for each
element of the table.
2021-05-17 09:29:25 +02:00
Ondrej Holy
26bf2816c3 Fix FIPS mode support and build with OpenSSL 3.0
FreeRDP fails to build with OpenSSL 3.0 because of usage of the `FIPS_mode`
and `FIPS_mode_set` functions, which were removed there. Just a note that
the FIPS mode is not supported by OpenSSL 1.1.* although the mentioned
functions are still there (see https://wiki.openssl.org/index.php/FIPS_modules).
Let's make FreeRDP build with OpenSSL 3.0 and fix the FIPS mode support.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1952937
2021-05-17 08:51:05 +02:00
akallabeth
d4ebf8546f Cleaned up crypto API 2021-05-11 08:00:18 +02:00
akallabeth
b494a193db Refactored certificate API:
* Proper encapsulation
* known_hosts2 backend extended (storing PEM)
* New backend storing each host certificate in a file
2021-05-11 08:00:18 +02:00
akallabeth
ab49694101 Added new RDP file options 2021-05-11 07:59:05 +02:00
akallabeth
b83e3bf61c Fix uninitialized variable warnings. 2021-04-28 17:12:24 +02:00
Biswapriyo Nath
a3a89a43f7 Fix intialization, remove some unused variables. 2021-04-28 17:11:31 +02:00
Biswapriyo Nath
3a1168cbda Check _MSC_VER for MSVC specific pragma directives. 2021-04-28 17:11:31 +02:00
Ondrej Holy
892cbe3261 Fix various memory leaks reported by Coverity
Covscan report contains various memory leak defects which were marked
as important. I have spent some time analyzing them and although they
were marked as important, most of them are in error cases, so probably
nothing serious. Let's fix most of them anyway. The rest are false
positives, or too complicated to fix, or already fixed in master, or
simply I am unsure about them.

Relates: https://github.com/FreeRDP/FreeRDP/issues/6981
2021-04-27 14:25:20 +02:00
Ondrej Holy
637413daf4 winpr/utils/lodepng: Fix USE_AFTER_FREE reported by Coverity
Although the `lodepng_zlib_compress` function expects the `*out` parameter
to be `NULL`, it uses `uvector_init_buffer` internally, which takes the
`*out` value. This confuses covscan, which consequently reports the following
defects:

```
double_free: Calling "ucvector_cleanup" frees pointer "zlibdata.data" which has already been freed.
double_free: Calling "ucvector_cleanup" frees pointer "compressed.data" which has already been freed.
double_free: Calling "ucvector_cleanup" frees pointer "compressed_data.data" which has already been freed.
```

Let's use the `uvector_init` function instead as in other cases to make
covscan happy and to make the code more bulletproof. Consequently, also
remove the outdated comments.
2021-04-27 14:25:20 +02:00
Armin Novak
18ceebb774 Simplified sync test 2021-04-27 11:48:39 +02:00
akallabeth
d4ae65dbb5 Added version to client log, removed build_date 2021-04-22 14:07:37 +02:00
David Fort
db02de2d8b
winpr: fix error path in winpr_event_init (#6974) 2021-04-22 11:57:44 +02:00
David Fort
5e3e2cd9fd winpr: fix #6970
Timer changes were wrong when timerfd support is not available (no valid file
descriptor returned by GetFd calls).
2021-04-22 10:32:02 +02:00
Martin Fleisz
b7c4ec759f event: Fix reset of non eventfd winpr event 2021-04-20 13:51:55 +02:00
akallabeth
2ea7ac0c06 Unified bin to hex and hex to bin conversion
* Added new functions in WinPR
* Added unit tests for new functions
* Replaced existing (internal) conversion functions
2021-04-19 10:45:21 +02:00
Armin Novak
c4b3d53a9a Fix NTLM auth message return code. 2021-04-16 16:34:17 +02:00
Armin Novak
4a9efacc65 Fixed duplicate call to NtCurrentTeb 2021-04-16 16:34:17 +02:00
akallabeth
b500800104 Cleaned up SAM file parser. 2021-04-16 16:22:39 +02:00
akallabeth
5075539022 Fixed log filter initialization from env 2021-04-16 16:18:07 +02:00
akallabeth
ef6e4c0570
ADDIN_ARGV cleanup, added camera setting to RDP parser (#6947)
* Added camerastoredirect to RDP parser

* Refactored ADDIN_ARGV handling

* Added ADDIN_ARGV unit tests
2021-04-12 10:38:40 +02:00
David Fort
aeba30a505 winpr: correctly implement APC
This patch implements APC functions and fixes waitable timers with completions.
2021-04-07 08:15:16 +02:00
David Fort
dfbbf3b618 winpr: cleanup polling code
Externalize all the polling logic in a pollset component. This patch prepares the
support of APC and alertable state.
2021-04-07 08:15:16 +02:00
akallabeth
c8b32f65ad Force close clipboard file descriptor if request size is 0 2021-04-01 18:07:31 +02:00
akallabeth
88e8a71e33 Force close clipboard files 2021-04-01 18:07:31 +02:00
akallabeth
7a8a89d4d0 Force fd close on error 2021-04-01 18:07:31 +02:00
akallabeth
76047bed25 Cleaned up clipboard file fd handling 2021-04-01 18:07:31 +02:00
akallabeth
f346793970 Refactored encoder functions to return changed areas 2021-03-01 11:52:07 +01:00
Armin Novak
7365330275 Fixed memory leak in backtrace function 2021-02-25 14:17:24 +01:00
sss
6574fdf6e4 reverted changes from clang-format 2021-02-25 14:05:40 +01:00
Gluzskiy Alexandr
bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
akallabeth
43311130a2 Fixed CodeQL warnings 2021-02-19 11:19:49 +01:00
Armin Novak
7b211e5258 Fixed #6821: _stricmp does not like NULL strings 2021-02-17 16:45:56 +01:00
akallabeth
e2fd9db0b5 Added const to function arguments 2021-02-17 11:29:56 +01:00
akallabeth
1dae0552d7 Fixed various warnings 2021-02-16 16:28:57 +01:00
Armin Novak
2e5c09f209 Updated windows time zones 2021-02-11 2021-02-11 16:16:42 +01:00
akallabeth
bad20340cc Fixed issue with GetAttr where the result buffer was not allocated 2021-02-10 10:36:51 +01:00
akallabeth
8217f5a9e3 Fixed SCardTransmit return 2021-02-10 10:36:51 +01:00
akallabeth
9ff0071b2e Fixed SCardState wrapper 2021-02-10 10:36:51 +01:00
akallabeth
6cf5ba4736 Unified smartcard handle converstion 2021-02-10 10:36:51 +01:00
akallabeth
a4bf477cca Fixed double free in PCSC_SCardGetAttrib_FriendlyName 2021-02-10 10:36:51 +01:00
akallabeth
e15684cb14 Fixed a ConvertToUnicode issue and added a unit test 2021-02-09 16:10:42 +01:00
Martin Fleisz
929fe163b3
Merge pull request #6757 from akallabeth/smart_e_invalid
Fix PCSC_SCardGetAttrib wrapper
2021-02-05 09:21:00 +01:00
Armin Novak
54e02e1642 Use wide char file paths for license 2021-02-04 21:22:21 +01:00
akallabeth
cf2d26dbbd Fix length return for SCARD_ATTR_VENDOR_NAME 2021-01-27 23:29:09 +01:00
Armin Novak
17d8267de7 Fixed PCSC_SCardGetAttrib wrapper 2021-01-27 23:03:48 +01:00
akallabeth
f3dad4106a Fixed support for huge files in clipboard 2021-01-25 08:43:46 +01:00
Ondrej Holy
d7566f5f5a
client: Fix exit codes for /help and similar option (#6741)
* client: Fix exit codes for /help and similar option

Currently, non-zero exit code is returned for /version, /buildconfig, /help,
/monitor-list, /kbd-list and /kbd-lang-list command-line options for several
clients. This is against conventions because 0 is usually returned in
such cases. Also, there is potentially another problem that the returned
codes overflow on UNIX systems (where the exit code is a number between 0
and 255). Let's fix the clients to return 0 in the mentioned cases to honor
conventions and 1 for the command-line parsing errors (or -1 for clients
who already use that value).

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6686

* Refactored freerdp_client_settings_command_line_status_print_ex

Now returns 0 if help or version information was requested.

* Do not eliminate original error status.

Co-authored-by: akallabeth <akallabeth@posteo.net>
2021-01-22 09:44:55 +01:00
jackyzy823
b972d70a9e x11: refactor fuse code 2021-01-18 19:13:56 +01:00
jackyzy823
e7d2f62ce6 x11: handle special chars in generating file uri 2021-01-18 19:13:56 +01:00
jackyzy823
2e0b5e07dc x11: correct uri-list and other formats 2021-01-18 19:13:56 +01:00
jackyzy823
d537988f28 x11: add support for remote to local clipboard file copy 2021-01-18 19:13:56 +01:00
Pascal Nowack
8ae820cd4f winpr/clipboard: Also save lastWriteTime for FILEDESCRIPTORW
Currently, when a local uri-list is converted into a FILEDESCRIPTORW
list, WinPR doesn't submit the last write time for each file.
The result of this is that the last write time of each file on the
other peer will have the current time and not the actual last write
time that is present on the peer, where the files were copied from.

Fix this by also writing the last write time in addition to the
FD_WRITESTIME flag.
2021-01-11 08:36:10 +01:00
Danilo Spinella
13df840d23 Check for backtrace symbol and link to execinfo if needed
Check execinfo is needed on Unix instead of only checking on FreeBSD.
2020-12-06 14:49:53 +01:00
akallabeth
ad93ff3f0d Fixed #6632 2020-12-06 14:48:21 +01:00
Simon Tatham
c90479c7f5 winpr/utils: allow COMMAND_LINE_VALUE_{OPTIONAL,BOOL} to coexist.
Now you can give an option the combination of flags
COMMAND_LINE_VALUE_OPTIONAL and COMMAND_LINE_VALUE_BOOL. If you do,
then all three of the syntaxes +foo, -foo and /foo:value are allowed
at once, and the receiving code can tell the difference because the
Value field is set to BoolValueTrue, BoolValueFalse or a valid char
pointer.
2020-11-20 08:34:20 +01:00
akallabeth
66dc4cc9ee Fixed compilation warnings. 2020-11-10 08:53:43 +01:00
akallabeth
59ef9a7e8b Fixed reset of MessageQueue in Clear 2020-11-06 13:02:01 +01:00
akallabeth
6e3c00725a Cleaned up collections:
ArrayList, MessageQueue, Queue, PubSub, BipBuffer
ObjectPool and BufferPool
2020-11-06 12:30:13 +01:00
akallabeth
a5989429f7 Reset Queue_Event when Queue_Clear is called. 2020-11-05 15:32:17 +01:00
Martin Fleisz
b5fa928311 core: Fix race when deleting channel manager
This PR fixes a possible crash when the channel manager was freed and
there were pending messages in the message queue.
The problem was that even though the message queue already received the
WMQ_QUIT message, it was still possible to enqueue messages after this
point. This resulted in unprocessed messages in the queue when it was
deleted. The delete handler then called into channel handlers which
where aleady freed/deleted.
With this PR adding messages after WMQ_QUIT was posted to the message
queue returns an error and all channel messages are now processed before
the channels are closed/terminated.
2020-11-03 17:08:58 +01:00
akallabeth
516fc9b910 Fixed locking issue, removed broken functions 2020-11-02 09:23:11 +01:00
akallabeth
0f2a8f214a Unify StreamPool locking. 2020-10-30 10:17:27 +01:00
Martin Fleisz
7be04e212b
Merge pull request #6466 from akallabeth/memsan
Memsan: fixes (most) unit tests for use with memory sanitizer
2020-10-28 09:46:12 +01:00
Armin Novak
11ca443aaf Fixed NtStatus2Tag return. 2020-10-27 07:41:04 +01:00
akallabeth
5133c4e424 Corrected name for FD_WRITESTIME 2020-10-15 08:33:14 +02:00
Armin Novak
a22f264189 Added backward compatibility define 2020-10-14 09:19:57 +02:00
Armin Novak
ef1c8a3b50 Updated FD_FLAGS definition. 2020-10-14 09:19:00 +02:00
akallabeth
33df98f204 Fixed definition of FILEDESCRIPTORW 2020-09-22 13:03:55 +02:00
akallabeth
1546a8b655 Fixed naming of FILEDESCRIPTORW 2020-09-18 12:49:54 +02:00
Armin Novak
cad1dd39e2 Fixed _aligned_recalloc 2020-09-07 11:05:45 +02:00
Armin Novak
816e792e3f Fixed unit tests run under memory sanitizer 2020-09-07 10:42:28 +02:00
Armin Novak
6351885488 Ignore NULL streams in StreamPool_Return 2020-09-02 10:09:48 +02:00
Armin Novak
a9d9908bde Added log message for not implemented WinPR SSPI_WINPR functions. 2020-08-10 16:00:16 +02:00
Armin Novak
2686200c3b Added log message for not implemented WinPR SSPI functions. 2020-08-10 16:00:16 +02:00
Armin Novak
ef791456e3 Added log message for not implemented WinPR SSPI GSS functions. 2020-08-10 16:00:16 +02:00
Armin Novak
65819a7215 Added log message for not implemented Schannel functions. 2020-08-10 16:00:16 +02:00
Armin Novak
7837f517e5 Added log message for not implemented CREDSSP functions. 2020-08-10 16:00:16 +02:00
Armin Novak
7d0e54e5f8 Added log message for not implemented NEGOTIATE functions. 2020-08-10 16:00:16 +02:00
Armin Novak
58f471c7d9 Added log message for not implemented NTLM functions. 2020-08-10 14:41:20 +02:00
Armin Novak
7d6e85a886 Fixed uninitialized value 2020-07-01 16:50:20 +02:00
akallabeth
b971c5c97f Use CMake to detect availability of getlogin_r 2020-07-01 16:50:20 +02:00
akallabeth
caff01877d Fixed fallback to getlogin for android 2020-06-22 12:09:36 +02:00
akallabeth
308c2c3544 Removed duplicate semicolon 2020-06-22 11:51:39 +02:00
akallabeth
58a3122250 Fixed OOB read in ntlm_av_pair_get
CVE-2020-11097 thanks to @antonio-morales for finding this.
2020-06-22 11:51:39 +02:00
akallabeth
05cd9ea229 Fixed TrioParse and trio_length limts.
CVE-2020-4030 thanks to @antonio-morales for finding this.
2020-06-22 11:51:38 +02:00
akallabeth
a45afe9db7 Replaced gmtime with gmtime_r 2020-06-22 11:51:38 +02:00
akallabeth
36478d3d0b Replaced getlogin with getlogin_r 2020-06-22 11:51:38 +02:00
akallabeth
240fdd07b1 Replaced localtime with localtime_r 2020-06-22 11:51:38 +02:00
akallabeth
057b6df4ae Fixed memory leaks in ntlm 2020-06-22 11:51:38 +02:00
Armin Novak
8e45a2dd50 Respect SECBUFFER_READONLY flag in NTLM EncryptMessage 2020-06-19 11:31:13 +02:00
Bernhard Miklautz
529e30c273 Revert "winpr/library: Use RTLD_GLOBAL for dlopen"
Using RTLD_GLOBAL in LoadLibraryA introduces a different behavior than
expected.

This reverts commit d566e00258.
2020-06-17 12:59:41 +02:00
Patrick Chin
8515846317 MessageQueue write time to current message not the next 2020-06-09 08:51:53 +02:00
Kobi Mizrachi
920acd4c0e winpr: image: add API to construct bmp header 2020-06-05 09:22:26 +02:00
Ondrej Holy
d566e00258 winpr/library: Use RTLD_GLOBAL for dlopen
LoadLibraryA implementation uses the RTLD_LOCAL flag for dlopen currently.
This flag doesn't allow the symbols to be used by the subsequently loaded
libraries. This is a problem for the video channel when -DBUILTIN_CHANNELS=OFF
is used as it uses functions from the geometry channel. Let's use RTLD_GLOBAL
instead to prevent "undefined symbol" errors in such cases.

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6236
2020-05-27 13:06:12 +02:00
akallabeth
58ef235bc5 Removed unused variable warnings 2020-05-20 15:10:07 +02:00
akallabeth
aea795eecf Fixed invalid argument to strtok_s 2020-05-20 15:10:07 +02:00
akallabeth
45860a5561 Fixed issues with clang sanitizers and alignemt offsets. 2020-05-20 15:10:07 +02:00
akallabeth
7540384db1 utf8 behaviour fixes 2020-05-20 15:10:07 +02:00
akallabeth
401bb836fb Fixed memory leak in NTLM test 2020-05-20 15:10:07 +02:00
akallabeth
b9149df1e6 Fixed BehaviourSanitizer warnings in streams. 2020-05-20 15:10:07 +02:00
akallabeth
1baf67d881 Fixed memory leak in ini parser and test functions. 2020-05-20 15:10:07 +02:00
akallabeth
a887c890f2 Fixed BehaviorSanitizer warnings. 2020-05-20 15:10:07 +02:00
akallabeth
0502bfcfbc Fixed BehaviorSanitizer warnings 2020-05-20 15:10:07 +02:00
akallabeth
535ef57e2e Fixed BehaviorSantizer warnings. 2020-05-20 15:10:07 +02:00
akallabeth
b37d8c9be1 Fixed GHSL-2020-100: oob read in ntlm_read_ChallengeMessage
* Added length checks for data read from stream
* Unified function resource cleanup
2020-05-20 15:10:07 +02:00
Armin Novak
24a8a56694 Fixed #6202: Missing NULL checks 2020-05-20 15:02:24 +02:00
Armin Novak
50278f7076 Fixed #6201: event handler count check 2020-05-20 15:02:24 +02:00
akallabeth
ddb388e152 Refactored sam functions to utilize strtok_s 2020-05-18 12:07:59 +02:00
akallabeth
7890833af8 Replaced strtok with strtok_s 2020-05-18 11:39:22 +02:00
Kobi Mizrachi
fddda159d9 change use of strtok to strtok_s 2020-05-18 11:08:20 +02:00
akallabeth
7b1d440945 Refactored StreamPool 2020-05-13 17:11:17 +02:00
akallabeth
8d70a3492b Added warning to all collection structs 2020-05-12 14:05:28 +02:00
akallabeth
844ec8f74c Fixed #6136: Cleaned up Stack API 2020-05-12 14:05:28 +02:00
Kentaro Hayashi
148f3c675d Fixed typos (Otherweise)
Otherweise ->
Otherw ise
      ^
2020-05-10 16:35:20 +09:00
akallabeth
bc0a2c277d Silence valgrind in unicode conversion functions
Only check destination buffer for NULL if length argument did not
already indicate the buffer needs to be allocated.
2020-05-08 11:04:03 +02:00
akallabeth
dffd893dc5 Fixed integer overflow in winpr_image_bitmap_read_buffer
Thanks to hac425
2020-05-08 11:04:03 +02:00
akallabeth
8241ab42fd Fixed oob read in ntlm_read_AuthenticateMessage 2020-05-06 13:31:57 +02:00
akallabeth
afdffac4b5 Fixed oob read in ntlm_read_ntlm_v2_response 2020-05-06 13:31:57 +02:00
akallabeth
8fa3835963 Fixed oob read in ntlm_read_NegotiateMessage 2020-05-06 13:31:57 +02:00
qarmin
ceec2cf1a0 Fixed copy paste error in MessagePipe.c 2020-05-01 19:42:46 +02:00
Zhu Qun-Ying
5553be0983
possible memory leak when various functions return failure. (#6110)
* possible memory leak when allocation failed.

* Use initialization in stead of ZeroMemory

* Format with clang-format
2020-04-25 16:07:12 +02:00
Zhu Qun-Ying
a1e421c93d use WINPR_MD5_DIGEST_LENGTH in stead of magic number for hash array 2020-04-24 08:33:30 +02:00
Zhu Qun-Ying
8cc9b09ba1 Use NTOWFv2FromHashW() in NTOWFv2W() to avoid duplicate code 2020-04-24 08:33:30 +02:00
Alex Wilson
40f23e2728 SCardReadCache/SCardWriteCache should actually cache data
Currently since the hash/keyCompare/keyClone members on the
context->cache were never being set, we were using the
HashTable_Pointer* variants, meaning that lookup always
failed (since we never ask for the same *pointer* twice).

This also revealed that the logic for autoallocate on these ops
was a bit backwards, and some error codes and support for the
"freshness" counter were missing.

In Win10 (at least with some card minidrivers) the freshness
counter is load-bearing and smartcard login won't work without
implementing a very basic version of it.
2020-04-21 08:11:54 +02:00
David Fort
7733fe7a8a
Merge pull request #6060 from akallabeth/warnings
Fix some compiler warnings
2020-04-16 10:54:43 +02:00
Martin Fleisz
9e1b2eb42e
Merge pull request #6081 from akallabeth/disable_spincount
Disable spincount
2020-04-15 13:24:26 +02:00
Martin Haimberger
7b6b9a9675 removed unnecessary casts, use sizeof for debug printing 2020-04-15 13:20:03 +02:00
Martin Haimberger
85e49aa601 fix: server side ntlmv2 implementation
- in the case no mic was present, but the user was found,
  the enterd password was ignored and the user authenticated
2020-04-15 13:20:03 +02:00
Armin Novak
a161bafa5f Fix #6066, #6045: Disable spincount by default. 2020-04-13 09:56:19 +02:00
Armin Novak
ebf44f80eb Fixed format string warnings. 2020-04-11 09:43:01 +02:00
akallabeth
08fd2876b9 Started 3.0 development cycle. 2020-04-10 15:01:15 +02:00
Bernhard Miklautz
5ab2bed874 new: update ChangeLog and set version to 2.0.0 2020-04-09 18:00:51 +02:00
Martin Fleisz
99786970a3
Merge pull request #5884 from akallabeth/smartcard_ndr_strict
Smartcard tighter input validation
2020-03-31 08:34:04 +02:00
Armin Novak
ab21b1ef25 Silenced warning due to missing define guard. 2020-03-10 14:04:53 +01:00
Armin Novak
461bc825de Removed unused function 2020-03-10 14:04:53 +01:00
Armin Novak
07cc1edaa0 Removed unused function 2020-03-10 14:04:53 +01:00
Armin Novak
106ab8cfbd Removed unused function 2020-03-10 14:04:53 +01:00
Armin Novak
d29448bda8 Removed unused function 2020-03-10 14:04:53 +01:00
Armin Novak
7416b9b604 Using bsearch to get ntstatus string. 2020-03-10 14:04:53 +01:00
Armin Novak
e63377945b Silenced warning due to missing debug define guard. 2020-03-10 14:04:53 +01:00
Armin Novak
94f0dc127b Removed unused functions / files 2020-03-10 14:04:53 +01:00
Armin Novak
8afa27c936 Fixed broken NULL check. 2020-03-10 08:59:52 +01:00
Armin Novak
8b85913ac0 Added winpr_md_type_from_string and winpr_md_type_to_string 2020-03-06 11:37:35 +01:00
Armin Novak
9d13729617 Added sha3 hashes for openssl. 2020-03-06 11:37:35 +01:00
Armin Novak
e3acc01bfb Added missing WINPR_*_DIGEST_LENGTH definitions. 2020-03-06 11:37:35 +01:00
Armin Novak
1fd51d9183 Fixed clang scanbuild warnings. 2020-03-04 09:17:35 +01:00
Armin Novak
aa441d3238 Log smartcard to stdout. 2020-02-20 15:24:03 +01:00
Armin Novak
959be9d946 Fixed warnings in pcsc layer 2020-02-20 14:03:29 +01:00
Armin Novak
fa10dfa186 Fixed memory leaks in PCSC_SCardReadCache[AW] 2020-02-20 13:59:28 +01:00
Armin Novak
f885476423 Fixed 8bit and 16bit return string sizes. 2020-02-20 13:59:28 +01:00
Armin Novak
ef93109f42 Fixes for GetAttrib and some refactroing
* Fix accidental buffer free before transfer
* Refactored code to eliminate a bunch of warnings
* Updated copyright headers
2020-02-20 13:59:28 +01:00
Armin Novak
f0f476c7d5 Fixed pcsc function pointer casts. 2020-02-20 13:59:28 +01:00
Armin Novak
2acce6214c SCardFreeMemory non const argument. 2020-02-20 13:59:28 +01:00
Armin Novak
37e850cb24 Cleaned up smartcard pcsc wrapper. 2020-02-20 13:59:28 +01:00
Armin Novak
30983f4049 Cleaned up smartcard inspect. 2020-02-20 13:59:28 +01:00
Armin Novak
e9a75d5a7a Updated timezones 2020-02-19 2020-02-19 15:27:10 +01:00
Armin Novak
75be471d78 Fixed #5889: Only add descriptors wanted to select 2020-02-18 14:33:45 +01:00
Martin Fleisz
e304428a5f
Merge pull request #5857 from akallabeth/scanbuild_fixes
Scanbuild fixes
2020-02-12 10:16:54 +01:00
David Fort
245fc6014d
Merge pull request #5830 from akallabeth/smartcard_updates
Smartcard updates
2020-02-07 14:11:00 +01:00
Armin Novak
2b8bc8ea5e Fixed unused argument warnings. 2020-01-23 10:12:12 +01:00
Kobi Mizrachi
8c5d96784d cmdline: export CommandLineParseCommaSeparatedValues 2020-01-22 14:18:21 +01:00
Kobi Mizrachi
1543664343 winpr: collections: add ArrayList_ForEach 2020-01-14 07:58:47 +01:00
David Fort
f3ffa19039 winpr: don't close file descriptor if we set it again to the same file 2020-01-13 12:27:24 +01:00
Armin Novak
4798af5132 Fix smartcard structs, conform to [MS-RDPESC] 2020-01-13 10:49:22 +01:00
Armin Novak
a392b266c0 Added NtStatus2Tag function to stringify NTSTATUS
For higher level applications it is easier to translate known
strings instead of error codes. this function allows
to retrieve known string identifiers that can be translated.

Signed-off-by: Armin Novak <armin.novak@thincast.com>
2020-01-09 16:14:44 +01:00
Martin Fleisz
3e3458cc3c
Merge pull request #5821 from akallabeth/smartcard_log_err
Added debug log messages for SCARD_E_NO_SERVICE
2020-01-09 10:12:14 +01:00
Armin Novak
c98b3e0cef Added debug log messages for SCARD_E_NO_SERVICE
Log where and what caused SCARD_E_NO_SERVICE return in smartcard
wrapper
2020-01-09 08:20:42 +01:00
Kobi Mizrachi
8c3054851c winpr: thread: fix wrong log level in ThreadCloseHandle 2020-01-08 11:59:34 +01:00
David Fort
004f59083d
Merge pull request #5802 from dragonuaix/master
Update comm_serial_sys.c
2020-01-08 08:08:42 +01:00
Armin Novak
44ac64ffb9 Fixed duplicate definition in TestGetComputerName 2020-01-07 10:51:01 +01:00
dragonuaix
4c1d57b3d0
Update comm_serial_sys.c 2019-12-26 16:48:00 +02:00
Martin Fleisz
02e7a07832
Merge pull request #5768 from akallabeth/timezone_update
Timezone update
2019-12-17 14:11:40 +01:00
Kobi Mizrachi
f92e941129 winpr: SetWaitableTimer should not free the handle if it fails 2019-12-17 09:46:00 +01:00
Armin Novak
c9dd343a65 update timezones. 2019-12-06 11:05:09 +01:00
Armin Novak
1a52aff7f9 Update WindowsZones.c 2019-12-06 11:03:30 +01:00
Armin Novak
3143570f54 Added missing Stream_Write_INT32 2019-12-04 13:44:08 +01:00
Martin Fleisz
71feb974ac
Merge pull request #5739 from akallabeth/improve_function_hiding
Improve function hiding
2019-12-02 11:31:35 +01:00
Armin Novak
7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
David Fort
5e6775ce95 winpr: fix anonymous enum members and menbers without a size 2019-11-25 13:39:31 +01:00
Bernhard Miklautz
a378511617
Merge pull request #5743 from akallabeth/32bit_warn_fix
Fix #5741: Limit strnlen checks to INT_MAX to silence compile on 32bi…
2019-11-21 15:23:19 +01:00
Armin Novak
53f7d023b1 Fixed GetEnvironmentStrings test
Some os return an invalid/wrong character count if a string with
unknown symbols is printed to stdout.
Instead use the sprintf family and print to a buffer / determine
the required buffer size.
2019-11-21 15:05:57 +01:00
Martin Fleisz
b176fdeff8
Merge pull request #5738 from akallabeth/hide_unexported_functions
Do not export functions that are purely internal.
2019-11-21 08:29:00 +01:00
Armin Novak
67dc2e0bdb Fix #5741: Limit strnlen checks to INT_MAX to silence compile on 32bit builds. 2019-11-21 08:09:08 +01:00
Armin Novak
708a28d8dd Do not export functions that are purely internal. 2019-11-20 11:08:02 +01:00
Armin Novak
f34e33ed2b Cleaned up code for makecert. 2019-11-20 08:37:53 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Martin Fleisz
bc39b32d20
Merge pull request #5685 from akallabeth/multi_instance_arg_parse
COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
2019-11-06 09:09:22 +01:00
Martin Fleisz
5b6663fe3a
Merge pull request #5689 from akallabeth/cleanups
Cleanups
2019-11-05 15:28:02 +01:00
Armin Novak
b15e967c92 Use BOOL return for IniFile_Open_File and IniFile_Load_File 2019-11-05 10:31:09 +01:00
Armin Novak
b06efc78ec Fixed warnings from TestEnvironmentGetEnvironmentStrings 2019-10-29 12:58:06 +01:00
Armin Novak
1fb716d864 Cleaned up TestCryptoHash 2019-10-29 12:58:06 +01:00
Armin Novak
142db87970 Removed strlen from GetComputerNameExA 2019-10-29 12:58:06 +01:00
Armin Novak
68f519ed6c Fixed length checks for GetComputerNameA 2019-10-29 12:58:06 +01:00
Armin Novak
66ad508b45 Removed strlen use in wlog (and speed up check) 2019-10-29 12:58:06 +01:00
Armin Novak
f01e042211 Code cleanups (strlen, casts, size_t, ...) 2019-10-29 11:58:43 +01:00
Armin Novak
700470876b Cleaned up ini.h and added error checks. 2019-10-29 11:54:55 +01:00
Armin Novak
0c87eaee4d COMMAND_LINE_ARGUMENT structs contain parser results, use one per instance
Remove the old global structs as the parser modifies them. When using
multiple instances in the same process space this could break parsing.
2019-10-28 13:30:05 +01:00
Armin Novak
2813d6860c Added MessageQueue_Dispatch argument checks 2019-10-25 13:25:12 +02:00
kubistika
b3f78d2f4d winpr: utils: image: fix const correctness 2019-10-24 12:19:31 +02:00
asapelkin
82eadad4a4 Fix some static analizer warnings 2019-10-22 15:39:54 +02:00
Armin Novak
9fee4ae076 Fixed #5645: realloc return handling 2019-10-04 16:19:23 +02:00
Armin Novak
4d8b86f05c GetEventFileDescriptor return handle internal event. 2019-10-02 14:58:32 +02:00
Martin Fleisz
583045e2e5 rail: Update to latest spec version 28.0 2019-10-02 14:51:45 +02:00
akallabeth
a3dae4ad46 Fix WINPR_EVENT and WINPR_TIMER structs.
Both structs must have the same base members so that the event
handle can be extracted at the same offset.
2019-10-01 21:03:03 +02:00
Martin Fleisz
a907f003e1
Merge pull request #5596 from akallabeth/wlog_cache_ptr
Speedup for WLog_* macros, cache the log pointer
2019-10-01 15:57:17 +02:00
Martin Fleisz
7edd2d8070 wlog: Fix uninitialized type in wLogMessage 2019-10-01 14:34:17 +02:00
Armin Novak
b1d0eaff6d Fix #5603: Prefer absolute path for /drive: syntax. 2019-09-24 16:42:27 +02:00
akallabeth
3edadef768 Fix #5593: Do not use diagnostics pragma inside functions 2019-09-22 16:37:52 +02:00
Armin Novak
d46a3cb11d Speedup for WLog_* macros, cache the log pointer
WLog_Get(tag) is quite expensive if called repeatedly.
With this patch the pointer is cached on first call.
2019-09-15 10:04:36 +02:00
Armin Novak
f39ec50101 Converted BitStream_* defines to inline functions 2019-09-03 08:55:59 +02:00
Armin Novak
d99486096b Added deprecation macro. 2019-09-02 15:13:09 +02:00
Armin Novak
f93d625cde Use GetTickCount64 instead of GetTickCountPrecise. 2019-09-02 15:46:36 +02:00
Armin Novak
da52297913 Added winpr version macro (same as freerdp version) 2019-08-22 16:03:50 +02:00
Armin Novak
92ca3002e3 Allow build without WinPR tools 2019-08-14 15:10:00 +02:00
Armin Novak
8ab5a2d6bb Use GetSystemTimeAsFileTime to emulate GetTickCount64 2019-08-13 10:55:12 +02:00
Armin Novak
cbb9354641 Fix broken clipboard after file copy 2019-07-17 15:13:50 +02:00
kubistika
da19457fca winpr: ObjectPool_Return: fix error handling 2019-07-11 21:31:47 +02:00
kubistika
e1850cbc6f winpr: ObjectPool_Return: fix wrong type for new_cap 2019-07-11 21:31:47 +02:00
Armin Novak
6d553a7f3c Fixed #5441, thank you @ekse 2019-06-25 10:25:31 +02:00
Martin Fleisz
ccd1fc71e9
Merge pull request #5327 from akallabeth/sign_compare_fixes_v3
Leak and warning fixes for 2.0
2019-05-09 13:21:36 +02:00
Armin Novak
2cc714a57d Updated RAILS implementation
* Implement new messages and callbacks
* Announce most recent channel features
* Added settings to configure flags to announce
2019-05-08 17:25:15 +02:00
Armin Novak
447e330bdf Fixed uninitialized value 2019-05-08 15:13:03 +02:00
Armin Novak
e42b15eb05 Fixed memory leak 2019-05-08 15:13:03 +02:00
Armin Novak
9bee5e80ee Fixed memory leak 2019-05-08 15:12:40 +02:00
Martin Fleisz
3e2be308eb
Merge pull request #5266 from akallabeth/file_list_synth
Added a proper synthesizer for FileGroupDescriptorW to text/uri-list
2019-05-08 15:05:05 +02:00
Armin Novak
84a297b830 Fixed error checks and uninitialized values in convert_filedescriptors_to_uri_list 2019-05-08 14:41:22 +02:00
Armin Novak
d7ca2db62e Fixed doulbe semicolon in C files. 2019-05-08 12:58:01 +02:00
Bernhard Miklautz
f867c90e4c
Merge pull request #5308 from akallabeth/fix_win32_overlinking
Fixed windows overlinking.
2019-05-03 12:01:51 +02:00
Kubistika
967f2aefac Fix segfault when IniFile_Load is called with invalid input (#5331)
* Fix segfault when IniFile_Load is called with invalid input

* Fix leak in TestIni.c third testcase

* TestIni.c: Refactor in order to avoid some old compilers errors
2019-04-08 09:26:46 +02:00
Armin Novak
f8dd9a9f75 Fixed ntlm_av_pair_get_len return, no signed value required 2019-04-05 09:28:09 +02:00
Armin Novak
2c9cd5067f Fixed argument pointer type cast 2019-04-05 09:22:50 +02:00
Armin Novak
f33e494884 Disabled -Wimplicit-fallthrough for instances where its use is intended. 2019-04-05 09:14:35 +02:00
Armin Novak
a1ee97c154 Fixed GetModuleFileNameW. 2019-04-05 09:14:35 +02:00
Armin Novak
a16813d237 Fixed SleepEx return value and added log messages for unimplemented features. 2019-04-05 09:14:35 +02:00
Armin Novak
c7b7d527f3 Fixed unused argument warnings for tests. 2019-04-05 09:14:35 +02:00
Armin Novak
e605a10921 Fixed NULL argument warning. 2019-04-05 09:14:35 +02:00
Armin Novak
71924958bd Added event name to handle. 2019-04-05 09:14:35 +02:00
Armin Novak
55e9132fa4 Fixed NULL argument warning. 2019-04-05 09:14:35 +02:00
Armin Novak
1d87fdc803 Implemented GetModuleFileNameW 2019-04-05 09:14:35 +02:00
Armin Novak
b5d9b6dba4 Improved timer implementation and error messages. 2019-04-05 09:14:35 +02:00
Armin Novak
f8e5e8cd7d Improved error logging for wait functions. 2019-04-05 09:14:35 +02:00
Armin Novak
ebb93a1273 Improved implementation of LoadLibrary functions. 2019-04-05 09:14:35 +02:00
Armin Novak
7b246121b4 Improved mutex and event functions
* Added name for debugging to handle.
* Implemented *Ex functions
2019-04-05 09:14:35 +02:00
Armin Novak
29741ca849 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
4c2028e285 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
6e655189c3 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
58d5c5f7d1 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
0b82768a70 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak
70e37746cb Fixed sign-compare warnings 2019-04-05 09:13:25 +02:00
Armin Novak
cfdcaa2653 Fixed sign-compare warnings 2019-04-05 09:13:25 +02:00
Armin Novak
309fe960f7 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
b5a7e4d9b9 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
279a5fe39f Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
6f3808a224 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
699d7d1462 Fixed _config_size return 2019-04-05 09:13:24 +02:00
Armin Novak
b7ac5b9bc8 Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
7dfc453858 Cast SEC_* return values to HRESULT (Same as WIN32 API) 2019-04-05 09:13:24 +02:00
Armin Novak
9757d536c3 Case SCARD_* return values to HRESULT (Same as WIN32 API) 2019-04-05 09:13:24 +02:00
Armin Novak
25751517e5 Cast E_* errors to HRESULT (same as defined in WIN32 API) 2019-04-05 09:13:24 +02:00
David Fort
37358e81d0
Merge pull request #5285 from akallabeth/urbdrc_preparations
Channel, log debug and semaphore related fixes
2019-04-04 18:21:47 +02:00
David Fort
a63f717871
Merge pull request #5309 from smaeul/patch/ntlm
Fix NTLM AvPair lists
2019-04-04 18:19:56 +02:00
David Fort
058ae0db57
Merge pull request #5273 from akallabeth/mac_compile_warning_fix
Fixed mac compilation warnings.
2019-04-04 18:03:50 +02:00
Armin Novak
745c6b933a Fixed \0 terimination of clipboard file list 2019-04-03 10:17:51 +02:00
David Fort
c5156443e7
Merge pull request #5281 from akallabeth/assistance_ssl_init_fix
Fixed #5276: Enable SSL before parsing assistance file.
2019-03-28 19:04:25 +01:00
Armin Novak
8e0565b2bd Fixed windows overlinking. 2019-03-18 15:10:21 +01:00
Samuel Holland
6931f54fad Fix NTLM AvPair lists
There were two main issues here: First, the `ntlm_av_pair_add` and
`ntlm_av_pair_add_copy` were not adding a new `MsvAvEOL` to the end of
the list to replace the one they overwrote. This caused the second call
to one of those functions to fail (since it couldn't find the
terminator), which was the source of the test failure. It also caused
`ntlm_av_pair_list_length` and `ntlm_print_av_pair_list` to read out of
bounds until they happened to find the right word.

Second, several bounds checks were wrong or missing. For example,
`ntlm_av_pair_add` does not ensure that the value fits inside the list.
And `ntlm_av_pair_get_len` and `ntlm_av_pair_get_value_pointer` can
return error codes or NULL, but those error returns were ignored, and
the values used anyway (such as in `ntlm_av_pair_add_copy`).

This fixes the list handling code to have the invariant that all
functions returning `NTLM_AV_PAIR*` only return non-`NULL` if the entire
returned `AvPair` is within bounds. This removes the need for the length
parameter in functions that only operate on a single `AvPair`. This
check is performed by the new `ntlm_av_pair_check` helper, which is
added in some new places and used to simplify the code in others.

Other issues fixed along the way include:
 - `ntlm_av_pair_list_length` did not cast to `PBYTE`, so it was
   returning the number of `NTLM_AV_PAIR`-sized chunks (which was
   possibly not even an integer) instead of the number of bytes
 - I removed an impossible check for `offset <= 0` in
   `ntlm_av_pair_get_next_pointer`
 - The assertion that `Value != NULL` and the call to `CopyMemory` are
   only necessary if `AvLen` is nonzero
 - `ntlm_av_pair_get_next_pointer` (renamed to `ntlm_av_pair_next`)
   could be declared `static`

With this commit, TestNTLM now passes on powerpc64.

```
$ ./Testing/TestSspi TestNTLM
NTLM_NEGOTIATE (length = 40):
NTLM_CHALLENGE (length = 168):
NTLM_AUTHENTICATE (length = 352):
$ echo $?
0
```

Fixes #5250
2019-03-17 20:40:13 -05:00
Armin Novak
e5fbff357e Fixed Stream_* macros, bracing arguments. 2019-03-07 09:29:32 +01:00
MartinHaimberger
46b1e88a70
Merge pull request #5027 from akallabeth/wlog_off_fix
Fix #5024: Update inherited log level for all child loggers when setting a new one.
2019-02-28 10:55:12 +01:00
Armin Novak
e9c4173c9b Fixed winpr_HexLogDump line length calculation. 2019-02-28 09:54:05 +01:00
Armin Novak
bff5ded654 Better bounds checks for winpr_HexLogDump 2019-02-28 08:50:44 +01:00
Armin Novak
4e31cf929e Fixed ReleaseSemaphore, respect lReleaseCount
Signal the semapore lReleaseCount times.
2019-02-26 15:33:51 +01:00
Armin Novak
982ee67a4c Initialize ppKeys to NULL in HashTable_GetKeys
Ensure ppKeys=NULL in case of a function failure or empty table.
2019-02-26 15:32:22 +01:00
Armin Novak
32aa11251b Added a logger dump function operating on a preallocated logger. 2019-02-26 15:31:47 +01:00
Armin Novak
49936a7ba6 Fixed #5276: Enable SSL before parsing assistance file.
The assistance file requires primitives from the ssl wrapper.
Enable these before parsing the file.
Additionally split the FIPS mode enablement from the one time
initializer to avoid ignoring that flag.
2019-02-25 10:37:30 +01:00
Armin Novak
9566ae0e90 Fixed mac compilation warnings. 2019-02-21 17:30:12 +01:00
Armin Novak
32ea44c037 Added a proper synthesizer for FileGroupDescriptorW to text/uri-list
The file clipboard delegate needs a base URI to operate on for
systems that are not WIN32. Added that to the context and abort
conversion, if that is not set. (currently not fully implemented)
2019-02-21 16:44:40 +01:00
Armin Novak
32e5407b43 Ignore INVALID_HANDLE_VALUE during clang scanbuild runs.
The value INVALID_HANDLE_VALUE could in theory be a valid memory address,
so the analyzer is confused and thinks either we have a memroy leak
or we try to free a fixed address.
2019-02-21 12:21:51 +01:00
Armin Novak
41d382569c Respect return value from SetEvent and abort creation. 2019-02-21 12:21:51 +01:00
Martin Fleisz
3169b77d70
Merge pull request #5230 from akallabeth/sign_compare_fixes
Sign compare fixes
2019-02-08 09:35:50 +01:00
Armin Novak
22eddef668 Fixed wide character comparison. 2019-02-08 09:20:58 +01:00
Martin Fleisz
6415cfec48
Merge pull request #5131 from akallabeth/cmd_line_error_logging
Added extended error logging for assistance, rdp file and command line parser
2019-02-08 09:11:35 +01:00
Bernhard Miklautz
162a69b0f0
Merge pull request #5139 from akallabeth/drive_hotplug_shutdown_crash_fix
Fixed crash on drive hotplug shutdown.
2019-02-07 10:08:41 +01:00
Armin Novak
3679eefbd4 Fixed BipBuffer Read/Write, limit to SSIZE_MAX. 2019-01-30 18:05:49 +01:00
Armin Novak
650f63c7ca Added missing SSIZE_MAX define 2019-01-30 18:05:49 +01:00
Armin Novak
9c5c722aaa Fixed use of ASCII function on WCHAR 2019-01-30 18:05:49 +01:00
Armin Novak
221cb48e2d Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
585391dfbf Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
2bd43398e8 Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
f39ec7c453 Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak
fe9dcfacca Fixed NULL dereferences and uninitialized values 2019-01-30 16:11:10 +01:00
Armin Novak
c00010478c Fix FindNextFileA path termination with a single separator. 2019-01-30 15:44:45 +01:00
Armin Novak
9033df501e Fixed compiler warnings for TRIO_CONST and limited data type. 2019-01-29 17:51:44 +01:00
Armin Novak
2e5fd8d16b Fixed clang analyzer false positive memory leaks.
Added a justification for each #ifndef __clang_analyzer__
2019-01-29 17:17:30 +01:00
akallabeth
0a8ebcfcac
Merge pull request #5187 from astrand/mingw-part1
Mingw build fixes part1
2019-01-29 10:46:21 +01:00
David Fort
ad75ae512c
Merge pull request #5200 from akallabeth/os2_fixes
Os2 fixes
2019-01-18 18:04:23 +01:00
Armin Novak
4f1462b73b Added fix for OS2 paths.
Reported on mailing list by Andrey Vasilkin
2019-01-18 13:13:41 +01:00
Armin Novak
b08505cbe0 Fixed return check in SwitchToThread
Patch on mailing list by Andrey Vasilkin
2019-01-18 13:02:30 +01:00
Armin Novak
4d4f3617bd Fixed memory leak in lodepng. 2019-01-16 15:23:12 +01:00
Armin Novak
fc9e88d64f Added flag to silence command line parser logging during detection. 2019-01-16 14:32:19 +01:00
Armin Novak
89f3f7d837 Added extended error logging for assistance, rdp file and command line parser. 2019-01-16 14:32:19 +01:00
Bernhard Miklautz
3498e76948 fix [winpr/hash]: initialize ssl
winpr-crypt is used in winpr for hash generation but currently it's
still required to initialize openssl in the application itself.
winpr-hash didn't do that therefore the generated hashes were useless.
2019-01-16 12:05:47 +01:00
Peter Åstrand (astrand)
a7f4b90f36 Pointer arithmetics require lvalue
(type *)x evaluates to a temporary. Fixed build with GCC.
2019-01-09 11:13:38 +01:00
Peter Åstrand (astrand)
32ba90ec0a Avoid building POSIX clipboard if WIN32
MinGW has unistd.h.
2019-01-09 10:04:38 +01:00
Peter Åstrand (astrand)
30cd1ba1ab Use lowercase for includes and libs
Makes build possible on case sensitive systems such as MinGW on Linux.
2019-01-09 09:36:28 +01:00
Martin Fleisz
7bc69cd61e
Merge pull request #5155 from akallabeth/ext_debug_functions
Added backtrace function working on allocated logger.
2019-01-08 10:18:06 +01:00
Ilya Shipitsin
f422fe63cf identical code for both branches, found by coverity 2019-01-07 23:01:31 +05:00
Armin Novak
5dea64a468 Added backtrace function working on allocated logger. 2018-12-17 09:24:57 +01:00
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