Commit Graph

1651 Commits

Author SHA1 Message Date
Vic Lee 145fc10412 Merge pull request #2687 from akallabeth/known_hosts_v2
Store SSL fingerprints with host and port
2015-06-12 12:52:53 +00:00
Bernhard Miklautz e8d41c8516 Merge pull request #2682 from nfedera/fix-hresult-winpr-path
winpr/path: more PathCch* fixes
2015-06-11 12:47:10 +02:00
Vic Lee ad4cdf8810 winpr: add high-precision GetTickCountPrecise for Windows. 2015-06-11 15:11:19 +08:00
Armin Novak d6e1a0a25f Added StrSep function. 2015-06-09 15:32:50 +02:00
Bernhard Miklautz 07407927c2 Merge pull request #2670 from akallabeth/windows_config_paths
Adjusted config paths
2015-06-09 12:35:45 +02:00
Norbert Federa cdabfcf9e1 winpr/path: Denounce PathAllocCombine and more
Note: This commit does NOT really fix PathAllocCombine!

- print a warning message that the function is buggy and added a code
  comment describing the issues
- fix misuse of the S_FALSE HRESULT in error conditions
- prevent some segfaults
- check result of HeapAlloc

Fortunately PathAllocCombine is unused in FreeRDP
2015-06-08 14:33:19 +02:00
Norbert Federa 6823cb4a86 winpr/path: PathCchConvertStyle used S_FALSE
Use E_FAIL instead of S_FALSE which was used to indicate errors
although it is a HRESULT success code.
2015-06-08 14:33:19 +02:00
Norbert Federa b93a25a9af winpr/path: umimplemented tests print a warning 2015-06-08 14:33:19 +02:00
Norbert Federa d383f95335 winpr/path: unimpl. functions should not succeed
Unimplemented PathCch* functions now return E_NOTIMPL instead of the
HRESULT S_OK and print an error message.
2015-06-08 14:33:19 +02:00
Norbert Federa c4cd60110a winpr: fix PathCchFindExtension
Fix multiple inplementation errors including the incorrect usage of S_FALSE.
Make this function behave like the Windows 8 implementation and
the according MSDN specification.

- return S_OK if the extension was NOT found
- if no extension was found, ppszExt must point to the string's terminating null
- return E_INVALIDARG if pszPath is not null-terminated within the cchPath range
- return E_INVALIDARG if pszPath is NULL
- return E_INVALIDARG if ppszExt is NULL
- return E_INVALIDARG if cchPath is Zero
- return E_NOTIMPL instead of S_OK in PathPathCchFindExtensionW()

Also extended/fixed the TestPathCchFindExtension ctest
2015-06-08 14:33:19 +02:00
Norbert Federa 178afd8dd5 winpr: fix PathCchAppend
Fix incorrect usage of S_FALSE which was used to indicate errors
although it is a HRESULT success code.
Make this function behave like the Windows 8 implementation and
the according MSDN specification.

- return E_INVALIDARG instead of S_FALSE if pszPath is NULL
- return E_INVALIDARG instead of S_FALSE if pszMore is NULL
- return E_INVALIDARG if cchPath is zero
- return E_INVALIDARG if cchPath is greater than PATHCCH_MAX_CCH
- return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) if the combined
  path size exceeds cchPath (this is the same HRESULT which the Windows
  implementation returns in this case and which is referred to as
  PATHCCH_E_FILENAME_TOO_LONG on msdn)

Also extended/fixed the TestPathCchAppend ctest
2015-06-03 16:06:02 +02:00
Norbert Federa 92b0076c53 winpr: fix PathCchStripPrefix
And again S_FALSE was incorrectly used to indicate an error.
Fix this and be more compatible to the Windows 8 implementation of
this function:

- return E_INVALIDARG instead of S_FALSE if pszPath is NULL
- return E_INVALIDARG instead of S_FALSE if cchPath < 4
- return E_INVALIDARG if cchPath > PATHCCH_MAX_CCH
- allow stripping of "\\?\c:" and don't require "\\?\c:\"
- verify that the character at the drive letter position is
  actually an alphabetic character
- since the passed pszPath must not necessarily be null terminated
  and we always have enough space after the memmove we can always
  ensure the null termination of the stripped result

Also extended/fixed the TestPathCchStripPrefixctest
2015-06-03 16:06:02 +02:00
Norbert Federa 17ceafbb0c winpr: fix PathCchAddExtension
The HRESULT S_FALSE does not indicate an error:
- return E_INVALIDARG instead of S_FALSE
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE

Also extended/fixed the corresponding ctest
2015-06-03 16:06:02 +02:00
Norbert Federa 03b0472c29 winpr: fix PathCchAddBackslashEx
The HRESULT S_FALSE does not indicate an error:
- return E_INVALIDARG instead of S_FALSE
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE

Also extended/fixed the corresponding ctest
2015-06-03 16:06:02 +02:00
Norbert Federa 21e6012226 winpr: fix PathCchAddBackslash
The HRESULT S_FALSE does not indicate an error:
- return E_INVALIDARG instead of S_FALSE
- return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) instead of S_FALSE

