Commit Graph

3247 Commits

Author SHA1 Message Date
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
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