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
1f398c6c51
Added missing include
2022-07-02 16:32:50 +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
akallabeth
7faf18d9dd
Updated flags required by [MS-RDPERP]
2022-06-29 11:41:45 +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
1aacf504a1
Increase C standard to C11
2022-06-03 08:51:40 +02:00
akallabeth
a0ca2b4a6e
Add LTO settings
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
akallabeth
4c452a96c4
Fixed broken #define guards
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
860f44f762
CMake check_include and struct cleanup
...
Move to WinPR what should be there.
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
5482607b15
Added Stream_PointerAs
...
This macro allows retrieving the stream pointer casted to correct
type.
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
Armin Novak
08035be41b
Added missing WINPR_API
2022-04-25 16:06:34 +02:00
akallabeth
74c1a006e9
Fixed format string for Stream_CheckAndLogRequiredLength
...
__LINE__ requires %d and not %PRIuz
2022-04-23 10:10:09 +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
David Fort
f232562d8b
smartcard: take in account the module path for listing smartcards
...
The PKCS1 module was taken only for the kerberos part.
Also make as exported the winpr_NCryptOpenStorageProviderEx function.
2022-04-15 09:06:09 +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
70ea2eef46
Fixed *_EXPORTS
2022-03-01 08:00:25 +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
cb27338bf4
Set required C standard to C99 with extensions
2022-02-24 12:31:58 +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
Armin Novak
99d63ea89e
Fixed missing static and WINPR_API
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
akallabeth
f568d70d52
Fixed guards
2022-02-18 08:38:28 +01:00
Armin Novak
bf9f1eccc1
Fixed issued with mingw build
2022-02-18 08:38:28 +01:00
akallabeth
c1a1e4f1d2
Force WITH_GSS_NO_NTLM_FALLBACK to OFF
2022-02-17 09:53:52 +00: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