Commit Graph

2478 Commits

Author SHA1 Message Date
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