Commit Graph

159 Commits

Author SHA1 Message Date
Marc-André Moreau
8a5c55788b libwinpr-sspi: don't warn about non-error security statuses 2015-09-17 11:16:20 -04:00
Armin Novak
48ccf73a36 More SSPI logging. 2015-07-08 17:41:22 +02:00
Armin Novak
7360cb638a Erasing memory on credentials or SecBuffer free. 2015-07-08 17:41:21 +02:00
Bernhard Miklautz
1cee185e3c hardening: check fread and fwrite return values 2015-06-26 20:38:30 +02:00
Armin Novak
e8bfa29bd2 Replaced registry keys with cmake defines. 2015-06-24 14:02:48 +02:00
Armin Novak
fbbc1affd0 ifdef variables used with specific build options. 2015-06-23 16:20:59 +02:00
Bernhard Miklautz
af81a91ea7 windows: fix compilation and warnings 2015-06-22 19:31:25 +02:00
Bernhard Miklautz
06502e6a91 misc: integrate pull request feedback 2015-06-22 19:24:30 +02:00
Bernhard Miklautz
fc6a3cf3c1 sspi/ntlm: integrate pull request comments 2015-06-22 19:23:58 +02:00
David FORT
7c3f8f33ab Fixes for malloc / calloc + other fixes
This patch contains:

* checks for malloc return value + treat callers;
* modified malloc() + ZeroMemory() to calloc();
* misc fixes of micro errors seen during the code audit:
** some invalid checks in gcc.c, also there were some possible
integer overflow. This is interesting because at the end the data are parsed
and freed directly, so it's a vulnerability in some kind of dead code (at least
useless);
** fixed usage of GetComputerNameExA with just one call, when 2 were used
in misc places. According to MSDN GetComputerNameA() is supposed to return
an error when called with NULL;
** there were a bug in the command line parsing of shadow;
** in freerdp_dynamic_channel_collection_add() the size of array was multiplied
by 4 instead of 2 on resize
2015-06-22 19:21:47 +02:00
David FORT
16d36e3083 A malloc() pass on WinPR
This patch treats remaining non-checked mallocs. And changes to calloc in places
where it makes sense
2015-06-22 19:10:00 +02:00
Bernhard Miklautz
bf73f4e4f1 Fix unchecked strdups
* add missing checks
* adapt function return values where necessary
* add initial test for settings
2015-06-22 19:09:59 +02:00
Armin Novak
5dff9c4f9e Removed duplicate function tables, respecting WITH_NATIVE_SSPI 2015-06-17 13:24:11 +02:00
Hardening
1b366816a2 Merge pull request #2608 from oshogbo/master
Add check to protect memcpy(3) from using NULL pointer.
2015-05-29 10:49:42 +02:00
Mariusz Zaborski
80958751e4 Add check to protect memcpy(3) from using NULL pointer.
The ntlm_construct_challenge_target_info function can potentially pass NULL as
argument to the ntlm_av_pair_add function (for example DnsDomainName.Buffer).
This NULL finally lands in the CopyMemory (which is macro to the memcpy(3)
function) which can't handle NULL.
2015-05-25 08:32:48 +02:00
Konrad Witaszczyk
29d3b0bebb QueryContextAttributes shouldn't return an error when a user or a domain
is empty.
2015-05-18 09:42:17 +02:00
Konrad Witaszczyk
95f9e6a641 Pass valid context to CompleteAuthToken function in Negotiate Security Package. 2015-05-15 13:02:40 +02:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Norbert Federa
25fc866a58 Fix unchecked CreateThread calls and misc fixes 2015-05-05 13:55:48 +02:00
Bernhard Miklautz
850de59b55 winpr: add checks for *alloc
Add missing checks if memory allocation was successful. Also adapt
caller(s) when possible.
2015-04-08 11:34:37 +02:00
Armin Novak
831b74d519 Fixed memory leak. 2014-11-16 17:07:48 +01:00
Armin Novak
9339411c9b Fixed memory leak. 2014-11-16 15:53:39 +01:00
Armin Novak
7756cfb7a4 Fixed memory leaks. 2014-11-16 14:56:08 +01:00
Armin Novak
3d28c9dbf1 Fixed sspi_CopyAuthIdentity, now checking source struct, if it is ANSI encoded. 2014-10-17 11:43:41 +02:00
Marc-André Moreau
c4588fb14f libfreerdp-core: remove dependency on OPENSSL_Applink on Windows 2014-09-19 17:11:56 -04:00
Marc-André Moreau
2a5192b027 Merge branch 'master' of github.com:awakecoding/FreeRDP into egfx
Conflicts:
	client/Windows/wf_cliprdr.h
	client/Windows/wf_event.h
	client/X11/xf_client.c
	client/X11/xf_gdi.c
	libfreerdp/gdi/gdi.c
	server/Mac/mf_input.c
