Commit Graph

2778 Commits

Author SHA1 Message Date
akallabeth
1849632c43
Fixed format strings to match arguments (#8254)
* Fixed format strings to match arguments

Reviewed and replaced all %d specifiers to match proper type

* Added proxy dynamic channel command type to log messages.
2022-09-29 14:55:27 +02:00
David Fort
c5c2e37f6d
More winpr fixes (#8255)
* Fix build with mingw

4a71cab2e7 broke wf_events.c.
The drive channel was not building because of missing definitions.

* winpr: make functions return False when not implemented
2022-09-28 16:07:04 +02:00
Kang Lin
71b48f61c1 WinPR::Clipboard::SyntheticFile: FIX match *.* directory bug. The FilePatternMatchA don't support *.* pattern 2022-09-27 09:27:27 +02:00
Armin Novak
ba2e5477d1 Added additional checks and fixed WCHAR usage. 2022-09-26 14:01:20 +02:00
Kang Lin
195b98a9a9 WinPR::Clipboard: Refactor synthetic file
rename posix.c to synthetic_file.c
2022-09-26 14:01:20 +02:00
David Fort
e944d8d243 winpr: improve WaitForSingleObject and WaitForMultipleObject with processes
This patch improves waiting on process handles:
* under linux we take advantage of pidfd if available, when it can be used it
allows to have one or more process in the objects that are WaitForMultipleObject-ed.
* the patch also make the code honor the timeout parameter during a WaitForSingleObject and
possibly run completion when WaitForSingleObjectEx is executed with alertable set to true
2022-09-26 12:08:00 +02:00
akallabeth
d2ab631c40
Test uri fix (#8232)
* Fixed TestUri unit test

* Make proper unit test out of the test function
* Add proper test cases

* Replace FindFirstFileA with FindFirstFileW for addins

This allows addin paths to contain unicode symbols.

* Fixed parse_uri_to_local_file definition

* Move to common clipboard.c file
* Move to header file so it can be included in test case

* Added WINPR_LOCAL for test builds

This macro exports internal functions in case of a unit test build
This way unit tests can access these without other workarounds.

* Fixed typo in function name is_dos_driver

* Cleaned up FindFirstFileW call

Use a wrapper function to convert to unicode and call the function

* Cleaned up BUILD_TESTING and EXPORT_ALL_SYMBOLS

* EXPORT_ALL_SYMBOLS now does as the name implies and exports all
  non static functions/variables from the library.
* BUILD_TESTING now only sets the defines for test code and
  activates EXPORT_ALL_SYMBOLS to allow tests to access internal
  code

* Fixed windows client warnings

* disable CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS
2022-09-26 11:22:02 +02:00
David Fort
ccffa8dfa2 winpr: add a function to export timer file descriptor
The equivalent exist for Events, and it happens that sometime you also need to access
the internal file descriptor associated with a timer.
2022-09-23 09:04:45 +02:00
David Fort
56204164fe core: check the kind of object for events and threads functions
This patch adds some checks for the type of object in Event and Thread functions,
this may help to find bugs where a handle with the wrong type is used as argument
of these functions.
2022-09-21 16:04:02 +02:00
Zopolis4
2145cef543 Restrict overmatching MACH ifdef to only trigger on OSX and Mach 2022-09-21 09:09:16 +02:00
Armin Novak
e7973d15ff Fix out of bounds reads in parse_uri_to_local_file 2022-09-19 11:06:40 +02:00
Kang Lin
6a6e3340c7 WinPR::Clipboard: Add to convert uri to local file
URI is specified by RFC 8089: https://datatracker.ietf.org/doc/html/rfc8089

Local files:

   o  A traditional file URI for a local file with an empty authority.
      For example:

      *  "file:///path/to/file"

   o  The minimal representation of a local file with no authority field
      and an absolute path that begins with a slash "/".  For example:

      *  "file:/path/to/file"

   o  The minimal representation of a local file in a DOS- or Windows-
      based environment with no authority field and an absolute path
      that begins with a drive letter.  For example:

      *  "file:c:/path/to/file"

   o  Regular DOS or Windows file URIs with vertical line characters in
      the drive letter construct.  For example:

      *  "file:///c|/path/to/file"

      *  "file:/c|/path/to/file"

      *  "file:c|/path/to/file"
2022-09-16 11:41:43 +02:00
Néfix Estrada
66bef0c708 feat(emscripten): add support for emscripten compilation 2022-09-15 10:23:43 +02:00
akallabeth
43dc14f94b
Fix possible out of bound write in winpr_read_unix_timezone_identifier_from_file (#8207)
If the timezone can not be read from the file (read 0 bytes) then memory
at a random position (buffer[-1] = '\0') will be set to zero.
2022-09-14 16:26:24 +02:00
Armin Novak
8561b08592 Fixed gnome and mate clipboard format synthesizers 2022-09-13 14:42:33 +02:00
Armin Novak
b3f70b047d Fix OId compare 2022-09-13 09:16:55 +02:00
Kang Lin
0faa2c91fe WinPR::Clipboard: FIX text/uri-list format bug(#7904)
See:
  GTK: https://docs.gtk.org/glib/struct.Uri.html
  uri syntax: https://www.rfc-editor.org/rfc/rfc3986#section-3
  uri-lists format: https://www.rfc-editor.org/rfc/rfc2483#section-5
2022-09-12 08:58:34 +02:00
David Fort
4fc7a9417d
Various fixes / improvements (#8146)
* xfreerdp: fix typo in logs

* winpr: file appender, small code cleanup

* shadow-server: add an option for TLS secrets

This allows to dissect connections to the shadow server.
2022-08-22 09:42:15 +02:00
fifthdegree
7901a26a16
Kerberos User 2 User support (#8070)
* add support for 64-bit big-endian encoding

* kerberos: drop reliance on gssapi and add user 2 user support

* Fix local variable declared in the middle of the function body

* kerberos: add ccache server option

Co-authored-by: fifthdegree <fifthdegree@protonmail.com>
Co-authored-by: David Fort <contact@hardening-consulting.com>
2022-08-17 12:25:26 +02:00
David Fort
c9eea58ef2
winpr: set non-blocking on both fd with pipe() based events (#8106) 2022-08-03 08:30:51 +02:00
David Fort
da10710cf9
winpr: complement thread tests and fix some asserts (#8105) 2022-08-02 11:40:55 +02:00
akallabeth
bf56a39e6f
Fixed #8090: Duplicate definition of strndup (#8102)
* Fixed #8090: Duplicate definition of strndup

* Moved strndup detection to winpr

Co-authored-by: Armin Novak <anovak@thincast.com>
2022-08-02 09:15:38 +02:00
David Fort
1f08cb9a7d
Drdynvc needs love (#8059)
* winpr: add lock operation on HashTables

* drdynvc: change the listeners array for a hashtable and other micro cleanups

* logonInfo: drop warning that is shown at every connection

Let's avoid this log, we can't do anything if at Microsoft they don't respect
their own specs.

* rdpei: fix terminate of rdpei

* drdynvc: implement the channel list with a hashtable by channelId
2022-07-26 12:53:41 +02:00
David Fort
48abc64a6d winpr: update WinPrAsn1DecReadContextualOctetString to use common code 2022-07-26 09:38:53 +02:00
fifthdegree
5f3bc5842a nla: use winpr asn1 library 2022-07-26 09:38:53 +02:00
fifthdegree
8fb49e1f31 ncrypt_pkcs11: enumerate keys by public keys 2022-07-21 18:38:36 +02:00
David Fort
90aaea0a55
winpr asn1: fix error reporting of ReadContextualXXX functions (#8085) 2022-07-21 16:00:57 +02:00
Martin Fleisz
b93f742896 winpr: Add missing include for windows build 2022-07-21 15:59:43 +02:00
fifthdegree
54bbe33123
spnego: add missing check (#8069)
Co-authored-by: fifthdegree <fifthdegree@protonmail.com>
2022-07-15 08:33:28 +02:00
fifthdegree
dfa231c0a5
spnego: correctly set output buffer size (#8060)
Co-authored-by: fifthdegree <fifthdegree@protonmail.com>
2022-07-12 10:08:44 +02:00
Armin Novak
586675942a Fixed missing return 2022-07-07 17:31:49 +02:00
Armin Novak
36c7c0320b Fixed review comments 2022-07-07 17:31:49 +02:00
fifthdegree
362ae93a64 spnego: some cleanups and fixes 2022-07-07 17:31:49 +02:00
David Fort
8b5df3fa92 spnego: cleanup the guess of the input token 2022-07-07 17:31:49 +02:00
David Fort
b128ec4fba spnego: add various check and fixes 2022-07-07 17:31:49 +02:00
David Fort
6c834eaa15 winpr: adjust negotiate_GetMechByOID function 2022-07-07 17:31:49 +02:00
fifthdegree
2a3c92b4cc spnego: use winpr asn.1 library 2022-07-07 17:31:49 +02:00
Pascal Nowack
43b609cd6c winpr/clipboard: Allow overriding ValidFileNameComponent call
When using the wClipboard API, the connected peer might not be on the
Windows platform, where further filename restriction exists.
As a result, it is currently not possible to use the wClipboard API,
when intending to allow filenames, containing characters like ':'.

So, add a callback to the wClipboardDelegate, which is set to the
ValidFileNameComponent call by default.
This callback can be overridden by the API user, when it is known, that
there is no need to impose very strict filename restrictions.
2022-07-07 07:45:26 +00:00
David Fort
168117e85b winpr: fix encoding of octetString containers and add required functions for SPNego 2022-07-05 15:04:01 +02:00
akallabeth
05b339b0b1 Added strndup replacement 2022-07-04 14:31:08 +02:00
akallabeth
51f4c374c4 Clear OpenSSL error queue before BIO_read/BIO_write 2022-07-02 16:32:50 +02:00
David Fort
bddb71230e winpr asn1: fixes and more features
This patches adds support for octet string containers that are used by SPNego
(a subfield is contained in an octet string record).
It also adds a performance test to test reallocations in asn1 encoder.
It fixes reallocation problems for both chunks and containers.
2022-07-01 09:43:01 +02:00
David Fort
cbda255dcd winpr: add some ASN1 parsing functions
This patch implements ASN1 parsing in WinPR, as we need it in SSPI packages.
2022-07-01 07:51:31 +02:00
akallabeth
5d1d3d6582 Fixed #8022: leaks in kerberos code 2022-06-30 23:00:48 +02:00
akallabeth
39bd78d2fb Fixed missing includes 2022-06-29 18:10:33 +02:00
akallabeth
7c85949f1d Fixed unused variable warnings 2022-06-29 18:10:33 +02:00
akallabeth
99cda9249f Fixed uninitialized warnings 2022-06-29 18:10:33 +02:00
akallabeth
684ada9c0e Fixed uninitialized warnings 2022-06-29 18:10:33 +02:00
Adrian Perez de Castro
81e8e28062 Fix building with LibreSSL 2.7.0 or newer
With LibreSSL 2.7.0 (or newer versions) some more structs have made
opaque, which requires a few changes:

- BIO_meth_new() and related functions are now defined by LibreSSL, the
  versions from opensslcompat.{h,c} does not need to be used anymore.
- HMAC_CTX is now opaque, HMAC_CTX_new(), EVP_MD_CTX_new, and related
  functions should be used instead in winpr's hash.c.
2022-06-27 12:42:06 +02:00
akallabeth
9fee695ed0 Assert stream pool if duplicate entry is found 2022-06-27 11:21:24 +02:00
akallabeth
488a0d1edd Fixed streampool release 2022-06-27 11:21:24 +02:00
akallabeth
25c120d25d Fixed type mismatches and memory leaks 2022-06-27 11:21:24 +02:00
akallabeth
bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth
ec8550e87f Fix unwind backtrace warnings 2022-06-23 07:45:55 +02:00
fifthdegree
56d10c2d27 kerberos: don't get a tgt ticket for inbound creds 2022-06-21 10:27:17 +02:00
fifthdegree
8ac977e671 make sure existing ccache credentials are not expired 2022-06-21 10:27:17 +02:00
David Fort
a31574d359 kerberos: correctly detect missing credentials even with an empty cache 2022-06-21 10:27:17 +02:00
David Fort
90a2b9a10c Various fixes in negotiate.c 2022-06-21 10:27:17 +02:00
fifthdegree
b5ba6d135c retry on all errors from acquire_creds 2022-06-21 10:27:17 +02:00
fifthdegree
c51348a33b fixes 2022-06-21 10:27:17 +02:00
fifthdegree
e66b99f8dc deprecate old hash callback field 2022-06-21 10:27:17 +02:00
fifthdegree
6d3aa52496 set SAM file and hash callback on credential rather than context 2022-06-21 10:27:17 +02:00
fifthdegree
eeece1a027 server-side kerberos (and some fixes) 2022-06-21 10:27:17 +02:00
fifthdegree
8d9f990124 some more tweaks 2022-06-21 10:27:17 +02:00
fifthdegree
441fa01acb adjust ntlm unit test 2022-06-21 10:27:17 +02:00
fifthdegree
a359124339 some small fixes and changes 2022-06-21 10:27:17 +02:00
fifthdegree
1c012b09b8 implement proper SPNEGO negotiation 2022-06-21 10:27:17 +02:00
akallabeth
f25261e271 Unifiy string append functions 2022-06-17 08:41:46 +02:00
akallabeth
31708d8b20 Disable LTO on apple devices 2022-06-03 08:51:40 +02:00
akallabeth
3d65e5a138 Fix return of getlogin() 2022-06-02 13:57:09 +02:00
Marc-André Moreau
227aa6a55f Fix WinPR SSPI unit tests to always use SSPI function table 2022-06-01 15:16:12 +02:00
Marc-André Moreau
1d5c0be5ec Add settings to load a custom SSPI shared library module 2022-06-01 15:16:12 +02:00
David Fort
0a404d5728 fix a warning seen on the MacOS CI 2022-05-30 14:05:41 +02:00
akallabeth
65938708c0 Fixed WITH_PKCS11 option 2022-05-12 11:36:01 +02:00
David Fort
77413f49b2 winpr: rework alignment functions
_align_XXX functions aren't widely available depending on the C runtime. That causes
problems with mingw where we can easily have some runtime mixes (which lead to mysterious
segfaults most of the time). This patch introduce winpr_aligned_XXX functions that will
either use the function available, or use an emulation layer.
2022-05-12 11:36:01 +02:00
David Fort
82092f6752 smartcard: add verbose output during listing 2022-05-12 11:36:01 +02:00
akallabeth
ca9247ddd9 Do not compile ncrypt_pkcs11 if CMake option is not set 2022-05-06 13:39:26 +02:00
David Fort
4ffd3e84b9 smartcard: take in account pkcs11-module in smartcard listing and print pkcs11 errors 2022-05-06 13:39:26 +02:00
David Fort
a612ca4ba2 winpr: fix unitary test when CreateProcess is CreateProcessW
As the second argument of CreateProcessW is modified to split with spaces and so
this can not be a const arg.
2022-05-05 13:11:18 +02:00
Armin Novak
03ed367fb9 Fixed broken USE_UNWIND check 2022-05-05 13:05:33 +02:00
Armin Novak
400fe6f796 Fixed argument mismatch 2022-05-03 11:48:20 +02:00
akallabeth
6ce3499e13
Settings getter tests (#7869)
* Added tests for freerdp_[static|dynamic]_collection_* functions

* Added settings unit test for clone functions

* Fix argument for winpr_RAND and winpr_RAND_pseudo

Using void* eliminates all assumptions of which type the buffer is.
This eliminates unnecessary warnings.
2022-05-02 11:39:38 +02:00
akallabeth
a62fe8a3e9 Enable unwind.h and dladdr as default backtrace implementation
* config option USE_UNWIND to enable/disable
2022-04-29 15:15:53 +02:00
akallabeth
f10da4552b default android to unwind 2022-04-29 14:27:44 +02:00
akallabeth
9330559d24 Defined and use _write 2022-04-29 14:27:44 +02:00
akallabeth
00b00ea521 Added unwind.h support 2022-04-29 14:27:44 +02:00
akallabeth
f146709eec Moved corkscrew backtrace to own file 2022-04-29 14:27:44 +02:00
akallabeth
3e62a05134 Moved windows backtrace to own file 2022-04-29 14:27:44 +02:00
akallabeth
0491f91327 Moved execinfo backtrace to own file 2022-04-29 14:27:44 +02:00
akallabeth
f8ada8984d Simplified CMake variable names 2022-04-29 14:27:44 +02:00
akallabeth
340f9dd775 Fixed conditional warnings 2022-04-28 12:37:19 +02:00
akallabeth
d63817640f Fixed ArrayList_SetItem, return success 2022-04-28 12:37:19 +02:00
akallabeth
6bc7f6ca88 Fixed cast-qual warnings 2022-04-28 12:37:19 +02:00
akallabeth
962c5c3ef0 Fixed dead store warnings 2022-04-28 12:37:19 +02:00
akallabeth
ec699f6c75 scanbuild fixes 2022-04-28 12:37:19 +02:00
akallabeth
1dcc5a180a Fixed warnings 2022-04-28 11:24:51 +02:00
akallabeth
cc3e28f2f1 Fixed -Wdocumentation errors 2022-04-28 11:24:51 +02:00
akallabeth
507722aca4 Fixed snprintf return value checks 2022-04-28 10:49:09 +02:00
akallabeth
2dfc1ddb12 Removed obsolete trio 2022-04-28 10:49:09 +02:00
akallabeth
667b471686 Fixed cast-quality warnings 2022-04-28 09:17:20 +02:00
Armin Novak
e1b4b4aee0 Replaced WINPR_HANDLE_DEF with a struct type 2022-04-28 08:42:09 +02:00
Armin Novak
2dc98adb62 Updated _wcschr and _wcsrchr to match MSDN spec 2022-04-27 19:42:04 +02:00
Armin Novak
833a445e4e Refactor thread condition logic
* Add better return value checks
* Combine logic blocks in structs
* Add (easier to read) static functions for blocks
* Use condition variables only in combination with BOOL
2022-04-27 18:12:37 +02:00
akallabeth
19de452f9c Cleaned up ntlm_fetch_ntlm_v2_hash 2022-04-22 15:30:23 +02:00
akallabeth
73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
akallabeth
752ac3b479
Fix #7793: Do not expose internal input API (#7794)
* Fixed GetFileInformationByHandle initializers

* Fix #7793: Do not expose internal input API

Slow-Path input uses UINT16 for scancodes on wire, but only the
lower byte is actually used. (the extended fields are sent in
keyboardFlags field)
Hide this implementation detail and adjust the API to use UINT8
for the code instead just like the corresponding Fast-Path PDU

* Added a warning for problematic slow path keyCodes
2022-04-13 09:34:05 +02:00
Armin Novak
9d5e7b0d38 Fixed broken stream check 2022-04-06 08:58:32 +02:00
Armin Novak
037084abd5 Fix #7754 remove last newline in convert_filedescriptors_to_file_list 2022-03-28 16:21:27 +02:00
Armin Novak
22194a2ec6 Fixed missing field read. 2022-03-28 15:52:59 +02:00
Armin Novak
29b8298ff8 Fixed windows build (_snpnrintf) 2022-03-28 15:52:59 +02:00
Armin Novak
42ddb0898e Fixed NTLM flag handling
* NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED and NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED
* Problem with clients not supporting NTLMSSP_NEGOTIATE_LM_KEY
* Improve logging
2022-03-28 15:52:59 +02:00
akallabeth
47bd162065 Added function sspi_SetAuthIdentityW 2022-03-28 15:52:59 +02:00
akallabeth
905609381f Unified sspi_FreeAuthIdentity 2022-03-28 15:52:59 +02:00
Armin Novak
453d3b4c8b Fixed #7754: nautilus does not like \r\n 2022-03-28 14:59:30 +02:00
akallabeth
c2e882c509
Nla server cleanup && server auth fix (#7743)
* Reduce negotiate logging verbosity

* Remove duplicate pointers from rdpNla

* Fixed server nla auth

* Encapsulated nla_server_recv_credentials
2022-03-25 10:47:05 +01:00
Zhengyi Fu
e62aaff319 winpr: add GetFileInformationByHandle 2022-03-24 13:40:31 +01:00
Armin Novak
4f07e75bac Removed unnecessary assert 2022-03-22 10:59:58 +01:00
Armin Novak
8d4332235e Refactored WinPR::NTLM
* added assertions
* added log messages
* removed code duplication
2022-03-22 10:59:58 +01:00
Mike Gabriel
d337ea9c16 winpr/{libwinpr/thread/thread.c,include/winpr/thread.h}: Keep DumpThreadHandles as a symbol even if WITH_DEBUG_THREADS is OFF. 2022-03-08 09:16:10 +01:00
akallabeth
3d38d2636c Decreased logging verbosity for INFO level 2022-03-04 09:34:02 +01:00
Armin Novak
d1f8c00f7b Fixed duplicated symbols 2022-03-03 11:26:48 +01:00
Armin Novak
6ed50b4b1d Refactored WinPR includes 2022-03-03 11:26:48 +01:00
akallabeth
c99c4cecdd Fixed GetEnvironmentVariableX: Return sting length including '\0' 2022-03-03 08:15:28 +01:00
akallabeth
952068145e Fixed GetEnvironmentVariableX win32 call to ConvertFromUnicode 2022-03-03 08:15:28 +01:00
akallabeth
aef3cb16fa Fixed GetEnvironmentVariableX for windows 2022-03-03 08:15:28 +01:00
David Fort
fa1656178a Fix a leak in GetEnvironmentVariableX under win32
The variable name was leaked.
2022-03-03 08:15:28 +01:00
David Fort
f33c679552 smartcard: fix smartcard enumeration
There was a bug in smartcard listing that was leading to be unable to open a key
with slotId != 0. When any error or skipped item was happening during listing
the code was crashing.
2022-03-03 08:15:28 +01:00
akallabeth
c25d15d1d6 Initialize WLog prefix string buffers '\0' 2022-02-28 16:49:18 +01:00
akallabeth
861eaa693b Removed windows debug console 4096 character limit 2022-02-28 16:49:18 +01:00
Armin Novak
e36c49eab7 Properly log kerberos error strings 2022-02-24 14:48:46 +01:00
Armin Novak
001c505572 Const corrected function sspi_CopyAuthIdentity 2022-02-24 14:48:46 +01:00
Armin Novak
5fd3bf7c0c Fixed reg_load_value 2022-02-24 12:31:58 +01:00
Armin Novak
6e2c5f2273 Added CommandLineParseCommaSeparatedValuesEx single quote support 2022-02-24 10:58:26 +01:00
Armin Novak
f4572b082a Use typedef struct definition for sspi types 2022-02-24 08:52:25 +01:00
David Fort
0435b5a65d Implement smartcard logon 2022-02-24 08:52:25 +01:00
David Fort
310f2047bf fix build with mingw 7 2022-02-24 08:52:25 +01:00
David Fort
c90074d10c fix leaks in ncrypt 2022-02-24 08:52:25 +01:00
David Fort
19453883f8 winpr gss: wire gss_acquire_cred_from 2022-02-24 08:52:25 +01:00
David Fort
cb351a099d Enable smartcard NLA logon 2022-02-24 08:52:25 +01:00
David Fort
a563a6836b winpr: ncrypt add a property to retrieve the PKCS11 slotId 2022-02-24 08:52:25 +01:00
Armin Novak
ceaff16f8c Added quoted argument support to CommandLineParseCommaSeparatedValuesEx
* Argument quoting support
* Empty list element detection
* Unit test for argument parser
2022-02-24 08:26:30 +01:00
Armin Novak
3bb36f4caa Fixed clang-scanbuild warnings 2022-02-22 16:15:05 +01:00
Armin Novak
c0a39c2db8 Fixed TestUnicodeConversion warning 2022-02-22 12:21:21 +01:00
Armin Novak
1b71bba2a0 Fixed compilation warnings 2022-02-22 11:29:56 +01:00
Armin Novak
bf9f1eccc1 Fixed issued with mingw build 2022-02-18 08:38:28 +01:00
akallabeth
3c61a31f65 Fixed ICU include directories 2022-02-17 09:53:52 +00:00
Armin Novak
5f8ab14f3f Cleaned up registry value reading, added warnings 2022-02-15 13:43:36 +00:00
Armin Novak
8231a7e7a7 Added runtime configuration option for kerberos/NTLM fallback 2022-02-15 13:43:36 +00:00
Armin Novak
3f39c19709 Fixed wrong assert and memory leaks 2022-02-15 10:51:03 +01:00
Armin Novak
4492c834cd Fixed uninitialized warnings 2022-02-15 10:51:03 +01:00
Armin Novak
89e4cf33e3 Fix NCryptOpenP11StorageProviderEx
* Allow NULL paths, fall back to default (or direct link)
2022-02-15 10:51:03 +01:00
Armin Novak
7d92e9c809 Option to link against opensc-pkcs11 2022-02-15 10:51:03 +01:00
Armin Novak
a229c1672d Warning fixes and assert 2022-02-15 10:51:03 +01:00
Armin Novak
aac28aaeab Fixed NCryptOpenP11StorageProviderEx 2022-02-15 10:51:03 +01:00
akallabeth
2d2627deab
Fixed SSPI fallback to NTLM (#7642)
* Fixed SSPI fallback to NTLM

* Fixed wide/ansi mixup

* WITH_GSS fixes

* Move to WinPR as this is not related to FreeRDP
* Add option WITH_GSS_NO_NTLM_FALLBACK to disable NTLM fallback

* Abort NLA if status is SEC_E_NO_CREDENTIALS

* Properly invalidate sspi::SubContext
2022-02-15 09:04:17 +01:00
akallabeth
8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
Armin Novak
1947629b8e Fixed possible leaks in TestSynchMultipleThreads 2022-02-14 08:36:55 +00:00
Armin Novak
10e40147fb Fixed various const warnings 2022-02-01 10:25:37 +00:00
Armin Novak
ca30e749e9 Fixed unused-but-set-variable and reserved identifier warnings 2022-02-01 08:48:21 +01:00
Armin Novak
bc08ebc01c Corrected const arguments for wStream functions
Functions only extracting values now use const for wStream argument
2022-01-31 16:13:06 +01:00
akallabeth
b698041d9f Fixed return value of GetUserNameExA 2022-01-25 15:33:04 +01:00
akallabeth
7dedfbb0b0 Added support for getpwuid_r, replaced duplicate code
* Use GetUserNameExA to get current user name when required.
* Add support for getpwuid_r if available
2022-01-25 15:33:04 +01:00
akallabeth
a337031b24
Cache Emulate_IsConfigured result (#7569)
* Cache Emulate_IsConfigured result

The check is used very often, so this caching reduces necessary
allocations.

* Fix winpr_HexLogDump

Abort function early if the log message is to be discarded due to
the log level being inactive.

* Use common logger for rdpdr message

Co-authored-by: Martin Fleisz <martin.fleisz@thincast.com>
2022-01-21 13:24:20 +01:00
David Fort
02535ea200 winpr: fix a crash when kerberos fails during negociation 2022-01-19 18:03:52 +01:00
David Fort
968416ce95 kerberos: fix encode/decode functions 2022-01-19 18:03:52 +01:00
akallabeth
e6e6ed5dbd Cleaned up PubSub
* Callback arguments now const
* Fixed missing includes
2022-01-19 09:24:57 +01:00
akallabeth
1326134cdf Fixed warnings in BufferPool 2022-01-19 09:24:57 +01:00
David Fort
82eee65daf winpr: fix ncrypt on Mac and updated tests 2022-01-17 16:27:53 +01:00
David Fort
06cb610207 smartcard: start implementing SCardListCards
This basic implementation tries to emulate the corresponding function by using a
predefined list of name for a given ATR.
2022-01-17 16:27:53 +01:00
David Fort
130f191392 winpr: fix some string constant in ncrypt and add reader property
Some WCHAR string constant were wrong (missing \x00 at the end).
The commit also implements the NCRYPT_READER_PROPERTY property in the pkcs11 provider.
2022-01-17 16:27:53 +01:00
David Fort
eb53b9913a winpr: interpret the scope paramater in NCryptEnumKeys
Although the official documentation claims that pszScope parameter shall be set to
NULL. In practice setting it to \\.\<reader name>\ allows to filter on the corresponding
reader.
2022-01-17 16:27:53 +01:00
akallabeth
bd42b34776 Decreased NTLM debug log verbosity 2022-01-13 17:20:48 +01:00
Armin Novak
855aaaadad Fixed reg_close 2022-01-11 14:32:18 +01:00
Armin Novak
444ddb4444 Fixed reg_unload: ignore empty root_key 2022-01-11 14:32:18 +01:00
Armin Novak
339cdded45 Fixed memory sanitizer warnings 2022-01-11 14:32:18 +01:00
Armin Novak
004a0984b9 Fixed reg_insert_key 2022-01-11 14:32:18 +01:00
Armin Novak
56ae1ed9b3 Fixed verbose debug messages in registry 2022-01-11 14:32:18 +01:00
Armin Novak
1dc14b7379 Harden registry function emulation 2022-01-11 14:32:18 +01:00
akallabeth
df67d2796f Fixed reg_load_val
Reported by George Zaytsev from Positive Technologies
2022-01-11 14:32:18 +01:00
akallabeth
ce4a9ad1e7 Fixed RegQueryValueExA
* Set lpType if not NULL
* Set lpcbData only if not NULL

Reported by George Zaytsev from Positive Technologies
2022-01-11 14:32:18 +01:00
akallabeth
8c543b1de2 Added smartcard emulation layer 2022-01-11 12:34:43 +01:00
Marc-André Moreau
55be5f8bb0 Fix Windows Unicode handling of environment variables 2022-01-11 12:32:14 +01:00
David Fort
da17787f9a mingw: fix pool tests compilation 2022-01-10 11:02:45 +01:00
David Fort
bfe8b464be winpr: fix and enhance ncrypt
This patch adds the NCryptEnumStorageProviders function.
It also fixes strings bugs with the compiler taking the WCHAR "Micro" string
M\x00i\x00c\x00r\x00o\x00 as
M\x00i\x0c\x00r\x00o\x00, and so generating unexpected behaviours. The solution is
to split string constants when you hit a character that is a valid hex number, so
that the compiler doesn't interpret i\x00c\x00 (ic in WCHARs) as i\x0c\x00 (weird
string).
2022-01-10 11:02:45 +01:00
Armin Novak
d114773a08 Removed unimplemented/unused ndr from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
ed9cc8c1cc Removed heap module from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
4f0f8e9f8c Removed credentials module from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
5365b2f5f0 Removed midl.c|h from WinPR 2021-12-23 14:27:12 +01:00
Armin Novak
3de6af34ed Removed unused module winhttp 2021-12-23 14:27:12 +01:00
Armin Novak
379aeed24e Removed unimplemented credui module 2021-12-23 14:27:12 +01:00
Armin Novak
a713d5417e Remove unimplemented wnd module 2021-12-23 14:27:12 +01:00
Armin Novak
be3e09aa72 Removed unused static variables 2021-12-20 08:11:00 +01:00
Armin Novak
b30f8886b2 Fixed LinkedList const correctness 2021-12-15 13:36:15 +01:00
David Fort
d4020e2328 winpr: implement ncrypt API
This implements the emulation for the ncrypt API and more specifically the smartcard
provider so that we can list available keys and certificates using pkcs11-helper.
2021-12-14 14:12:01 +01:00
Armin Novak
4551ecf845 Removed unused string constant 2021-12-14 13:46:34 +01:00
Armin Novak
46c78cf0f0 Fixed missing return check 2021-12-14 13:46:34 +01:00
akallabeth
6ee60ea15a Fixed various warnings 2021-11-30 08:20:19 +01:00
akallabeth
a3af2c0bdc Fix duplicate MIN macro definition 2021-11-25 12:25:18 +01:00
Ondrej Holy
fa73c6c8f1 winpr/crypto: Do not load legacy provider from RC4
This partially reverts commit 67f3fff2. The legacy provider is now loaded
from the `winpr_InitializeSSL` function, so it is not needed to load it from
the `winpr_RC4_New` function again.
2021-11-18 14:17:12 +01:00
Ondrej Holy
365c9f6319 winpr/ssl: Fix capitalization in log messages
The log messages contained the `ENabled` string, which looks weird to me.
Let's change that to `enabled`.
2021-11-18 14:17:12 +01:00