Commit Graph

2469 Commits

Author SHA1 Message Date
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
Ondrej Holy
b90ccfa13f winpr/ssl: Call the winpr_enable_fips function only once
The `winpr_enable_fips`	function is called twice from the `winpr_InitializeSSL`
function after commit 49936a7b. I believe this is a bug, which might lead to
some undesired behavior. Let's call that only once.
2021-11-18 14:17:12 +01:00
Ondrej Holy
2d0b58759b winpr/ssl: Load legacy provider when initializing OpenSSL 3.0
With OpenSSL 3.O, FreeRDP log contains errors like:

```
4036740A4C7F0000:error:0308010C:digital envelope routines:
inner_evp_generic_fetch:unsupported:crypto/evp/evp_fetch.c:346:
Global default library context, Algorithm (MD4 : 85), Properties ()
```

This leads to connection failures in some cases. This is because algorithms
like MD4 are now part of the legacy provider, which is not loaded by
default. Let's explicitly load that provider. With this change, also the
other provides has to be explicitely loaded.
2021-11-18 14:17:12 +01:00
David Fort
67986ea298 Fix compilation with mingw
This patch addresses some issues when compiling against mingw. With these changes
FreeRDP can be compiled out-of-the box on a Ubuntu 20.04.
2021-11-15 09:23:16 +01:00
akallabeth
58b24f13fe
Add an option to add the plugin and extension to rpath (#7425) 2021-11-04 08:59:38 +01:00
Armin Novak
68eb6e4afc Drop ASN1 module stub
Not implemented, just creates confusion.
2021-11-02 15:13:20 +01:00
Armin Novak
fb924c6bbc Fixed struct alignment 2021-10-18 16:09:13 +02:00
Armin Novak
319b0e1b7e Queue_Enqueue const argument
By default use const for the object enqueued.
If a `fnObjectNew` function is set, it is copied anyway.
For the case without cast away the const internally.
2021-10-18 16:09:13 +02:00
akallabeth
e72d502b8d
Fixed #7363: Length checks in ConvertUTF8toUTF16 (#7365) 2021-10-15 09:39:50 +02:00
Armin Novak
e362a59aa5 Fixed const correctness of variable 2021-10-14 13:04:59 +02:00