2014-09-17 19:09:56 -04:00
Marc-André Moreau
f0bff7e890 libwinpr-sspi: fix NTLM strict error check 2014-09-17 18:44:59 -04:00
Armin Novak
81a4081279 Decreased logging verbosity. 2014-09-16 09:37:45 +02:00
Armin Novak
6a26e33695 Fixed winpr_HexDump calls in debug mode. 2014-09-09 16:32:22 +02:00
Armin Novak
b22b897389 Reformatted changed files. 2014-09-09 16:32:22 +02:00
Armin Novak
7e3a1b3073 Now using macro to generate module specific log tag. 2014-09-09 16:32:04 +02:00
Armin Novak
28ece6bb46 Replaced stdio logging with WLog 2014-09-09 16:31:46 +02:00
Norbert Federa
cdcdec99bc OpenSSL thread safety
freerdp/winpr had the following issues:
* The non reentrant SSL_library_init() was called concurrently (crash)
* Missing code/api to set the eventually required OpenSSL static and dynamic locking callbacks
* Missing code/api to free the application-global or thread-local OpenSSL data and tables

This commit creates two new winpr functions:

BOOL winpr_InitializeSSL(DWORD flags):

Use the flag WINPR_SSL_INIT_ALREADY_INITIALIZED if you want to tell winpr that
your application has already initialized OpenSSL.
If required use the flag WINPR_SSL_INIT_ENABLE_LOCKING to tell winpr that it
should set the OpenSSL static and dynamic locking callbacks.
Otherwise just call it with the flag WINPR_SSL_INIT_DEFAULT.

The recommended way is that your application calls this function once before
any threads are created. However, in order to support lazy OpenSSL library
initialization winpr_InitializeSSL() can also safely be called multiple times
and concurrently because it uses the new InitOnceExecuteOnce() function to
guarantee that the initialization is only performed successfully once during
the life time of the calling process.

BOOL winpr_CleanupSSL(DWORD flags):

If you create a thread that uses SSL you should call this function before the
thread returns using the flag WINPR_SSL_CLEANUP_THREAD in order to clean up
the thread-local OpenSSL data and tables.
Call the function with the flag WINPR_SSL_CLEANUP_GLOBAL before terminating
your application.

Note: This commit only replaced the current occurences of the
SSL_load_error_strings(); SSL_library_init(); pairs in the freerdp source
with winpr_InitializeSSL(). None of the server or client applications has been
changed according to the recommended usage described above (TBDL).
2014-07-28 21:55:57 +02:00
Armin Novak
ad3255354d Added WITH_LIBRARY_VERSIONING, allowing to build shared libraries without
SOVERSION information. (required by Android)
2014-07-11 11:53:58 +02:00
Bernhard Miklautz
6a49bcfe40 winpr: always build "monolitic"
winpr is now always build as single library.
The build option MONOLITHIC_BUILD doesn't influence this behavior anymore.

The only exception is winpr-makecert-tool which is still build as extra
library.

This obsoletes complex_libraries for winpr.
2014-07-10 11:10:58 +02:00
Marc-André Moreau
948d137426 libwinpr-sspi: add support for passing NTLMv2 hash 2014-06-18 16:02:13 -04:00
Marc-André Moreau
e272bc923e libwinpr-sspi: fix server-side NTLM authentication against NTLMv2 without key exchange 2014-06-18 14:42:35 -04:00
Marc-André Moreau
adbfcf53ea libwinpr-sspi: fix failing test 2014-06-10 18:09:51 -04:00
Marc-André Moreau
1b93dca6c0 libwinpr-sspi: add support for querying user+domain and setting NTLM hash 2014-06-10 16:38:16 -04:00
Marc-André Moreau
723e9a171b libwinpr-sspi: fix server-side NLA 2014-06-10 14:38:17 -04:00
Marc-André Moreau
8a343c3e6d libwinpr-sspi: fix memory leaks 2014-06-10 14:16:02 -04:00
Marc-André Moreau
a27c7d85ed libwinpr-sspi: patch some memory leaks 2014-06-10 08:40:04 -04:00
Marc-André Moreau
0ebc7e2ab4 libwinpr-sspi: add custom API for passing NTLM hashes and credentials dynamically 2014-06-09 15:25:00 -04:00
Marc-André Moreau
ac9b527991 libwinpr-sspi: fix NTLM SPN context helper 2014-06-08 09:14:49 -04:00
Marc-André Moreau
1c0ba4ca9a libwinpr-sspi: add tests for NTLM 2014-06-07 18:28:02 -04:00
Marc-André Moreau
66d2b3ed93 libwinpr-sspi: fix server-side negotiate module 2014-06-07 17:08:07 -04:00
Marc-André Moreau
a37c6bb653 libwinpr-sspi: fix build on Linux 2014-06-07 16:46:32 -04:00
Marc-André Moreau
03cf7933d9 libwinpr-sspi: start implementing and using negotiate sspi module 2014-06-07 16:26:57 -04:00
Marc-André Moreau
576e0c4d1a libwinpr-sspi: fix exporting of SSPI API 2014-06-07 14:43:02 -04:00
Marc-André Moreau
a07f616895 libwinpr-sspi: improve link interface 2014-06-07 10:50:51 -04:00