Also extended/fixed the corresponding ctest
2015-06-03 16:06:01 +02:00
Bernhard Miklautz 6b92fe3805 Merge pull request #2673 from nfedera/fix-hresult
winpr: fixed HRESULT & SCODE types, added a ctest
2015-06-03 10:05:09 +02:00
Norbert Federa 77769f10b6 winpr: fixed HRESULT & SCODE types, added a ctest
- HRESULT was unsigned which means that until now all usages of the
  SUCCEDED(hr) and FAILED(hr) macros never detected any errors
- Also fixed the (unused) SCODE typedef
- Added new ctest TestTypes
2015-06-02 19:52:52 +02:00
Armin Novak c6c43d5f06 Writing failure to stderr. 2015-06-02 17:54:27 +02:00
Armin Novak 1c3b38f58b Fixed image test. 2015-06-02 17:53:16 +02:00
Armin Novak 2a3cd74c02 Fixed image test. 2015-06-02 15:17:54 +02:00
Armin Novak e6283db1b9 Added missing NULL check. 2015-06-02 10:10:47 +02:00
Armin Novak d3a88014da Fixed directory creation checks. 2015-06-02 10:01:10 +02:00
Armin Novak 70df8d8ba9 Fixed static function arguments. 2015-06-02 09:50:59 +02:00
Armin Novak d1223d3799 Fixed windows known path locations. 2015-06-02 09:50:48 +02:00
David FORT 12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Hardening 4586450e27 Merge pull request #2661 from MartinHaimberger/mh-stream-fix
stream: check stream_new in winpr and libfreerdp
2015-05-29 14:12:59 +02:00
Martin Haimberger 951a2d2210 stream: check stream_new in winpr and libfreerdp
also fixed a few things
2015-05-29 04:46:50 -07: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
Hardening f7f58f64c8 Merge pull request #2646 from eledoux/thread_list
fixed a synchronization issue on thread_list
2015-05-28 10:51:53 +02:00
Emmanuel Ledoux de1a21eadd winpr-thread: added HP's copyright 2015-05-27 18:24:56 +02:00
Emmanuel Ledoux 206714a270 winpr-thread: thread_list's synchronization based on a pthread_cond_t 2015-05-27 18:15:17 +02:00
Bernhard Miklautz 03ec9bed93 winpr/test: incorporate comments from pull request
* Fix TestIntrinsics - always returned 0
* rename TestWinpr to TestWinPR for consistency
* update gitignores accordingly
2015-05-27 10:32:08 +02:00
Emmanuel Ledoux f74cd12df2 winpr-thread: a better error message and comments about thread_list 2015-05-26 18:15:57 +02:00
Emmanuel Ledoux 56f34582c7 winpr-thread: added an assertion to enforce that thread_list is correctly set 2015-05-26 17:55:27 +02:00
Emmanuel Ledoux 93127e0a7a winpr-thread: thread_list's synchronization based on an Event 2015-05-26 17:40:34 +02:00
Bernhard Miklautz f9c7e03044 winpr: add intrin.h
Exposing lzcnt in crt.h might causes compiler errors (redefinition) with
recent versions of gcc (>=4.9) when winpr is included in other projects.
As lzcnt isn't part of crt according to MSDN and also shouldn't be
exported by default it was moved to intrin.h.

The related test was also moved to the top level directory of winpr.
2015-05-26 16:41:29 +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
Marc-André Moreau 36cb1e6dc9 Merge pull request #2639 from awakecoding/master
WLog, server-side rdpdr, remote assistance, byteswap, etc
2015-05-22 14:30:11 -04:00
Emmanuel Ledoux f94ab0033b winpr-thread: better error message upon a failure of TestThreadExitThread 2015-05-22 19:17:30 +02:00
Emmanuel Ledoux 6f5de27081 winpr-thread:
- added the unit test: TestThreadExitThread
  - fix: ensure thread_list to be up to date before to call ExitThread()
  - possibly resolved: Problems with serial redirection #2389
2015-05-22 18:28:10 +02:00
Marc-André Moreau 7a06640c16 libwinpr-shell: use getpwnam_r 2015-05-22 10:03:21 -04:00
Petr Sumbera fe5ce30f92 winsock.c Solaris build fixes 2015-05-21 13:24:03 -07:00
Marc-André Moreau 5526348079 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-05-21 13:29:59 -04:00
Marc-André Moreau c64be497b8 libwinpr-utils: update backtrace utils 2015-05-21 13:25:35 -04:00
Marc-André Moreau b9c1cddc2e Merge pull request #2583 from bceverly/OpenBSD-cleanup
Two minor source code changes to remove warnings
2015-05-21 10:17:54 -04:00
Norbert Federa cd0a8e0506 Merge pull request #2630 from hardening/new_2616
Add checks for some XXX_New and XXX_Add functions
2015-05-21 16:04:26 +02:00
David FORT 29d372480a Take in account nfedera's review 2015-05-20 19:19:50 +02:00
Bryan Everly a3a3efe31e Fixed mistake with bitwise operator in previous two commits 2015-05-20 12:17:05 -04:00
Marc-André Moreau 7e1dbd505b Merge branch 'awakecoding' of https://github.com/vworkspace/FreeRDP
Conflicts:
	channels/rdpdr/server/rdpdr_main.c
2015-05-20 11:40:48 -04:00
Bryan Everly 80af54b169 Moved thread code to OpenBSD only 2015-05-20 10:52:24 -04:00