Commit Graph

26 Commits

Author SHA1 Message Date
David Fort
65bb6c59fc rdpear: handle basic NTLM commands and fix server-side
This patch adds the handling of basic NTLM commands. Because there's some mysterious
4 zero bytes after pickle header in Kerberos packets, not present in NTLM commands, the
patch also had to rework a bit the packet parsing / forging.

The patch also addresses a server-side bug when parsing supplemental creds, if the client
was sending an empty list, we were considering this as an error.

And finally we also implement the parsing of MSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL.
This breaks the public API, anyway this was basically unused (as not parsed before) and
the previous API was wrong as what we receive is MSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL
not MSV1_0_SUPPLEMENTAL_CREDENTIAL, so I guess the API breakage is ok.
2025-12-04 11:31:09 +01:00
akallabeth
74648eb3a9 [c,standard] use C99 inline 2025-09-26 11:29:26 +02:00
akallabeth
25b5b38d32 [CMake,client] add pkg-config dependencies 2025-09-11 07:17:52 +02:00
akallabeth
7a3030b556 [channels,rdpear] explicitly abort if Heimdal detected
The RDPEAR channel is currently only tested against MIT kerberos. It
does not even compile with Heimdal, so bail out early during configure.
2025-08-26 15:13:01 +02:00
akallabeth
65f18983ed [warnings] Fix format string errors
* Fix casts of format string arguments (%p requires void*)
* Fix format string to match type of arguments
2025-08-13 15:09:48 +02:00
akallabeth
ee7e607562 [channels,rdpear] Enforce kerberos string length limits 2025-03-13 12:18:56 +01:00
akallabeth
ec4935073f [channels,rdpear] fix library build 2025-03-06 15:45:36 +01:00
Armin Novak
38b8f693aa [channels,rdpear] link rdpear-common to tests 2025-03-05 09:33:34 +01:00
Armin Novak
9f39f6c0b2 [channels,rdpear] default client channel to ON
If rdpear is enabled, enable the client channel by default.
2025-03-05 09:33:14 +01:00
akallabeth
1d3518fad8 [channels,rdpear] implement ndr_write_RPC_UNICODE_STRING 2025-03-04 13:03:16 +01:00
David Fort
88229dca51 Fix calls of Stream_EnsureCapacity
There were various places where Stream_EnsureCapacity was called instead of the
expected Stream_EnsureRemainingCapacity. When the stream position is set to 0 the
2 calls are equivalent, but we had various places where it was not always the case.
2025-01-13 14:49:18 +01:00
akallabeth
ac9cf26bce [cmake] fix define_channel_options
* fix usage of default value
* fix defaults of channels
* unify to single CMake function define_channel_options
2024-12-17 16:29:32 +01:00
akallabeth
344841714c Merge pull request #10844 from akallabeth/cmake-mulitconfig
Cmake multiconfig
2024-12-07 17:43:05 +01:00
akallabeth
83f2f21ad3 [warnigns] fix lots of bugprone warnings
* update-settings-tests: properly cast types in getter/setter
* wtypes: fix PHANDLE definition
* wStream: fix INT64 write function warnings
* Simplify HANDLE copy in channels, just assign after proper cast
2024-12-06 09:15:48 +01:00
akallabeth
ba8fd2ada5 [cmake] force configuration options
limit multiconfiguration options to supported types
2024-12-05 09:36:23 +01:00
akallabeth
faae38120c [cmake,format] reformat all cmake files 2024-11-27 20:41:48 +01:00
Armin Novak
527db6783b [cmake] split tests
* Keep BUILD_TESTING, but only run tests compatible with API (for
  packaging)
* Add BUILD_TESTING_INTERNAL for all tests including internal function
  tests that modify API to be run on our CI
2024-10-24 09:45:44 +02:00
akallabeth
2973ff7004 [channels,rdpear] default to OFF
Since the channel was introduced late in the 3.x series require users to
explicitly enable it to not break existing build setups.
2024-09-30 09:42:45 +02:00
akallabeth
687f946999 [channels,rdpear] fix length checks for 32bit size_t 2024-09-15 09:07:53 +02:00
akallabeth
2bcf2c50eb [channels,rdpear] fix krb5 inclusion
* do not expose the krb5 include path in interface library, it is
  private to the object library
* fix include krb5.h instead of krb5/krb5.h
2024-09-14 21:29:18 +02:00
akallabeth
0b9d35235b [channels,rdpear] fix leak in rdpear_prepare_response 2024-09-14 08:31:29 +02:00
akallabeth
d5b41bb8a0 [warnings] fix casts
* Add macro WINPR_REINTERPRET_CAST to cast (checked) from type A to B
* Fix cast warnings
2024-09-14 08:24:51 +02:00
akallabeth
f0a73e3e9c [channels,rdpear] fix inconsistencies in ndr.c/h 2024-09-14 08:24:38 +02:00
akallabeth
1c161b0270 [channels,rdpear] elimiate warnings 2024-09-14 08:24:35 +02:00
akallabeth
71080e61b0 [warnings] fix a bunch of them
* fix uninitialized variable warnings
 * modivy ndr_context_* functions to utilize WINPR_ATTR_MALLOC
 * build_krbtgt use winpr_asprintf
 * add proper Stream_Write_UINT64_BE
2024-09-14 08:24:28 +02:00
David Fort
a4bd5ba886 core, channels: client-side remote credential guard
This patch implements the client-side part of the remote credential guard feature
as described in MS-RDPEAR. The 2 main changes are: shipping the TSRemoteGuardaCreds in
NLA, and implement the rdpear channel that allows LSASS to remote all the calls to
our client. For now it's UNIX only as the windows implementation would be implemented
in a completely different way.
To test, you may establish you ccache and then connect with (RCG enabled on the server):
	xfreerdp /remoteGuard /u:<user> /d:<domain> /v<server>

That should log you in, and in the session you should not be asked for credentials when
doing mstsc /remoteGuard /v:<other server>.
2024-09-11 17:15:11 +02:00