229 Commits

Author SHA1 Message Date
Armin Novak
465a6353d5 [c23,client] replace NULL with nullptr 2026-02-26 15:42:59 +01:00
Armin Novak
0531803808 [warnings] make function declaration names consistent
Use the same parameter names for declaration and implementation.
2026-02-26 10:35:25 +01:00
Armin Novak
48267edf2f [winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this
macro
2026-02-25 19:23:08 +01:00
Armin Novak
3fcc287b16 [warnings] initialize all va_list 2026-02-25 07:41:39 +01:00
Armin Novak
55f6827f6d [client,common] filter some error codes from reconnect
Credential and account errors are most likely related to a permanent
error server side. Do not try to reconnect.
2026-02-23 11:55:33 +01:00
Armin Novak
5475aeecf1 [client,common] fix mask for freerdp_client_handle_touch 2026-02-18 13:23:48 +01:00
Armin Novak
df64d00a97 [warnings,api] fix -Wunused-result
With marking publid API [[nodiscard]] some problematic error checks in
the core library were uncovered. This commit addresses these
shortcomings.
2026-02-17 11:07:08 +01:00
Armin Novak
f4b0549c5b [client,warnings] properly handle function return 2026-02-16 09:18:38 +01:00
akallabeth
fe9a1b0eed [client,sdl] add error checks and logs 2026-01-28 21:31:54 +01:00
akallabeth
495a82c463 [client] mark all WINPR_ATTR_MALLOC also nodiscard 2026-01-26 13:22:28 +01:00
akallabeth
d4ae1a546f [client,common] add FREERDP_TOUCH_CANCEL
* Add flag FREERDP_TOUCH_CANCEL
* Add function freerdp_handle_touch_cancel
2026-01-25 08:56:03 +01:00
akallabeth
17fb44d508 [c,printf] fix wlog format string to match arguments 2026-01-16 11:40:44 +01:00
Armin Novak
164dfef442 [warnings] fix signed/unsigned compare warnings 2026-01-09 09:24:19 +01:00
Armin Novak
71b113ceb0 [clang,warnings] fix Wjump-misses-init 2026-01-08 11:32:36 +01:00
akallabeth
0f5c53d3e5 [client,common] handle AUTH_RDSTLS separate
The requirements for that authentication type are different, so handle
it not like the rest.
2025-12-07 08:16:16 +01:00
akallabeth
5223fd55cb [client,common] fix retry counter
The counter must start at 0 and be incremented afer use
2025-11-13 15:06:30 +01:00
akallabeth
6c7b798cb5 [client,common] improve multitouch mouse emulation 2025-10-31 09:07:01 +01:00
Olivier Blin
8587684401 [client,common] fix build without client channels 2025-10-21 14:27:02 +02:00
Loïc Yhuel
8bbc31eb53 [client,common] fix build without RDPEI channel
Also fix existing error messages to mention CHANNEL_RDPEI_CLIENT instead of
WITH_CHANNELS to be more specific.
2025-10-21 14:26:18 +02:00
Armin Novak
c0da27476f [client,common] improve retry handling
* Log each return path
* Correctly apply the returned delay
2025-10-01 09:13:47 +02:00
akallabeth
a5ba33eb68 [client,common] remove useless printf 2025-09-29 11:46:06 +02:00
akallabeth
9677931343 [core,arm] fix domain setting
While AzureAD seems to be required for many setups, some need an empty
domain (or maybe a different all together?)
So only provide a sane default and allow user override.
2025-09-29 10:17:01 +02:00
akallabeth
74648eb3a9 [c,standard] use C99 inline 2025-09-26 11:29:26 +02:00
Armin Novak
c5133def8a [client] add prompt for AUTH_RDSTLS
the authentication type uses a fixed domain, so don't query it.
2025-09-24 14:01:12 +02:00
Armin Novak
45c7df6d61 [core,utils] add auth type AUTH_RDSTLS 2025-09-23 16:05:31 +02:00
akallabeth
4dc6091fde [client,common] fix -mouse-motion
* Move code to client/common to have it in place for all clients without
  modification
* Remember if a button was pressed and only suppress move events if no
  button is pressed.
2025-06-18 12:46:56 +02:00
akallabeth
79ac927371 [client,common] change AAD url depending on request
* stdio callbacks use a redirect URL with https
* webview uses a redirect URL with ms-appx-web
2025-06-13 19:05:54 +02:00
akallabeth
17dcb86519 [client,common] fix missing AAD guards 2025-06-13 11:23:37 +02:00
akallabeth
ee6d95ab25 [warnings] fix unused warnings 2025-06-13 10:15:56 +02:00
akallabeth
6168a7bfd1 [client,common] make all azure settings configurable 2025-06-10 16:30:06 +02:00
Armin Novak
46b5f890b6 [client,common] make sso-mib opaque
Contain details of implementation in sso_mib_new and sso_mib_free
2025-05-21 14:52:06 +02:00
Armin Novak
66a69a26e2 [client,common] initialize sso-mib late
Only initialize the sso-mib library when a token is requested for the
first time. This allows proper rdpSettings initialization in PreConnect.
2025-05-21 14:31:34 +02:00
Armin Novak
39f7972b28 [client,common] add common GetCommonAccessToken
If client-common is build with WITH_SSO_MIB inject a callback that first
tries to retrieve a token from sso-mib library and only if that fails
falls back to a client provided callback.
2025-05-21 14:00:10 +02:00
Andreas Ziegler
d3ba03bba4 refactor: move sso-mib token fetching into separate compilation unit 2025-05-21 11:44:16 +02:00
Andreas Ziegler
8714019703 refactor: move MIBClientApp into struct rdp_client_context 2025-05-21 11:44:16 +02:00
Andreas Ziegler
5e76909881 feat: add login through MS identity broker via sso-mib interface
This change enables an alternative way of acquiring the necessary
access tokens through a local identity broker. In the current
implementation, we need to visit URLs twice and paste back the
URLs we are redirected to in order to extract authorization codes
and ultimately fetch the correct access tokens for RDP (described
here: <0>).

As an alternative, MS also provides the Microsoft Authentication
Library (MSAL) through which authentication can be handled more
or less in the background when we're using a trusted device. In
particular, we can request access tokens with the same
parameters as we're currently doing through the URL-based scheme.

As the MSAL bindings are not available for C, we implemented a
small wrapper library called sso-mib which is available at
https://github.com/siemens/sso-mib. This library translates the
high-level requests (such as acquire_token_interactive) to
respective messages on the D-Bus messaging bus which is used to
communicate with the identity broker service on Linux. The
library can be built as a .deb package and subsequently be
found through PkgConfig mechanisms in CMake.

When sso-mib is not available through pkg-config, it can also
be placed in external/, with the directory structure looking
like the following. include/ is copied from the root of the
sso-mib directory and lib/ populated with the built shared
library files and symlinks.

    external/
    ├── README
    └── sso-mib
        ├── include
        │   └── sso-mib
        │       ├── mib-account.h
        │       ├── mib-client-app.h
        │       ├── mib-exports.h
        │       ├── mib-pop-params.h
        │       ├── mib-prt.h
        │       ├── mib-prt-sso-cookie.h
        │       └── sso-mib.h
        └── lib
            ├── libsso-mib.so -> libsso-mib.so.0
            ├── libsso-mib.so.0 -> libsso-mib.so.0.4.0
            └── libsso-mib.so.0.4.0

This feature is currently hidden behind a configuration switch
and must be enabled via `-DWITH_SSO_MIB=ON`. If the connection
to the broker fails (for example, if no identity broker is
installed or running on the system), we automatically fall back
to the current scheme of copy-pasting URLs.

<0>: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpbcgr/e967ebeb-9e9f-443e-857a-5208802943c2
2025-05-21 11:44:16 +02:00
akallabeth
031dd16079 [warnings] clean up unused parameter and dead code 2025-03-03 12:08:35 +01:00
akallabeth
36c5826f45 [client,warnings] fix -Wunused-parameter for common 2025-02-13 15:54:04 +01:00
akallabeth
9f8ed06f9a [client,cmdling] use a typedef for callback function
typedef freerdp_command_line_handle_option_t to have a common type for
callback functions
2025-02-11 12:21:41 +01:00
akallabeth
6701359cc1 [warnings] fix integer casting
* use WINPR_ASSERTING_INT_CAST where possible
* clean up client code
2024-12-19 12:45:23 +01:00
akallabeth
df12907099 [client,common] fix leak in client_cli_get_rdsaad_access_token 2024-12-16 14:01:49 +01:00
akallabeth
f25be351b1 [core,gateway] Make tenantid use optional 2024-12-10 15:13:16 +01:00
Armin Novak
f17c1830b7 [aad,avx] improve AzureAD support
* New setting GatewayAzureActiveDirectory to fetch wellknown from
* Clean up command line arguments, rename to make function better
  understandable
2024-12-10 15:12:41 +01:00
akallabeth
f92984b234 [client,aad] use configurable redirection url
Create the redirection URL for AAD auth from the endpoint configuration.
2024-12-10 15:12:36 +01:00
akallabeth
b2756842b2 [core,aad] fetch wellknown before GetAccessToken
All of the URL we need for AAD authentication are dependent on a tenantid.
Fetch the wellknown file for the desired tenantid from
https://login.microsoftonline.com/{tenantid}/v2.0/.well-known/openid-configuration
and parse as JSON to have them available later on.
2024-12-10 15:12:30 +01:00
stephanebill
4f2afa8c47 spell check with codespell 2024-11-20 16:53:40 -05:00
akallabeth
78acedb40e [warnigns] fix Wshorten-64-to-32 2024-11-11 10:22:37 +01:00
akallabeth
fb3a127d00 [common,cmdline] add new functions
* Add freerdp_client_print_version_ex and
  freerdp_client_print_buildconfig_ex to print version and build
  configuration along with the binary name calling it
* Use these new functions instead of the ones that only print out
  version and/or buildconfig
2024-11-04 09:06:12 +01:00
akallabeth
ecc84158b7 [client,common] include binary name in client buildconfig 2024-11-04 08:42:13 +01:00
akallabeth
26003e59cc [va_list] initialize with ={0}; 2024-09-24 11:06:18 +02:00